校准两台摄像机时遇到问题:第一台是rgb,第二台是红外线。他们有不同的分辨率(我调整大小和更大的图像),焦距等...
示例:
RGB 1920x1080
红外线512x424
如何相互校准?我应该在stereoCalibrate中使用哪些参数。 默认样本stereo_calib.cpp会产生很大的错误。 这样的事情:https://www.dropbox.com/s/x57rrzp1ejm3cac/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202014-04-05%2012.54.17.png
完成RMS错误= 4.1026
平均重投影错误= 10.2601
更新
我使用calibration.cpp示例独立生成每个摄像机的校准参数。对于RGB相机,我首先调整大小并裁剪图像以使分辨率与IR相机(512x424)匹配,然后进行校准。对于RGB相机我得到camera.yml,对于红外相机我得到camera_ir.yml。 然后我尝试使用修改后的stereo_calib.cpp示例进行立体声校准。在调用stereoCalibrate之前,我从文件中读取camera_matrix和distortion_coefficients参数,并将这些矩阵放入stereoCalibrate。
FileStorage rgbCamSettings("camera.yml", CV_STORAGE_READ);
Mat rgbCameraMatrix;
Mat rgbDistCoeffs;
rgbCamSettings["camera_matrix"] >> rgbCameraMatrix;
rgbCamSettings["distortion_coefficients"] >> rgbDistCoeffs;
FileStorage irCamSettings("camera_ir.yml", CV_STORAGE_READ);
Mat irCameraMatrix;
Mat irDistCoeffs;
irCamSettings["camera_matrix"] >> irCameraMatrix;
irCamSettings["distortion_coefficients"] >> irDistCoeffs;
Mat cameraMatrix[2], distCoeffs[2];
cameraMatrix[0] = rgbCameraMatrix;
cameraMatrix[1] = irCameraMatrix;
distCoeffs[0] = rgbDistCoeffs;
distCoeffs[1] = irDistCoeffs;
Mat R, T, E, F;
double rms = stereoCalibrate(objectPoints, imagePoints[0], imagePoints[1],
cameraMatrix[0], distCoeffs[0],
cameraMatrix[1], distCoeffs[1],
imageSize, R, T, E, F,
TermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 50, 1e-6),
CV_CALIB_FIX_INTRINSIC +
CV_CALIB_USE_INTRINSIC_GUESS
);