Algorithm Search⌘K

Definitioncore

Cross-ratio

Also called anharmonic ratio.

A number computed from four collinear points that every projective transformation preserves, the basic invariant of projective geometry.

The cross-ratio is a number computed from four points of a line. A homography changes lengths, ratios of lengths and the spacing of the points, but it keeps the cross-ratio, so the cross-ratio is the basic invariant of projective geometry. This page uses the convention of Hartley and Zisserman, in which the points with coordinates 0,1,2,30, 1, 2, 3 on a line give the value 1/41/4. A photograph of four points on a straight edge therefore gives the same number as the points themselves, whatever the camera position.

Definition

Let xˉ1,xˉ2,xˉ3,xˉ4\bar{\mathbf{x}}_1, \bar{\mathbf{x}}_2, \bar{\mathbf{x}}_3, \bar{\mathbf{x}}_4 be four points of the projective line P1\mathbb{P}^1, each a nonzero 2-vector up to scale (see homogeneous coordinates). For two points write

∣xˉixˉj∣=det⁡(xi1xj1xi2xj2).|\bar{\mathbf{x}}_i \bar{\mathbf{x}}_j| = \det \begin{pmatrix} x_{i1} & x_{j1} \\ x_{i2} & x_{j2} \end{pmatrix} .

The cross-ratio is

Cross⁡(xˉ1,xˉ2,xˉ3,xˉ4)=∣xˉ1xˉ2∣ ∣xˉ3xˉ4∣∣xˉ1xˉ3∣ ∣xˉ2xˉ4∣,\operatorname{Cross}(\bar{\mathbf{x}}_1, \bar{\mathbf{x}}_2, \bar{\mathbf{x}}_3, \bar{\mathbf{x}}_4) = \frac{|\bar{\mathbf{x}}_1 \bar{\mathbf{x}}_2| \, |\bar{\mathbf{x}}_3 \bar{\mathbf{x}}_4|}{|\bar{\mathbf{x}}_1 \bar{\mathbf{x}}_3| \, |\bar{\mathbf{x}}_2 \bar{\mathbf{x}}_4|} ,

defined when the points xˉ1,xˉ3\bar{\mathbf{x}}_1, \bar{\mathbf{x}}_3 differ and the points xˉ2,xˉ4\bar{\mathbf{x}}_2, \bar{\mathbf{x}}_4 differ. Each point appears once in the numerator and once in the denominator, so the scale of each vector cancels and the value depends only on the points.

For finite points xˉi=(ti,1)T\bar{\mathbf{x}}_i = (t_i, 1)^{\mathsf T}, with tit_i the coordinate along the line, ∣xˉixˉj∣=ti−tj|\bar{\mathbf{x}}_i \bar{\mathbf{x}}_j| = t_i - t_j and

Cross⁡=(t1−t2)(t3−t4)(t1−t3)(t2−t4).\operatorname{Cross} = \frac{(t_1 - t_2)(t_3 - t_4)}{(t_1 - t_3)(t_2 - t_4)} .

A point at infinity (1,0)T(1, 0)^{\mathsf T} is allowed: its factors become constants that cancel. Other books use other orders of the four points; their value is one of the six values listed below, so state the convention before you compare numbers.

Invariance. A homography of the line is xˉ↦Hxˉ\bar{\mathbf{x}} \mapsto H\bar{\mathbf{x}} with HH an invertible 2×22 \times 2 matrix. The matrix with columns HxˉiH\bar{\mathbf{x}}_i and HxˉjH\bar{\mathbf{x}}_j is HH times the matrix with columns xˉi\bar{\mathbf{x}}_i and xˉj\bar{\mathbf{x}}_j, so ∣Hxˉi Hxˉj∣=det⁡H ∣xˉixˉj∣|H\bar{\mathbf{x}}_i \, H\bar{\mathbf{x}}_j| = \det H \, |\bar{\mathbf{x}}_i \bar{\mathbf{x}}_j|. The factor (det⁡H)2(\det H)^2 appears in the numerator and in the denominator and cancels. So the cross-ratio does not change. A homography of the plane maps a line to a line and acts on it as a homography of P1\mathbb{P}^1, so it keeps the cross-ratio of four collinear points too.

Four collinear points of the plane. For points x1,…,x4\mathbf{x}_1, \ldots, \mathbf{x}_4 of one line of the projective plane, take any point o\mathbf{o} not on the line and replace ∣xˉixˉj∣|\bar{\mathbf{x}}_i \bar{\mathbf{x}}_j| by the 3×33 \times 3 determinant det⁡(o,xi,xj)\det(\mathbf{o}, \mathbf{x}_i, \mathbf{x}_j). The value does not depend on o\mathbf{o}. Read in the dual way, it is also the cross-ratio of the four lines through o\mathbf{o} and the points: four concurrent lines have a cross-ratio, and every line that misses their common point cuts them in four points with that same cross-ratio.

Permutations. The 24 orders of four points give at most six values. If one order gives λ\lambda, the others give 1−λ1 - \lambda, 1/λ1/\lambda, 1/(1−λ)1/(1 - \lambda), (λ−1)/λ(\lambda - 1)/\lambda and λ/(λ−1)\lambda/(\lambda - 1).

Harmonic sets. Four distinct points are a harmonic set when the six values are −1-1, 22 and 1/21/2. In the convention of this page, Cross⁡(a,c,d,b)=−1\operatorname{Cross}(\mathbf{a}, \mathbf{c}, \mathbf{d}, \mathbf{b}) = -1 means that the pairs {a,b}\{\mathbf{a}, \mathbf{b}\} and {c,d}\{\mathbf{c}, \mathbf{d}\} separate each other harmonically. The midpoint of a segment and the point at infinity of its line are the classic example.

Examples and non-examples

  • The check value. For t=0,1,2,3t = 0, 1, 2, 3: (0−1)(2−3)(0−2)(1−3)=14\frac{(0 - 1)(2 - 3)}{(0 - 2)(1 - 3)} = \frac{1}{4}.
  • Invariance under a homography. The map t↦1/(t+1)t \mapsto 1/(t + 1) is a homography of the line, with matrix (0111)\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}. It sends 0,1,2,30, 1, 2, 3 to 1,12,13,141, \frac12, \frac13, \frac14. The cross-ratio is (1−12)(13−14)(1−13)(12−14)=1/241/6=14\frac{(1 - \frac12)(\frac13 - \frac14)}{(1 - \frac13)(\frac12 - \frac14)} = \frac{1/24}{1/6} = \frac14, the same value, although no length or ratio of lengths is kept.
  • The six values. For the points 0,1,2,30, 1, 2, 3 in all 24 orders the values are 14\frac14, 34\frac34, 44, 43\frac43, −3-3 and −13-\frac13.
  • Measuring in a photograph. Four posts stand at equal distances along a straight fence, at 0,1,2,30, 1, 2, 3 units. In the image, the first three are at 00, 22 and 33 pixels along the image of the fence. The fourth is at xx with (0−2)(3−x)(0−3)(2−x)=14\frac{(0 - 2)(3 - x)}{(0 - 3)(2 - x)} = \frac14, so 8(3−x)=3(2−x)8(3 - x) = 3(2 - x) and x=3.6x = 3.6. The homography t↦3t/(t/2+1)t \mapsto 3t/(t/2 + 1) maps 0,1,2,30, 1, 2, 3 to 0,2,3,3.60, 2, 3, 3.6, which confirms the value.
  • A harmonic set. The points −1-1, 11, the midpoint 00 and the point at infinity: Cross⁡(−1,0,∞,1)=−1\operatorname{Cross}(-1, 0, \infty, 1) = -1.
  • Non-example: three points. Three distinct points of a line have no invariant: a homography of the line can send any three distinct points to any other three. The cross-ratio needs four.
  • Non-example: the ratio of lengths. For 0,1,30, 1, 3 the ratio of the two segments is 1/21/2; under t↦1/(t+1)t \mapsto 1/(t + 1) the images 1,12,141, \frac12, \frac14 give the ratio 22. The simple ratio is an affine invariant, not a projective one (see the hierarchy of planar transformations).
  • Non-example: points not on one line. For four points in general position in the plane there is no single cross-ratio, because a homography can map any four such points to any other four.
  • Projective plane: the space in which the points and lines live.
  • Homography: the maps that keep the cross-ratio. A map of the line that keeps every cross-ratio is a homography of the line.
  • Hierarchy of planar transformations: the cross-ratio is the invariant of the projective group; ratios of lengths along a line belong to the affine group.
  • The formula of Laguerre gives the angle between two lines from the cross-ratio of the two lines and the two lines through their meeting point and the circular points. This is the link between angles and the image of the absolute conic.
  • Vanishing point detection: with equally spaced points on a line in the scene, the cross-ratio locates the vanishing point of the line in the image.

References

  1. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 2.5, The projective geometry of 1D (the cross ratio of four points of a line and its invariance, and concurrent lines)
  2. Jürgen Richter-Gebert, Perspectives on Projective Geometry, Springer, 2011, the chapter Lines and cross-ratios (the cross-ratio by determinants and its invariance)

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/JB8543/text.yaml