zoukankan      html  css  js  c++  java
  • PatchMatchStereo可能会需要的Rectification

    在稠密三维重建中,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]^{ op})和一个图片上的像素坐标(mathbf{m}=left[ egin{array}{ll}{u} & {v}end{array} ight]^{ op})。这个从3D到2D的投影叫做perspective projection,是由一个homogeneous coordinates下的线性变换表示的。

    Let ( ilde{mathbf{m}}=[u v 1]^{ op}) and ( ilde{mathbf{w}}=[x y z 1]^{ op}), 那么这个变换是: (lambda ilde{mathbf{m}}= ilde{mathbf{P}} ilde{mathbf{w}})

    这里的矩阵P是可以被分解的,如果用QR分解的话得到:

    [ ilde{mathbf{P}}=mathbf{A}[mathbf{R} | mathbf{t}] ]

    这里的 矩阵(A)是跟相机内参有关:

    [mathbf{A}=left[ egin{array}{ccc}{alpha_{u}} & {gamma} & {u_{0}} \ {0} & {alpha_{v}} & {v_{0}} \ {0} & {0} & {1}end{array} ight] ]

    把PPM写成如下形式:

    [ ilde{mathbf{P}}=left[ egin{array}{c}{mathbf{q}_{1}^{ op} | q_{14}} \ {mathbf{q}_2^{ op}|q_{24}} \ {mathbf{q}_{3}^{ op} | q_{34}}end{array} ight]=[mathbf{Q} | ilde{mathbf{q}}] ]

    在迪尔卡坐标系中,这个投影过程如下:

    [left{egin{array}{l}{u=frac{mathbf{q}_{1}^{ op} mathbf{w}+q_{14}}{mathbf{q}_{3}^{ op} mathbf{w}+q_{34}}} \ {v=frac{mathbf{q}_{2}^{ op} mathbf{w}+q_{24}}{mathbf{q}_{3}^{ op} mathbf{w}+q_{34}}}end{array} ight. ]

    焦平面((focal plane))和视网膜平面(retinal plane)平行,并且包含光心(C)。光心的坐标是:(mathbf{c}=-mathbf{Q}^{-1} ilde{mathbf{q}})

    这样的话( ilde{mathbf{P}})可以被重写为:( ilde{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轴平行。

    • [ ] 另外,为了得到一个合理的rectification, conjugate points必须要有一样的垂直坐标系。这个要求新相机要有一样的内参。

    总结来说:

    • 新的PPM的光心和旧的一样,但是旋转不一样了。
    • 两个相机的内参一样
    • 所以结果的PPMs只会有光心上的不同,可以被认为一个相机沿着x轴移动了。

    两个新的PPMs如下:

    [ ilde{mathbf{P}}_{n 1}=mathbf{A}left[mathbf{R} |-mathbf{R} mathbf{c}_{1} ight], quad ilde{mathbf{P}}_{n 2}=mathbf{A}left[mathbf{R} |-mathbf{R} mathbf{c}_{2} ight] ]

    内参(A)是不变的,两个光心(c_1)(c_2)和旧的光心一致。

    把旋转矩阵由行向量表示:

    [mathbf{R}=left[ egin{array}{c}{mathbf{r}_{1}^{ op}} \ {mathbf{r}_{2}^{ op}} \ {mathbf{r}_{3}^{ op}}end{array} ight] ]

    分别表示的是(X, Y and Z)坐标轴。

    1. 新的X轴和基线平行: (r1 = (c1-c2)/||c1-c2||)
    2. 新的Y轴和X轴垂直: (mathbf{r}_{2}=mathbf{k} wedge mathbf{r}_{1}) : 这儿的(k)是一个随机的向量,我们使它。。。
    3. 新的Z轴和XY垂直: (mathbf{r_3}=mathbf{r}_{1} wedge mathbf{r}_{2})

    The Rectifying Transformation

    • sought: 被寻求的,seek的过去式和过去分词

    Conclusion

    我们的测试显示不会引入可见的误差。

  • 相关阅读:
    Go入门笔记-14 EdgeX读取配置文件
    Go入门笔记-13 使用EdgeX日志输出
    Go入门笔记-12 输出unix时间戳
    Go入门笔记-11 Go 获取Linux系统CPU占用率
    htop使用
    Ubuntu子系统默认使用root登录
    函数参数传递数组
    c 'CRTSCTS' undeclared
    c 数组指针使用
    使用SD卡刷OpenWRT后,调整分区大小
  • 原文地址:https://www.cnblogs.com/tweed/p/10895021.html
Copyright © 2011-2022 走看看