Edd's Knowledge Base

Homogeneous coordinates describe an -dimensional point with numbers. A 2D point becomes the 3-vector , and a 3D point becomes the 4-vector . The extra number is not a physical dimension. It is a bookkeeping device that lets translation and perspective projection be written as matrix multiplications, and it appears throughout geometry in computer vision.

Definition

A homogeneous vector with represents the ordinary point

Any non-zero scalar multiple of a homogeneous vector is the same point:

So , and all stand for the 2D point . Only the ratios of the entries matter.

DirectionRule
Ordinary to homogeneousAppend a 1:
Homogeneous to ordinaryDivide by the last entry, then drop it:

In 2D, each homogeneous vector is a direction from the origin in 3D. Every point along one ray (the crosses and dots) is the same 2D point, and the plane picks out its position.

Why Use Them

1. Translation becomes a matrix

A plain matrix can rotate, scale or shear a 2D point but cannot translate it, because every output is a weighted sum of and with no constant term. With the extra 1 the constant has somewhere to act:

Rotation, scaling, shear and translation are then all matrices, and a chain of transformations is one matrix product (Image Warping). In 3D the same idea gives a rigid motion .

2. Perspective becomes linear

Perspective projection divides by depth, which is not a linear operation. In homogeneous coordinates the division is deferred: the matrix multiplication stays linear, and you divide by the last entry at the end. That is how a homography (Homographies and Perspective Warping) or a camera projection maps points while keeping the algebra to a single matrix product.

3. Points at infinity

A vector whose last entry is zero, , cannot be divided by . It represents a point at infinity: a pure direction. This lets parallel lines “meet” at a finite homogeneous point (a vanishing point), and it keeps formulas valid in cases that would otherwise need special handling.

Lines and Intersections

In 2D, a line is the 3-vector . A point lies on it exactly when

Points and lines are dual, so two simple formulas use the cross product:

TaskFormula
Line through two points
Intersection of two lines

Worked examples (checked numerically):

  • The line through and : , which is the line . Both points satisfy it.
  • The lines , written , and , written : their cross product is , which is the point after dividing by the last entry.
  • The parallel lines and , written and : their cross product is . The last entry is zero, so the intersection is a point at infinity in the direction , which is the direction of the lines.

Common Uses

WhereWhat the extra coordinate does
2D transformationsAffine maps and homographies as matrices (Image Warping)
Camera modelA 3D point maps to an image point through a projection matrix
Line fitting and geometryLines as 3-vectors, intersections as cross products
EstimationEquations of the form solved with SVD, because the unknown matrix is only defined up to scale (Homographies and Perspective Warping)

Practical Tips

  • Normalize before comparing. Two homogeneous vectors are equal as points when they are proportional, so divide by the last entry before computing distances or plotting.
  • Check for . A tiny last entry means the point is very far away or at infinity, and the division becomes unstable.
  • Matrices are defined up to scale too. A homography has 9 entries but 8 degrees of freedom, since multiplying every entry by the same constant gives the same mapping.
  • Stay consistent with order. Homogeneous formulas take before , while an image array is indexed [y, x] (Image Representation and Indexing).

Source: Foundations of Computer Vision, ch. 38: Representing Images and Geometry (definition, scale equivalence, division by the last entry, and the transformation hierarchy). The line and point-at-infinity relations are standard projective geometry from my own knowledge, and the numerical examples were checked in code.


Related: Computer Vision MOC, Image Warping, Homographies and Perspective Warping, Image Warping Snippets