Computer Vision MT25, Homogenous coordinates and homographies


Flashcards

@Define how the point $(x, y)$ would be represented in homogeneous coordinates.


\[\begin{pmatrix} x \\ y \\ 1 \end{pmatrix}\]

(technically this is an element of the equivalence class ${(\lambda x, \lambda y, \lambda) \mid \lambda \in \mathbb R}$)

@State the affine transformation matrix corresponding to a translation by $\delta _ x$, $\delta _ y$.


\[\begin{pmatrix} 1 & 0 & \delta _ x \\ 0 & 1 & \delta _ y \\ 0 & 0 & 1 \end{pmatrix}\]

@State the affine transformation matrix corresponding to a uniform scaling by a factor of $s$.


\[\begin{pmatrix} s & 0 & 0 \\ 0 & s & 0 \\ 0 & 0 & 1 \\ \end{pmatrix}\]

@State the affine transformation matrix corresponding to an anti-clockwise rotation by angle $\theta$.


\[\begin{pmatrix} \cos \theta & -\sin\theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{pmatrix}\]

@State the affine transformation matrix corresponding to horizontal shearing by a factor of $m$.


\[\begin{pmatrix} 1 & m & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]

@State the affine transformation matrix corresponding to vertical shearing by a factor of $m$.


\[\begin{pmatrix} 1 & 0 & 0 \\ m & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}\]

@State three properties that all affine transformations preserve.


  • Collinearity
  • Parallelism
  • Convexity

Suppose you have an affine transformation matrix

\[\begin{pmatrix} a _ {11} & a _ {12} & a _ {13} \\ a _ {21} & a _ {22} & a _ {23} \\ 0 & 0 & 1 \end{pmatrix}\]

How could you compute the source pixel corresponding to an output pixel $(x, y)$ when using a backward warp?


\[\begin{pmatrix} a _ {11} & a _ {12} & a _ {13} \\ a _ {21} & a _ {22} & a _ {23} \\ 0 & 0 & 1 \end{pmatrix}^{-1} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix}\]

Homographies

@Define a homography $H$.


A transformation of 2D homogeneous coordinates $p$ of the form

\[H\begin{pmatrix}x \\ y \\ z \end{pmatrix} = \begin{pmatrix} h _ {11} & h _ {12} & h _ {13} \\ h _ {21} & h _ {22} & h _ {23} \\ h _ {31} & h _ {32} & 1 \end{pmatrix}\begin{pmatrix}x \\ y \\ z \end{pmatrix}\]

(technically the bottom-right entry does not have to be $1$, but since these coordinates are actually elements of an equivalence class, we often rescale the matrix to have bottom right value $1$).

How many point-to-point correspondences are required to determine a homography?


$4$, as long as no $3$ points lie on the same line.

Suppose you have $4$ point-to-point correspondences $A _ 1, A _ 2, A _ 3, A _ 4$ and $B _ 1, B _ 2, B _ 3, B _ 4$.

Supposing that the entries of the homography matrix are

\[\begin{pmatrix} h _ {11} & h _ {12} & h _ {13} \\ h _ {21} & h _ {22} & h _ {23} \\ h _ {31} & h _ {32} & h _ {33} \end{pmatrix}\]

how could you solve for $H$?


Writing the correspondences down and then collecting them into a linear system, we have

\[\begin{pmatrix} - A _ {x,1} & - A _ {y,1} & -1 & 0 & 0 & 0 & B _ {x,1}A _ {x,1} & B _ {x,1}A _ {y,1} & B _ {x,1} \\ 0 & 0 & 0 & - A _ {x,1} & - A _ {y,1} & -1 & B _ {y,1}A _ {x,1} & B _ {y,1}A _ {y,1} & B _ {y,1} \\ - A _ {x,2} & - A _ {y,2} & -1 & 0 & 0 & 0 & B _ {x,2}A _ {x,2} & B _ {x,2}A _ {y,2} & B _ {x,2} \\ 0 & 0 & 0 & - A _ {x,2} & - A _ {y,2} & -1 & B _ {y,2}A _ {x,2} & B _ {y,2}A _ {y,2} & B _ {y,2} \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ 0 & 0 & 0 & - A _ {x,4} & - A _ {y,4} & -1 & B _ {y,4}A _ {x,4} & B _ {y,4}A _ {y,4} & B _ {y,4} \end{pmatrix} \begin{pmatrix} h _ {11}\\ h _ {12}\\ h _ {13}\\ h _ {21}\\ h _ {22}\\ h _ {23}\\ h _ {31}\\ h _ {32}\\ h _ {33} \end{pmatrix} = 0\]

Hence $H$ lies in the null space of this matrix, which can be found via the SVD.

@Visualise how reversing the homography for the image on the right and overlaying it on the image on the right would look.





Related posts