Part 1.1 and 1.2ΒΆ

<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image

Part 1.3 - Angle evalutationΒΆ

Title Before After
book1 0.99999 0.99999
book1 0.95998 0.99999
tiles5 0.98683 0.99993
tiles5 0.99872 0.99993
tiles3 0.99284 0.99997
tiles3 0.99586 0.99997
chess1 0.98785 0.99977
chess1 0.98459 0.99977
facade 0.78423 0.99998
facade 1.00000 0.99998
building 0.97474 0.99978
building 0.99971 0.99978
ghc 0.97519 0.99992
ghc 0.99997 0.99992

Part 1.4 - Description & Methodology:ΒΆ

  1. To affinely rectify the image, we first recover the relevant lines in $P^2$ space: $l = x_1 \times x_2$ given two image points $x_1, x_2$
  2. We then need the intersection $x_{inf}$ of two lines recovered in this manner: $x_{inf} = l_1 \times l_2$
  3. Given two such points at infinity we can recover the image of the line at infinity: $l_{inf} = x_{inf,1} \times x_{inf,2}$
  4. We proved in class that an $H$ which restores parallelism will then be $\begin{bmatrix} I_{2\times3} \\ l_{inf}^T \end{bmatrix}$ where $I_{2\times3}=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix}$

Part 2.1 and 2.2ΒΆ

<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image

Part 2.3 - Angle evalutationΒΆ

Title Before After
book1 -0.11871 0.02882
book1 0.16023 0.02882
tiles5 0.16772 -0.00809
tiles5 0.03498 -0.00809
tiles3 0.14663 -0.01932
tiles3 0.39934 -0.01932
chess1 0.66859 -0.02118
chess1 -0.04480 -0.02118
facade -0.19187 0.04607
facade -0.10655 0.04607
building 0.06300 -0.04102
building -0.18429 -0.04102
ghc 0.07238 0.02772
ghc 0.24145 0.02772

Part 2.4 - Description & Methodology:ΒΆ

  1. To metrically rectify the image (i.e. determine $H$ which undoes $H^*$ up to a similarity transform), we first recover the relevant lines in $P^2$ space: $l = x_1 \times x_2$ given two image points $x_1, x_2$

  2. We then transform the lines to the affine-rectified space: $l' = H^{-T}l$

  3. If we know two such rectified lines should be orthogonal lines on the world plane, then we can recover the image of the circular point conic dual $C^*_{∞}$.

  4. Specifically, for two orthogonal lines $l'$ and $m'$ in the affinely rectified image, $l'C^{*'}_{∞}m'=0$.

  5. Since the image is affinely rectified, $C^{*'}_{∞}$ can be decomposed into $\begin{bmatrix} S & \vec{0}^T \\ \vec{0} & 0 \end{bmatrix}$ for some symmetric matrix $S=\begin{bmatrix} a & b \\ b & c \end{bmatrix}$ (though $S$ technically only has two degrees of freedom).

  6. By solving a system of two equations per 4. and 5. via SVD, we recover $a,b,c$, and thus $C^{*'}_{∞}$.

  7. As we showed in class, we can then use SVD to solve $C^{*}_{∞}=H C^{*'}_{∞}H^T$.

  8. Specifically, given $SVD(C^{*'}_{∞})=U \begin{bmatrix} \sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & 0 \end{bmatrix} U^T$

  9. $H=\begin{bmatrix} \sqrt{\sigma_1^{-1}} & 0 & 0 \\ 0 & \sqrt{\sigma_2^{-1}} & 0 \\ 0 & 0 & 1 \end{bmatrix}U^T$

Part 3.1 and 3.2ΒΆ

<Figure size 1000x1000 with 0 Axes>
No description has been provided for this image
<Figure size 1000x1000 with 0 Axes>
No description has been provided for this image

Part 3.3 - Description & Methodology:ΒΆ

To determine the homography $H$ s.t. $x' = Hx$ given a minimal set of correspondances, we can use the Direct Linear Transform:

  1. For each correspondance, we can construct two constraints on $H$ (or $h$, $H$'s flattened equivalent) by expanding $H\vec{x} \times \vec{x}' = 0$:

  2. $-x_2 h_1 -y_2h_2 -h_3 + x_2x_1h_7 + y_2x_1h_8 + x_1h_9 = 0$ and

  3. $-x_2 h_4 - y_2 h_5 - h_6 + x_2 y_1 h_7 + y_2 y_1 h_8 + y_1 h_9 = 0$ (for $x=[x_1, y_1]^T$, $x'=[x_2, y_2]^T)

  4. We can then stack $4\times 2=8$ of these constraints and find the nullspace of the resulting matrix via SVD, which, when reshaped, gives us $H$.

  5. From there creating the compose image is as simple as warping the coordinates of the source image into the target plane, and composing the two images.

Part 4.1 and 4.2ΒΆ

<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image

Part 4.3 - Angle evalutationΒΆ

Title Before After
ghc 0.24676 0.02232
ghc -0.37486 0.03629
ghc 0.07238 -0.03133
ghc 0.24145 0.00922
ghc 0.48772 -0.02124
ghc 0.18488 -0.04453
ghc 0.24974 0.01217
ghc -0.33067 -0.00922
ghc -0.09068 0.02311
ghc -0.45823 -0.01979
ghc -0.21502 0.00049
tiles5 0.00475 -0.05823
tiles5 -0.06294 -0.00269
tiles5 0.16772 -0.00288
tiles5 0.03498 -0.03499
tiles5 -0.14621 -0.03930
tiles5 -0.07153 0.10195
tiles5 0.18047 -0.01903
tiles5 -0.01015 -0.07722
tiles5 0.20488 0.13860

Part 4.4 - Description & Methodology:ΒΆ

  1. To metrically rectify the image (i.e. determine $H$ which undoes $H^*$ up to a similarity transform), we first recover the relevant lines in $P^2$ space: $l = x_1 \times x_2$ given two image points $x_1, x_2$

  2. If we know at least 5 such rectified lines should be orthogonal lines on the world plane, then we can recover the image of the circular point conic dual $C^*_{∞}$.

  3. Specifically, for two orthogonal lines $l'$ and $m'$ in the affinely rectified image, $l'C^{*'}_{∞}m'=0$.

  4. We can construct a series of equations from this constraint y expanding it, i.e. $[l_1m_1, (l_1m_2 + l_2m_1)/2, l_2m_2, (l_1m_3 + l_3m_1) / 2, (l_2m_3 + l_3m_2) / 2, l_3m_3]c=0$

  5. And we can then solve this system for $C^{*'}_{∞}$ via SVD.

  6. As we showed in class, we can then use SVD to solve $C^{*}_{∞}=H C^{*'}_{∞}H^T$.

  7. Specifically, given $SVD(C^{*'}_{∞})=U \begin{bmatrix} \sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & 0 \end{bmatrix} U^T$

  8. $H=\begin{bmatrix} \sqrt{\sigma_1^{-1}} & 0 & 0 \\ 0 & \sqrt{\sigma_2^{-1}} & 0 \\ 0 & 0 & 1 \end{bmatrix}U^T$

Part 5.1ΒΆ

<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image
<Figure size 2000x2000 with 0 Axes>
No description has been provided for this image

Part 5.2 - ImplementationΒΆ

As none of the "target areas" overlapped, I simply called my Part 3 implementation multiple times - this "masks out" the relevant section of the background/overlaid image each iteration.