AI Glossary / Computer vision and multimodal AI / Intermediate
Image rectification
Definition
Image rectification transforms images into a geometry that simplifies a particular task. In stereo vision, it commonly warps a pair so corresponding scene points lie on matching horizontal or vertical lines, reducing the search for correspondences from a general two-dimensional problem to a one-dimensional one.
What it means
Two cameras usually view the same scene from different positions and orientations. A point in one image has a corresponding point constrained to an epipolar line in the other. Rectification reorganizes the images so those lines align with image rows or columns. It does not remove the displacement between corresponding points; that remaining disparity carries depth information. The term can also describe correcting the perspective of a planar surface, such as a document. These uses share geometric transformation but have different objectives and assumptions, so the intended kind of rectification should be stated.
How it works
Stereo rectification uses calibrated camera geometry or estimated epipolar relationships to construct transformations for the two views. Images are resampled into the new coordinate systems, often with lens-distortion correction integrated into the mapping. Output size and cropping determine which regions remain valid. A matching algorithm can then search along corresponding epipolar rows or columns.
Calibration error, rolling shutter, imperfect synchronization and non-ideal lenses can leave residual misalignment. Rectification also changes image sampling and can stretch some regions. It does not solve occlusion or texture ambiguity. Depth reconstruction requires additional geometry and a valid disparity estimate, not merely a pair of rectified images.
Three practical examples
- A stereo-camera system rectifies its image pair before estimating disparity and depth.
- A document application maps a flat page into a more front-facing view before text extraction.
- A robotics engineer checks rectified calibration images to verify that corresponding features align with the intended epipolar direction.
Think of it this way
Think of rearranging two maps so comparable routes run along the same grid rows, making it easier to compare positions. The analogy is limited because stereo rectification preserves meaningful displacement rather than making every feature coincide, and the transformations are constrained by camera geometry.
Worked example
Suppose a scene feature appears at (120,80) in the left rectified image and (110,80) in the right. Their row coordinates agree, and the horizontal disparity is 120−110=10 pixels under this convention. Another feature at (200,90) and (180,90) has disparity 20 pixels.
For an ideal calibrated parallel stereo model with focal scale f=800 pixels and baseline B=0.1 meters, depth is Z=fB/d. The two disparities correspond to 8 meters and 4 meters respectively. These values assume the stated model, calibration and disparity convention. Rectification alone does not establish those assumptions or guarantee that the feature matches are correct.
Illustrative case study
Fictional example: Cedar Robotics notices that its stereo matcher struggles near the image edges. A rectified checkerboard test shows corresponding corners on slightly different rows. The team investigates calibration and distortion handling before changing the matching algorithm. After revising the mapping, it still tests reflective and textureless surfaces separately. The case illustrates that geometric preparation can remove one source of error without solving every correspondence problem.
Common misconceptions and mistakes
Rectification is not the same as registering all scene points to identical coordinates. In stereo, disparity normally remains and is useful. Rectified images are not automatically distortion-free measurements at every location. Cropping or resizing can require updated calibration parameters. A visually level horizon does not prove correct epipolar alignment. Finally, planar document rectification and stereo rectification should not be treated as interchangeable procedures simply because both use warps.
Business use
Businesses deploying stereo or document geometry should validate the complete capture and transformation pipeline. Record calibration, output dimensions, valid regions and coordinate conventions. Use known targets across the field of view, and monitor changes after camera movement or replacement. For depth applications, distinguish rectification error from matching error and uncertainty in baseline or focal scale. Preserve the mapping needed to relate processed coordinates back to the original images. A reliable workflow makes geometric assumptions explicit before downstream measurements are trusted.
People also ask
Does rectification make stereo images identical?
No. It aligns epipolar geometry while leaving disparities, occlusions and appearance differences.
Must epipolar lines always be horizontal?
Horizontal alignment is common, but some configurations use vertical alignment or other documented conventions.
Can rectification recover hidden surfaces?
No. A surface visible in only one view may still lack a valid correspondence in the other.
Check your understanding
A point has the same row in two horizontally rectified images but different columns. Is that necessarily a rectification failure?
Answer: No. The column difference is disparity and is expected in stereo. A row mismatch would be a more direct sign to investigate under that convention.
Related terms
- Epipolar geometry
- Disparity
- Image warping
- stereo vision
- camera calibration
- homography
- depth reconstruction
Learn next
Learn epipolar lines and camera calibration, then inspect corresponding points before and after rectification. Study disparity-to-depth conversion only after confirming coordinate conventions and the validity of the camera model.
More in Computer vision and multimodal AI
- Ill-conditioning - Ill-conditioning means that small changes in a problem's inputs can cause comparatively large changes in its solution.
- Image - In computer vision, an image is a spatially organized representation of visual or other measured information.
- Image Analogies - Image Analogies is an example-based image-processing framework that uses a pair of images showing an input and its transformed appearance to guide a similar...
- Image-based lighting - Image-based lighting uses an image representing environmental illumination to light a rendered scene.
- Image-based rendering - Image-based rendering generates views of a scene using captured or previously rendered images as a central representation.
- Image captioning - Image captioning is the task of generating a natural-language description of an image's visible content.
Sources
OpenCV, Camera Calibration and 3D Reconstruction, stereoRectify documentation: https://docs.opencv.org/4.10.0/d9/d0c/group__calib3d.html Official camera-geometry excerpts consulted; full calibration-specific and editorial review remain pending. Disparity and depth calculations are original idealized examples.
Previous: Image recognition Next: Image registration