Recently, I was testing binocular vision project.
This is code
stereoRectify(camera1Matrix, camera1DistCoeffs, camera2Matrix, camera2DistCoeffs, ImageSize, R, T, R1, R2, P1, P2, Q, CALIB_ZERO_DISPARITY, 1, ImageSize_RT, &roi1, &roi2);
initUndistortRectifyMap(camera1Matrix, camera1DistCoeffs, R1, P1, ImageSize_RT, CV_16SC2, map1x, map1y);
initUndistortRectifyMap(camera2Matrix, camera2DistCoeffs, R2, P2, ImageSize_RT, CV_16SC2, map2x, map2y);
remap(srcImage1, dstimage1, map1x, map1y, INTER_LINEAR, 2);
srcImage1_RP.push_back(dstimage1);
remap(srcImage2, dstimage2, map2x, map2y, INTER_LINEAR, 2);
srcImage2_RP.push_back(dstimage2);
and this is result.
I can’t upload more pictures. After my test, No matter the parameter alpha of stereoRectify is set to - 1, 0 or 1, no reasonable result can be obtained
This problem only occurs when I set a large tilt angle for both cameras.
I don’t know what caused this problem.
The angle of the camera was fixed for other reasons
So I need help!