Direct Linear Transformation

Given 4 or more point correspondences $(x_i, y_i) \leftrightarrow (x'_i, y'_i)$, we can solve for $H$ using the Direct Linear Transformation (DLT) algorithm.

Linearizing the Constraint

The core relationship $\mathbf{x}' \times H\mathbf{x} = \mathbf{0}$ yields two linearly independent equations for each point pair:

$-w'_i \mathbf{x}_i^T \mathbf{h}_1^T + y'_i \mathbf{x}_i^T \mathbf{h}_3^T = 0$
$w'_i \mathbf{x}_i^T \mathbf{h}_2^T - x'_i \mathbf{x}_i^T \mathbf{h}_3^T = 0$

Where $\mathbf{h}_j$ is the $j$-th row of $H$. Stacking these for multiple points forms a large matrix $A$.

The SVD Solution

In practice, we solve $A\mathbf{h} = \mathbf{0}$ as a least-squares problem using Singular Value Decomposition (SVD). The optimal solution is the unit singular vector corresponding to the smallest singular value of $A$.

Professional Note: Each point pair provides 2 rows to matrix $A$. With 9 elements in $H$ (minus 1 for scale), we need at least 4 point pairs (8 equations) to find a unique solution.

Interactive Matrix Constructor

Drag the projected coordinates into the correct slots for Point 1 ($x_1, y_1, 1 \leftrightarrow x'_1, y'_1, w'_1$).

x1
y1
1
-x1
-y1
-1
x'1
y'1
w'1
-w'1
0
0
0
-w'x
-w'y
-w'
y'x
y'y
y'
w'x
w'y
w'
0
0
0
-x'x
-x'y
-x'