16-822 Geometry-based Methods in Vision

Assignment 1: Projective Geometry and Homography

Qitao Zhao (qitaoz), Fall 2024

Q1. Affine Rectification

Input imageAnnotated parallel lines on input imageAffine-rectified image

Held-out Test Lines and Metrics

Test lines on input imageTest lines on affine-rectified imageMetrics
Before: [1.0000, 0.9600]
After: [1.0000, 0.9953]
Before: [0.9878, 0.9846]
After: [0.9998, 1.0000]
Before: [0.8964, 0.9575]
After: [1.0000, 1.0000]
Before: [0.9905, 0.9977]
After: [0.9999, 0.9998]
Before: [0.8312, 1.0000]
After: [1.0000, 1.0000]

We performed affine rectification by annotating two pairs of parallel lines and calculating the line equation at infinity. We found the homography that recovers this particular line, which is given by: H=[10tx01tyabc].

Q2. Metric Rectification

Input imageAnnotated perpendicular lines on input imageAnnotated perpendicular lines on affine-rectified imageRectified image

Held-out Test Lines and Metrics

Test lines on input imageTest lines on metric-rectified imageMetrics
Before: [-0.1187, 0.1602]
After: [-0.0000, 0.0000]
Before: [0.6686, -0.0448]
After: [-0.0000, -0.0000]
Before: [-0.2527, 0.0882]
After: [-0.0000, 0.0000]

First, we apply an affine transformation to the image using a predefined homography matrix Ha (obtained from the last question) . This removes projective distortion but leaves metric distortions like scaling and shearing:

(2)Affine rectification: Ha

We then Identify at least two pairs of perpendicular lines in the affine rectified image. Use these line pairs to compute the constraints required for metric rectification. The lines' equations l and m are computed as:

(3)l1m1=0,l2m2=0

Form the constraint system for the dual conic (which represents the circular points), solving for C:

(4)Ax=b

Solve for x, then construct C, the conic matrix.

Compute the Singular Value Decomposition (SVD) of C to derive the final metric rectifying homography Hm:

(5)Hm=UD1/2UT

We apply the final homography Hm to the affine rectified image to achieve metric rectification:

(6)Metric rectification: H=Hm

Q3. Planar Homography from Point Correspondences

Normal imagePerspective imageAnnotated corners in perspective imageWarped and overlaid image

The algorithm uses four-point correspondences between the source and target images to compute the transformation. These points are visualized with solid red circles on the target image for clarity. Each pair of corresponding points provides two equations of the form: x=H11x+H12y+H13y=H21x+H22y+H23, where x′, y' are the transformed coordinates in the target image, and x, y are the original coordinates in the source image. We use SVD to solve the linear equations by taking the last row of VT.