Rectification problem stereo vision
Hello everybody.
I have a problem with my code. I am trying create a 3d model with stereo vision. With one of the two test dataset, everything works fine and I am able to build the 3d model. With the second dataset I have some problem in the rectification.
here there is for example the normal left image:
Here the rectified image:
And here the code for calibration and rectification:
cv::stereoCalibrate(objectPoints, imagePoints_l, imagePoints_r,
cameraMatrix_l, distCoeffs_l, cameraMatrix_r, distCoeffs_r,
imageSize, R, T, E, F, TermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 100, 1e-5),
CV_CALIB_FIX_INTRINSIC);
where I set CV_CALIB_FIX_INTRINSIC because I calibrated separately the two cameras.
cv::stereoRectify(cameraMatrix_l, distCoeffs_l, cameraMatrix_r, distCoeffs_r, imageSize, R, T, R1, R2, P1, P2, Q, 0, 0);
For stereo rectification.
remap(leftImg, undistortedLeftImg, map1_l, map2_l, INTER_LINEAR);
remap(rightImg, undistortedRightImg, map1_r, map2_r, INTER_LINEAR);
For remapping
Is it possible that the wrong rectifications depends on low quality calibration images?
Thank you very much!!