在稠密三维重建中,rectification可以简化patch match的过程。在双目特征匹配等场景中其实也用得到,看了一下一篇论文叫< A Compact Algorithm for Rectification of Stereo Pairs>,笔记如下。
A Compact Algorithm for Rectification of Stereo Pairs - Paper Reading
Abstract
- 一个线性rectification algorithm
- 用了两个perspective projection matrices
- 对于三维重建可忽略的精度影响
Introduction and motivations
优点: 把stereo correspondences变得简单。因为只需要在平行的轴上搜索就行了。
相机模型和对极几何
给一个世界坐标系下的3D点\(\mathbf{w}=[x y z]^{\top}\)和一个图片上的像素坐标\(\mathbf{m}=\left[ \begin{array}{ll}{u} & {v}\end{array}\right]^{\top}\)。这个从3D到2D的投影叫做perspective projection,是由一个homogeneous coordinates下的线性变换表示的。
Let \(\tilde{\mathbf{m}}=[u v 1]^{\top}\) and \(\tilde{\mathbf{w}}=[x y z 1]^{\top}\), 那么这个变换是: \(\lambda \tilde{\mathbf{m}}=\tilde{\mathbf{P}} \tilde{\mathbf{w}}\)。
这里的矩阵P是可以被分解的,如果用QR分解的话得到:
这里的 矩阵\(A\)是跟相机内参有关:
把PPM写成如下形式:
在迪尔卡坐标系中,这个投影过程如下:
焦平面(\(focal \ plane\))和视网膜平面(retinal plane)平行,并且包含光心(C)。光心的坐标是:\(\mathbf{c}=-\mathbf{Q}^{-1} \tilde{\mathbf{q}}\)
这样的话\(\tilde{\mathbf{P}}\)可以被重写为:\(\tilde{\mathbf{P}}=[\mathbf{Q} |-\mathbf{Q} \mathbf{c}]\)。
Rectification of Camera matrices
假设一个stereo rig已经被标定了(大概就是两个相机的内外参都知道的意思),那么两个PPM(perspective projection matrices)都已经知道。、
rectification的idea: Define two new PPMs by rotating the old ones around their optical centers until focal planes becomes coplanar, thereby containing the baseline.这种方式可以保证核点在无穷远,所以对极线是平行的。为了得到平行的对极线,基线必须是和两个相机的新的x轴平行。
总结来说:
- 新的PPM的光心和旧的一样,但是旋转不一样了。
- 两个相机的内参一样
- 所以结果的PPMs只会有光心上的不同,可以被认为一个相机沿着x轴移动了。
两个新的PPMs如下:
内参\(A\)是不变的,两个光心\(c_1\)和\(c_2\)和旧的光心一致。
把旋转矩阵由行向量表示:
分别表示的是\(X, Y and Z\)坐标轴。
- 新的X轴和基线平行: \(r1 = (c1-c2)/||c1-c2||\)
- 新的Y轴和X轴垂直: \(\mathbf{r}_{2}=\mathbf{k} \wedge \mathbf{r}_{1}\) : 这儿的\(k\)是一个随机的向量,我们使它。。。
- 新的Z轴和XY垂直: \(\mathbf{r_3}=\mathbf{r}_{1} \wedge \mathbf{r}_{2}\)
The Rectifying Transformation
- sought: 被寻求的,seek的过去式和过去分词
Conclusion
我们的测试显示不会引入可见的误差。