首页 文章

OpenCv StereoRectify中矩阵的精确定义

提问于
浏览
6

通常,投影矩阵 P 的定义是3x4矩阵,它将点从世界坐标投影到图像/像素坐标 . 投影矩阵可以分为:

  • K :具有内在参数的3x4相机矩阵K.

  • T :具有外部参数的4x4变换矩阵

然后投影矩阵为 P = K * T .

OpenCV的stereoRectify的以下输入有哪些明确的定义:

  • cameraMatrix1 - 第一个相机矩阵 (I assume it is the instrinsic K part of the projection matrix, correct?) .

  • R - 第一个和第二个摄像机的坐标系之间的旋转矩阵 . (what does 'between' means? Is it the rotation from cam1 to cam2 or from cam2 to cam1?)

  • T - 摄像机坐标系之间的平移向量 . (Same is above. Is the translation from cam1 -> cam2 or cam2->cam1)

  • R1 - 为第一台摄像机输出3x3整流变换(旋转矩阵) . (Is this the rotation after rectification so the new extrinsic part of the projection matrix becomes T1new = R1*T1old?)

  • P1 - 在第一台摄像机的新(整流)坐标系中输出3x4投影矩阵 . (What is meant by 'projection matrix in the new coordinate system'? It seems that this projection matrix is dependent on the rotation matrix R1 to project point from world coordinates to image/pixel coordinates, so from the above definition it is neither the 'projection matrix' or the 'camera matrix' but some kind of mixture of the two)

1 回答

  • 1
    • CAMERAMATRIX1 - 是由opencv中的stereocalibrate()函数计算的内在K矩阵 . 你做对了!!!

    • R 是cam2框架w.r.t cam1框架的旋转矩阵 . 类似地, T 是cam2原点w.r.t cam1原点的平移向量 .

    • 如果你'll look in O'莱利书"LEARNING OPENCV" pg.-434,你会明白 R1 (/ Rl )和 R2 (/ Rr )是什么 .

    Rl = [ Rrect ] [ rl ]; Rr = [ Rect ] [ rr ];

    让相机_545099完成,然后plane1和plane2根本不会平行 . 此外,epilines将不会与立体相机基线平行 . 因此,Rl所做的是它将左图像平面变换为与右图像平面平行(由Rr变换),并且两个图像上的epilines现在是平行的 .

    • P1P2 是立体声整流后的新投影矩阵 . 请记住,相机矩阵(K)将3d空间中的点转换为2d图像平面 . 但是P1和P2在整流的2D图像平面上转换3d空间中的一个点 .
      如果您之前已经校准过立体摄像机装置并观察了P1和K1值,那么如果您的立体声装置几乎处于整流配置(显然在人类范围内),您会发现它们非常相似

相关问题