Algorithm Search⌘K

Definitionintro

Homography

Also called projective transformation, planar homography, collineation.

An invertible map of the projective plane given by a 3 by 3 matrix up to scale; it relates two images of a plane and two images taken from one center.

A homography is an invertible map of the projective plane that sends lines to lines. Every homography is x′∼Hx\mathbf{x}' \sim H\mathbf{x} for an invertible 3×33 \times 3 matrix HH, defined up to a nonzero factor, so it has 8 degrees of freedom. In vision it relates two images of one plane, and two images of any scene taken by a camera that turns about its center. This page defines the map and its two sources; homography estimation is the problem of finding HH from matched points, the DLT is the linear method that solves it, and homography decomposition recovers the camera motion from HH.

Definition

A homography (also projectivity or projective transformation) of P2\mathbb{P}^2 is an invertible map h:P2→P2h : \mathbb{P}^2 \to \mathbb{P}^2 such that three points lie on one line if and only if their images lie on one line.

Matrix form. A map hh is a homography if and only if there is an invertible real 3×33 \times 3 matrix HH with h(x)=Hxh(\mathbf{x}) = H\mathbf{x} for every point x\mathbf{x}, in homogeneous coordinates. The matrices HH and λH\lambda H, λ≠0\lambda \ne 0, give the same map, and only they do. So a homography has 9−1=89 - 1 = 8 degrees of freedom. A common way to fix the scale is ∥H∥F=1\|H\|_F = 1; the choice H33=1H_{33} = 1 fails when the true H33H_{33} is 0.

In inhomogeneous coordinates, with H=(hij)H = (h_{ij}), the point (x,y)(x, y) goes to

x′=h11x+h12y+h13h31x+h32y+h33,y′=h21x+h22y+h23h31x+h32y+h33.x' = \frac{h_{11} x + h_{12} y + h_{13}}{h_{31} x + h_{32} y + h_{33}}, \qquad y' = \frac{h_{21} x + h_{22} y + h_{23}}{h_{31} x + h_{32} y + h_{33}} .

Lines and conics. If points map by HH, a line l\mathbf{l} maps to l′=H−Tl\mathbf{l}' = H^{-\mathsf T}\mathbf{l}, because l′Tx′=lTH−1Hx=lTx\mathbf{l}'^{\mathsf T}\mathbf{x}' = \mathbf{l}^{\mathsf T} H^{-1} H \mathbf{x} = \mathbf{l}^{\mathsf T}\mathbf{x}. A conic CC maps to H−TCH−1H^{-\mathsf T} C H^{-1}.

Four points fix it. Given four points with no three on a line and four image points with no three on a line, there is exactly one homography that maps the first four to the second four. With fewer points it is not unique, and with three points on a line the problem is degenerate.

The plane-induced homography. Let a plane be nTX1=d\mathbf{n}^{\mathsf T}\mathbf{X}_1 = d in the frame of camera 1, with n\mathbf{n} a unit normal and d>0d > 0 its distance from the center of camera 1. Let a point have coordinates X1\mathbf{X}_1 in camera 1 and X2=RX1+t\mathbf{X}_2 = R\mathbf{X}_1 + \mathbf{t} in camera 2, and let the images be x1∼K1X1\mathbf{x}_1 \sim K_1\mathbf{X}_1 and x2∼K2X2\mathbf{x}_2 \sim K_2\mathbf{X}_2, with K1,K2K_1, K_2 the intrinsic matrices. On the plane nTX1/d=1\mathbf{n}^{\mathsf T}\mathbf{X}_1 / d = 1, so X2=(R+tnT/d)X1\mathbf{X}_2 = (R + \mathbf{t}\mathbf{n}^{\mathsf T}/d)\mathbf{X}_1 and

x2∼Hx1,H=K2(R+tnTd)K1−1.\mathbf{x}_2 \sim H\mathbf{x}_1, \qquad H = K_2 \left(R + \frac{\mathbf{t}\mathbf{n}^{\mathsf T}}{d}\right) K_1^{-1} .

Hartley and Zisserman (Section 13.1) write the plane as nTX+d=0\mathbf{n}^{\mathsf T}\mathbf{X} + d = 0, so their formula has a minus sign: K2(R−tnT/d)K1−1K_2(R - \mathbf{t}\mathbf{n}^{\mathsf T}/d)K_1^{-1}. Both describe the same map.

The homography of a turning camera. If the camera only turns about its center, t=0\mathbf{t} = \mathbf{0} and the formula gives H=K2RK1−1H = K_2 R K_1^{-1} for every point of the scene, whatever its depth. This is the basis of panoramas (HZ Section 8.4).

Group. The product of two homographies and the inverse of a homography are homographies. They form the projective group, the last class of the hierarchy of planar transformations. Every homography keeps incidence, collinearity and the cross-ratio.

Examples and non-examples

  • A square to a trapezoid. H=(420040011)H = \begin{pmatrix} 4 & 2 & 0 \\ 0 & 4 & 0 \\ 0 & 1 & 1 \end{pmatrix} sends (0,0)(0, 0), (1,0)(1, 0), (1,1)(1, 1), (0,1)(0, 1) to (0,0)(0, 0), (4,0)(4, 0), (3,2)(3, 2), (1,2)(1, 2). For example (1,1,1)T↦(6,4,2)T∼(3,2,1)T(1, 1, 1)^{\mathsf T} \mapsto (6, 4, 2)^{\mathsf T} \sim (3, 2, 1)^{\mathsf T}. The center (12,12)(\frac12, \frac12) goes to (3,2,32)T∼(2,43)(3, 2, \frac32)^{\mathsf T} \sim (2, \frac43). The third row (0,1,1)(0, 1, 1) is the line y+1=0y + 1 = 0, which this HH sends to the line at infinity: the point (x,−1)(x, -1) goes to (4x−2,−4,0)T(4x - 2, -4, 0)^{\mathsf T}.
  • A camera that turns. Take K=diag⁡(400,400,1)K = \operatorname{diag}(400, 400, 1), so the principal point is the origin, and a turn about the vertical axis with cos⁡θ=0.8\cos\theta = 0.8, sin⁡θ=0.6\sin\theta = 0.6: R=(0.800.6010−0.600.8)R = \begin{pmatrix} 0.8 & 0 & 0.6 \\ 0 & 1 & 0 \\ -0.6 & 0 & 0.8 \end{pmatrix}. Then H=KRK−1=(0.80240010−0.001500.8)H = K R K^{-1} = \begin{pmatrix} 0.8 & 0 & 240 \\ 0 & 1 & 0 \\ -0.0015 & 0 & 0.8 \end{pmatrix}. The image center (0,0)(0, 0) goes to (240,0,0.8)T∼(300,0)(240, 0, 0.8)^{\mathsf T} \sim (300, 0), which is ftan⁡θ=400⋅0.75f \tan\theta = 400 \cdot 0.75.
  • A plane seen from two cameras. With K1=K2=IK_1 = K_2 = I, the same RR, t=(1,0,0)T\mathbf{t} = (1, 0, 0)^{\mathsf T}, n=(0,0,1)T\mathbf{n} = (0, 0, 1)^{\mathsf T} and d=2d = 2: H=R+tnT/2=(0.801.1010−0.600.8)H = R + \mathbf{t}\mathbf{n}^{\mathsf T}/2 = \begin{pmatrix} 0.8 & 0 & 1.1 \\ 0 & 1 & 0 \\ -0.6 & 0 & 0.8 \end{pmatrix}. The point (0,0)(0, 0) of image 1 goes to (1.1,0,0.8)T∼(1.375,0)(1.1, 0, 0.8)^{\mathsf T} \sim (1.375, 0).
  • Non-example: a scene with depth and a moving center. If t≠0\mathbf{t} \ne \mathbf{0} and the points are not on one plane, the image of a point depends on its depth (parallax), and no single HH maps all points of image 1 to their matches. The two images are then related by the fundamental matrix, which maps a point to a line, not to a point.
  • Non-example: a singular matrix. A 3×33 \times 3 matrix of rank 2 sends all of P2\mathbb{P}^2 to one line and is not invertible. It occurs for a plane through the center of camera 2, which that camera sees edge on.
  • Non-example: lens distortion. Radial distortion bends straight lines, so two images of a plane through a real lens are related by a homography only after the distortion is removed (see the Brown-Conrady model).

References

  1. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 2.3, Projective transformations (the definition, the matrix form and the maps of lines and conics); Section 8.4, The importance of the camera centre (images from one center); Section 13.1, Homographies given the plane and vice versa
  2. Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Section 2.1, Geometric primitives and transformations (the 2D projective transformation) and Chapter 8, Image alignment and stitching

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/JZXEV2/text.yaml