How it works

We load stereo rig parameters estimated earlier from file. The rectification procedure itself estimates such camera transformations so that two separate image planes become the same plane afterwards. This greatly simplifies the epipolar geometry constraints and makes the job for all other stereo-related algorithms much easier.

The rectification transformation parameters are estimated using the cv2.stereoRectify function—it takes the stereo rig parameters and returns the rectification parameters: the first camera rotation, second camera rotation, first camera projection matrix, second camera projection matrix, disparity-to-depth mapping matrix, the first camera ROI where all the pixels are valid, and the second camera ROI where ...

Get OpenCV 3 Computer Vision with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.