A homography is the most general formulation of linear transformations in 2D projective geometry, also known as a projective transformation. It can be decomposed into a sequence of transformations in a hierarchical manner:
The homography matrix
Where:
- (
$H_S$ ): Similarity transformation (4 DoF) - (
$H_A$ ): Affine transformation (6 DoF) - (
$H_P$ ): Projective transformation (8 DoF)
- Euclidean (Rigid) Transformation (3 DoF):
- Similarity Transformation (4 DoF):
- Affine Transformation (6 DoF):
- Projective Transformation (8 DoF)
The transformation of images is typically defined as the projection mapping between images of the same planar object taken from different positions by distortion-free cameras. The Direct Linear Transformation (DLT) is one of the simplest methods to estimate homography.
Given homogeneous coordinates
Expanding:
The equations for the transformed coordinates
Further, by multiplying the denominator to the left, we can transform the equations into:
$$(h_{31} u + h_{32} v + h_{33}) u' = h_{11} u + h_{12} v + h_{13} \\$$ $$(h_{31} u + h_{32} v + h_{33}) v' = h_{21} u + h_{22} v + h_{23} \\$$ $$\Rightarrow 0 = h_{11} u + h_{12} v + h_{13} - h_{31} u' u - h_{32} u' v - h_{33} u' \\$$This is a pair of homogeneous equations (since the right hand side is zero).
We rewrite these equations in matrix notation as
The homography matrix
To solve for the homography matrix, we need corresponding coordinate points. Each pair of matched coordinate points yields two linear equations. Thus, at least four pairs of corresponding points are required to compute the homography matrix between two images.
In practice, more than four pairs of corresponding points are typically used to account for coordinate errors caused by noise. With
Finally, Singular Value Decomposition (SVD) is used to obtain the homography matrix
-
$U$ is a$2n \times 2n$ unitary matrix. -
$S$ is a$2n \times 9$ diagonal matrix with non-negative real values arranged in descending order down the diagonal. -
$V$ is a$9 \times 9$ unitary matrix.
The diagonal elements of
The unit singular vector corresponding to the smallest singular value is the solution
If the resulting homography transformation for the corresponding point sets is exact, the value of
In the case of an overdetermined system, the obtained solution minimizes the equation
Which is equivalent to
The solution is the (unit) eigenvector of
For further details, one may refer to Multiple View Geometry in Computer Vision, Second Edition, Section 4.1 Estimation – 2D Projective Transformations, page 88. Or Zhang's Camera Calibration Algorithm: In-Depth Tutorial and Implementation Section 3.2.1.
Given a homography matrix
,where
- Multiple View Geometry in Computer Vision, 2nd Edition, Section 4.1.
- Zhang's Camera Calibration Algorithm: In-Depth Tutorial and Implementation, Section 3.2.1.