How can I get Rectification Map Values after Stereo Camera Calibration ?

8 views (last 30 days)
Hi, Is there any way i can access the values of the Rectification maps after stereo calibration of a camera ?
I know the values of the rectification transforms (R1 and R2) from the following piece of code :-
load ("CamCalib.mat")
LeftImage = imread("Left Frame.png");
RightImage = imread("Right Frame.png");
[~, ~, ~, CamLeft, CamRight, R1, R2] = rectifyStereoImages(LeftImage, RightImage, CamCalib);
[RecLeftImage, RecRightImage, Q] = rectifyStereoImages(LeftImage, RightImage, CamCalib);
However when i am using these values R1 and R2 in the OpenCV function initUndistortRectifyMap i am not getting the same rectified frames as MATLAB.
So i want to see the difference between the Rectification Maps created from OpenCV and MATLAB, but i was unable to find any way to see the values of the Rectification Maps for both the frames.
Please help me in understanding this issue. Any help would be highly appreciated. Thanks.

Answers (1)

Sarthak
Sarthak on 16 May 2023
Hi Soumya,
You can get the Rectification Map by finding the (x,y) bounds and Homography matrices from ComputeRectificatoinParams.m and then using Homography and undistortion equations and then interp2 which will give accurate rectifications.
Attaching a documentation link and an answer for your reference

Categories

Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!