MATLAB: Camera Calibration: Tilt image to make camera and image plane perpendicular

Computer Vision Toolboximage rotationimage transformationMATLAB and Simulink Student Suitestereo camera calibrationtilt image

I am currently working in the fields of computer vision and camera calibration. I use the Stereo Camera Calibrator App provided by the Computer Vision System Toolbox which gives me the following screenshot:
As you can see, the cameras are not positioned directly above the image plane meaning that distant parts of the image appear smaller than they actually are. I have to compare the images to a reference which means that I have to tilt and rotate the images, respectively, so that the image plane is first perpendicular to camera 1 and then to camera 2. I exported the cameraParameters object which gives me a ton of information about the stereo camera setup, unfortunately I do not know how to figure out the angle or where I can find it to transform the images. Does anybody know how to achieve that? Thank you for your efforts.

Best Answer

The easist way to compare the two images in same plance is to use rectifyStereoImages function, but if you want to know more what the function does e.g. what transformation matrix is used, you'll need to take a look at Bradski's book which is cited in this document.
Hope this helps,
Tohru