我想用双摄像机双目标定计算的旋转矩阵和平移向量来验证SFM计算的固有矩阵分解的旋转矩阵和平移向量。'
calRealPoint(objRealPoint, boardWidth, boardHeight, frameNumber, squareSize);
cout << "cal real successful" << endl;
double rms = stereoCalibrate(objRealPoint, imagePointL, imagePointR,
cameraMatrixL, distCoeffL,
cameraMatrixR, distCoeffR,
Size(imageWidth, imageHeight), R, T, E, F/*, rvecs, rvecs*/, CALIB_USE_INTRINSIC_GUESS,
TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, 1e-5));
cout << "Stereo Calibration done with RMS error = " << rms << endl;
// corrected images
int pass_count = recoverPose(p1, p2, K_LEFT, noArray(), K_RIGHT, noArray(), E_, R_, t);
结果是旋转矩阵有些不同,平移向量也有很大不同。
输入图片描述
输入图片描述
然后我检查了API文档,我想问的是文档中的T和T有什么区别?
最后我使用decomposeEssentialMat函数来计算t。'
Mat t_, R1, R2;
decomposeEssentialMat(E, R1, R2, t_);
t : [-0.9992756029282842;
0.004148058533358282;
0.03782939336967541]
T=[-30.43588350113243;
0.126341347579394;
1.152205663926915]
'那么T和T到底有什么区别呢?谢谢你
查看OpenCV参考手册中的decomposeEssentialMat
规格。你会发现它写着
…,你只能得到平移的方向,所以函数返回单位t。