Obtain vertical translation between rectified images from stereo parameters.

5 次查看(过去 30 天)
I'm currently trying to calibrate an array of six cameras positioned in three pairs in a line. The aim of this is to create three disparity maps which may be stitched to create a single map.
Currently I am using the Stereo Camera Calibrator of the Image Processing and Computer Vision Toolbox and calibrating five cameras to one central camera. The intrinsics of each camera have been previously obtained using OpenCV and input to the tool. This allows me to obtain the rectification and translation matrices for each camera which works perfectly.
The problem I am currently having is obtaining the valid area of each image. This would be obtained using the vertical translation of the translation matrix to vertically align the image but this value is given in millimetres. From there it should be a case of simply resizing the images to remove the invalid areas and allow stitching.
My question is how would I use the output Stereo Parameters to obtain this vertical translation between the undistorted and rectified images in pixels?
Thank you.

回答(1 个)

Rijuta
Rijuta 2023-9-15
Hi Thomas,
To obtain the vertical translation between the undistorted and rectified images in pixels, you can follow these steps:
1. After calibrating the cameras using the Stereo Camera Calibrator of the Image Processing and Computer Vision Toolbox, you should have obtained the ‘stereoParameters’ object.
2. Extract the rectification and translation matrices for each camera from the stereoParameters object. These matrices should be named `T1` and `T2` respectively.
3. The translation matrix `T` represents the shift between the rectified and undistorted images. Specifically, `T1` represents the transformation for the left camera, and `T2` represents the transformation for the right camera.
4. To obtain the vertical translation in pixels, you need to look at the third element of the translation vectors in `T1` and `T2`. These elements represent the vertical shift in millimeters.
5. Convert the vertical translation from millimeters to pixels using the camera's focal length.
6. Once you have the vertical translation in pixels, you can resize the images to remove the invalid areas and allow stitching. Crop the images based on the calculated translation to keep only the valid region.
I hope the above steps answer your query. To get detailed understanding of the Stereo Image Rectification, please refer to the documentation below: Stereo Image Rectification - MATLAB & Simulink (mathworks.com)

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by