page_title: Image rectification
section_title: Example
hierarchical_section_title: Image rectification / In computer vision / Example
caption_attribution_description: English: 2D images from image rectification example scene.
context_page_description: Image rectification is a transformation process used to project images onto a common image plane. This process has several degrees of freedom and there are many strategies for transforming images to the common plane.
  It is used in computer stereo vision to simplify the problem of finding matching points between images.
  It is used in geographic information systems to merge images taken from multiple perspectives into a common map coordinate system.
context_section_description: Our model for this example is based on a pair of images that observe a 3D point P, which corresponds to p and p'  in the pixel coordinates of each image. O and O'  represent the optical centers of each camera, with known camera matrices  and  (we assume the world origin is at the first camera). We will briefly outline and depict the results for a simple approach to find a H and H'  projective transformation that rectify the image pair from the example scene.
  First, we compute the epipoles, e and e'  in each image:
  Second, we find a projective transformation H₁ that rotates our first image to be perpendicular to the baseline connecting O and O'  (row 2, column 1 of 2D image set). This rotation can be found by using the cross product between the original and the desired optical axes. Next, we find the projective transformation H₂ that takes the rotated image and twists it so that the horizontal axis aligns with the baseline. If calculated correctly, this second transformation should map the e to infinity on the x axis (row 3, column 1 of 2D image set). Finally, define  as the projective transformation for rectifying the first image.
  Third, through an equivalent operation, we can find H'  to rectify the second image (column 2 of 2D image set). Note that H'₁ should rotate the second image's optical axis to be parallel with the transformed optical axis of the first image. One strategy is to pick a plane parallel to the line where the two original optical axes intersect to minimize distortion from the reprojection process. In this example, we simply define H'  using the rotation matrix R and initial projective transformation H as .
  Finally, we scale both images to the same approximate resolution and align the now horizontal epipoles for easier horizontal scanning for correspondences (row 4 of 2D image set).
  Note that it is possible to perform this and similar algorithms without having the camera parameter matrices M and M' . All that is required is a set of seven or more image to image correspondences to compute the fundamental matrices and epipoles.
caption: Set of 2D images from example. The original images are taken from different perspectives (row 1). Using systematic transformations from the example (rows 2 and 3), we are able to transform both images such that corresponding points are on the same horizontal scan lines (row 4).
exif: {"Image Orientation": "Horizontal (normal)"}