Image Rectification: Before and After

Overall Transformation

Before

Overall Before

After

Overall After

Additional Examples

Example 1

Overall Example 1 Before Overall Example 1 After

Example 2

Overall Example 2 Before Overall Example 2 After

Example 3

Overall Example 3 Before Overall Example 3 After

Example 4

Overall Example 4 Before Overall Example 4 After

Step 1: Affine Rectification

Before

Affine Before

After

Affine After
Line Angle Before (cos) Angle After (cos)
Line 1 0.99214 0.99999
Line 2 0.9997 0.99995

Affine Rectification Algorithm:

In order to perform affine rectification, I used 4 line correspondences, determined from 8 points where every consecutive pair of points defined a line. Since parallel lines intersect at the line at infinity, I crossed the lines (l1 x l2) determined from the cross product of each point pair (e.g. l1 = p1 x p2) to determine the intersection point at infinity for 2 line pairs. This gave 2 points on the line at infinity in the image's current projection, and this was sufficient to determine the line's current equation again using cross product of th two points. Once this was determined, I defined the homography that mapped the line at infinity [0, 0, 1] to the current line, and this was H up to some affine transformation, since the homography for lines is the inverse of the homography for points.

Additional Examples

Example 1

Affine Example 1 Before Affine Example 1 After
Line Angle Before (°) Angle After (°)
Line 1 0.99987 1.00000
Line 2 0.99672 0.99980

Example 2

Affine Example 2 Before Affine Example 2 After
Line Angle Before (°) Angle After (°)
Line 1 0.98784 0.9997
Line 2 0.98459 0.9999

Example 3

Affine Example 3 Before Affine Example 3 After
Line Angle Before (°) Angle After (°)
Line 1 0.9868 0.9999
Line 2 0.99871 0.9999

Example 4

Affine Example 4 Before Affine Example 4 After
Line Angle Before (cos) Angle After (cos)
Line 1 0.99284 0.9999
Line 2 0.9958 0.99955

Step 2: Metric Rectification

Before

Metric Before

After

Metric After
Line Angle Before (cos) Angle After (cos)
Line 1 0.47730 0.2983
Line 2 0.3818 0.2242

Metric Rectification:

To perform metric recitification, I recovered the degenerate circle conic in the affinely rectified image from the previous step. To do so, I used the premultiplied form of lines m and l that were known to be orthogonal in the original images, and since their dot product "through" the degenerate conic must be 0 in the warped image, I used the equation c1l1m1 + c2(l1m2 + l2m1) +c3l2m2 = 0 as a linear constraint for at least 4 orthogonal pairs of lines per image. I stacked these constraints into a matrix and performed SVD to extract the null vector (c1,c2,c3) that best satisfied these equations (by minimizing the constraints). Then, I was able to construct the instrinsic matrix KK^T = [[c1, c2], [c2, c3]] from rearranging the vector into its matrix representation, and by performing SVD again on this symmetrix matrix, I extracted K, which I proceeded to invert and transform to get the final similarity homography.

Additional Examples

Example 1

Metric Example 1 Before Metric Example 1 After
Line Angle Before (°) Angle After (°)
Line 1 -0.1152 -0.1974
Line 2 -0.0616 -0.1410

Example 2

Metric Example 2 Before Metric Example 2 After
Line Angle Before (°) Angle After (°)
Line 1 0.70466 -0.10602
Line 2 -0.5693 -0.1740

Example 3

Metric Example 3 Before Metric Example 3 After
Line Angle Before (°) Angle After (°)
Line 1 0.19963 0.15043
Line 2 -0.1080 -0.3189

Example 4

Metric Example 4 Before Metric Example 4 After
Line Angle Before (°) Angle After (°)
Line 1 0.5980 -0.0741
Line 2 0.6325 -0.0226
Point Correspondence Homography

Q3 Point Correspondence Homography

Transformation Example 1

Source

Homography Example 2 Before 1

Destination

Homography Example 2 Before 2

After

Homography Example 2 After

For every point correspondence between p1 and Hp2, I constructed two premultiplied linear constraints in order to represent the known constraint the p1 x Hp2 = 0. To do this, I used the matrix equation given on page 89 of MVG by Hartley and Zisserman. After stacking these linear constraints into a matrix, I performed SVD decomposition to extract the 9x1 vector h, which I rearranged into the final matrix H, and used this transformation to remap the each point p2 to its location p1 in the destination image.

Transformation Example 2

Source

Homography Example 2 Before 1

Destination

Homography Example 2 Before 2

After

Homography Example 2 After