现实世界的单位似乎在OpenCV中缩放

时间:2014-06-30 16:24:22

标签: android c++ opencv camera camera-calibration

我正在尝试设置立体声校正。我只使用一个相机围绕物体旋转一小步。但我很困惑。我试图拍摄的物体大小约为3-4厘米。旋转半径约为6厘米。但是当我纠正时,我有xyz矩阵的有限值,每个都有相机的长度约300-2000单位。为什么?如何在第一个参考系中获得第二个摄像机的位置/旋转(摄像机的第二个位置)?

org.opencv.calib3d.Calib3d.stereoRectify(mCameraMatrix, mDistortionCoefficients, 
mCameraMatrix, mDistortionCoefficients, dispFloat.size(), R, T, R1, R2, P1, P2, Q);
org.opencv.calib3d.Calib3d.reprojectImageTo3D(dispFloat,xyz,Q);

矩阵的值是(伪代码):

Input:
mCameraMatrix:
|1076.080810546875f,0.0f,639.5f|
        |0.0f,1076.080810546875f, 359.5f|
        |0.0f,0.0f,1.0f,|
mDistortionCoefficients:
| 0.11665083467960358f,-0.15972141921520233f,0.0f,0.0f,-0.29710251092910767f|

R:
|[0.965926,0,0.258819]|
|[0,1,0]|
|[-0.258819,0,0.965926]|

 T:
|[1.55291,0,0.204445]|

output:
R1:
|0.9965080795455151,        -0.0733390286815368,        0.039912833431844846|
|0.08349638947769386,       0.8751762387100398,     -0.47654475565421633|
|1.8566063818213976E-5,     0.4782132767598534,     0.8782437370035183|
R2:
| 1.0,      0,      0|
|0,     0.8784559480840216,     0.4778233431675381|
|0,     -0.47782334316753805,       0.8784559480840215|
P1:
|538.0404052734375,     0.0,        756.766210841568,       0.0|
|0.0,       538.0404052734375,      428.56917572021484,     0.0|
|0.0,       0.0,        1.0,        0.0|
P2:
|538.0404052734375,     0.0,        756.766210841568,       |-281.3598668991448
|0.0,       538.0404052734375,      428.56917572021484,     0.0|
|0.0,       0.0,        1.0,        0.0|
Q:
|1.0,       0.0,        0.0,        -756.766210841568|
| 0.0,      1.0,        0.0,        -428.56917572021484|
|0.0,       0.0,        0.0,        538.0404052734375|
|0.0,       0.0,        1.9122855409449757,     -0.0|

据我所知,由于mCameraMatrix [0] [0]和mCameraMatrix [1] [1]而导致的值非常大,其值约为1000。如何重新计算到实际大小?如何获得第一个位置参考系中的第二个摄像机位置?

0 个答案:

没有答案