HW1: Projective Geometry and Homography

Colleen Que

Q1: Affine Rectification

Input Image Annotated Parallel lines on Input Image Affine Rectified Image

| | | |

| | | |

| | | |

| | | |

3. Evaluate Angles:

Image Name Before After
Facade 0.77395729920 0.9999605188736062
Facade 0.99998182 0.999972
Checker1 0.8958801150 0.9999935665
Checker1 0.9572630988 0.9999728071273944
Chess1 0.98757636192762 0.99983730958780
Chess1 0.9844509058721 0.99999695749
Keyboard 0.997760884 0.999986295
Keyboard -0.996977056 -0.999903993367
Shelf 0.8954254281415592 0.9999840448
Shelf 0.999715098543507 0.9996144383

Description:

  1. Calculated linesfrom finding the cross product of the annotated points.
  1. Found vanishing points by taking the cross product of two lines.
  2. Took the cross product of vanishing points to find the line at infinity and used this to construct the homography matrix H.
$$H = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ l_1 & l_2 & l_3 \end{bmatrix}$$

Q2: Metric Rectification

Input Image Annotated Perpendicular Lines on Input Image Annotated Perpendicular Lines on Affine-Rectified Image Rectified Image

| | | | |

| | | | |

| | | | |

| | | | |

3. Evaluate Angles:

Image Name Before After
Facade -0.6664966857689815 0.0503733122293811
Facade 0.6902846557329554 0.0126798416894802
Checker1 -0.8979851319218762 0.0043526501625
Checker1 0.790050666869242 0.00604931080793
Chess1 0.705015942 -0.021783689655921312
Chess1 -0.57054451917898 -0.011004444616700
Keyboard 0.817811623134940 0.074495275
Keyboard 0.7293617798571533 -0.038503035
Shelf -0.912905 -0.05763805
Shelf -0.9023554956443 0.032474856

Description:

  1. Finding C
$$ l^{'T} C_{\infty}^{*'} m' = 0 \text{ since } l' \text{ and } m' \text{ are perpendicular.}\\ \text{This can be expressed as:} \\ (l_1' \, l_2' \, l_3') \begin{bmatrix} K K^T & 0 \\ 0^T & 0 \end{bmatrix} \begin{bmatrix} m_1' \\ m_2' \\ m_3' \end{bmatrix}\\ $$
$$\text{After normalization, this can be rewritten as:}$$
$$ \begin{pmatrix} l_1 \\ l_2 \end{pmatrix}^T S \begin{pmatrix} m_1 \\ m_2 \end{pmatrix} = 0 \\ $$
$$ (l_1 m_1 + l_1 m_2 + l_2 m_1 + l_2 m_2) s = 0 $$
$$ \text{C can be decomposed as: } U \begin{pmatrix} \sigma _1 &0&0\\ 0&\sigma _2 & 0\\ 0&0&0 \end{pmatrix} U^T \\ \text{And } $$
$$ H = U \begin{pmatrix} \sqrt{\sigma_ 1^{-1} }&0&0\\ 0&\sqrt{\sigma_ 2 ^{-1}}& 0\\ 0&0&0 \end{pmatrix} U^T $$

Q3: Planar Homography from Point Correspondences

Normal Image Perspective Image Annotated Corners in Perspective Image Warped and Overlaid Image

| | | | |

Description :

$$ Ah = 0 $$
$$ \begin{pmatrix} -x_{i_2} & -y_{i_2} & -1 & 0 & 0 & 0 & x_{i_1} x_{i_2} & x_{i_1} y_{i_2} & x_{i_1} \\ 0 & 0 & 0 & -x_{i_2} & -y_{i_2} & -1 & y_{i_1} x_{i_2} & y_{i_1} y_{i_2} & y_{i_1} \end{pmatrix} \begin{pmatrix} h_1 \\ h_2 \\ h_3 \\ h_4 \\ h_5 \\ h_6 \\ h_7 \\ h_8 \\ h_9 \end{pmatrix} = 0 $$
$$ H = \begin{pmatrix} h_1 & h_2 & h_3 \\ h_4 & h_5 & h_6 \\ h_7 & h_8 & h_9 \end{pmatrix}$$

Q5: Bonus: More Planar Homography from Point Correspondences




Utilized homography from part 3; used a for loop to sample individual homographies for each book cover and mapped to the labeled points on the times square image.