Rectifying stereo images
Contents
1. Theory
See the documentation from Willow Garage’s OpenCV for
The following video (view on YouTube) illustrates the effects of each of these parameters:
2. In practice: step by step procedure with MRPT
See docs for the class: mrpt::vision::CStereoRectifyMap
3. Example C++ code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
mrpt::vision::CStereoRectifyMap rectify_map; // Set options as desired: // rectify_map.setAlpha(...); // rectify_map.enableBothCentersCoincide(...); while (true) { // Grab stereo observation from wherever mrpt::slam::CObservationStereoImagesPtr obs_stereo = ... // Only once, construct the rectification maps: if (!rectify_map.isSet()) rectify_map.setFromCamParams(*obs_stereo); // Rectify in place: unmap.rectify(*obs_stereo); // Rectified images are now in: obs_stereo->imageLeft & obs_stereo->imageRight } |
4. A complete example
See the example: