Mathwords logoMathwords

Projective Transformation — Definition, Formula & Example

A projective transformation is a map of the plane that sends straight lines to straight lines, the way a camera photographs a flat surface at an angle. Unlike an affine map, it can make parallel lines meet, so a rectangle can become a general quadrilateral.

A projective transformation (homography) of the real projective plane RP2\mathbb{RP}^2 is a map [v]↦[Hv][\mathbf{v}] \mapsto [H\mathbf{v}], where v=(x,y,1)T\mathbf{v} = (x, y, 1)^T in homogeneous coordinates and HH is an invertible 3×33 \times 3 real matrix. The matrices HH and λH\lambda H (λ≠0\lambda \neq 0) define the same map, so HH has 8 degrees of freedom. These maps form the group PGL(3,R)PGL(3, \mathbb{R}). They preserve collinearity, incidence, and cross-ratio, but in general they do not preserve parallelism, distance ratios, or angles.

Key Formula

x′=ax+by+cgx+hy+i,y′=dx+ey+fgx+hy+i,H=[abcdefghi], det⁡H≠0x' = \frac{ax + by + c}{gx + hy + i}, \qquad y' = \frac{dx + ey + f}{gx + hy + i}, \qquad H = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix},\ \det H \neq 0
Where:
  • (x,y)(x, y) = Original point in the plane
  • (x′,y′)(x', y') = Image point after the transformation
  • HH = Invertible 3 × 3 matrix, defined only up to a nonzero scalar multiple
  • g,hg, h = Bottom-row entries. When g = h = 0, the denominator is constant and the map is affine.

Worked Example

Problem: Apply the projective transformation with matrix H=[100010101]H = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix} to the unit square with corners (0,0)(0,0), (1,0)(1,0), (1,1)(1,1), (0,1)(0,1). Do the square's parallel top and bottom edges stay parallel?
Step 1: Write each point in homogeneous coordinates as (x,y,1)(x, y, 1) and multiply by HH. The third coordinate becomes x+1x + 1. Dividing by it gives the rule for the map.
H[xy1]=[xyx+1]  ⟹  (x′,y′)=(xx+1, yx+1)H\begin{bmatrix} x \\ y \\ 1 \end{bmatrix} = \begin{bmatrix} x \\ y \\ x+1 \end{bmatrix} \;\Longrightarrow\; (x', y') = \left(\frac{x}{x+1},\ \frac{y}{x+1}\right)
Step 2: Apply the rule to each corner. The corners with x=1x = 1 are divided by 2. The corners with x=0x = 0 are divided by 1, so they do not move.
(0,0)→(0,0),(1,0)→(12,0),(1,1)→(12,12),(0,1)→(0,1)(0,0)\to(0,0),\quad (1,0)\to\left(\tfrac{1}{2},0\right),\quad (1,1)\to\left(\tfrac{1}{2},\tfrac{1}{2}\right),\quad (0,1)\to(0,1)
Step 3: Find the lines through the image edges. The bottom edge lies on y′=0y' = 0. The top edge joins (0,1)(0,1) and (12,12)(\tfrac{1}{2},\tfrac{1}{2}), and both points satisfy x′+y′=1x' + y' = 1. Solve the two equations together to find where the lines cross.
y′=0,x′+y′=1  ⟹  (x′,y′)=(1,0)y' = 0,\quad x' + y' = 1 \;\Longrightarrow\; (x', y') = (1, 0)
Answer: The image is the quadrilateral with corners (0,0)(0,0), (12,0)(\tfrac{1}{2},0), (12,12)(\tfrac{1}{2},\tfrac{1}{2}), (0,1)(0,1). The edges are still straight, but the top and bottom edges are no longer parallel. Their lines meet at (1,0)(1, 0), which is the image of the point at infinity where the original parallel lines met. No affine map can do this.

Why It Matters

Homographies are central to computer vision. Panorama stitching, document-scanner apps that flatten a tilted page, and sports-broadcast graphics drawn onto a field all use them. Because HH has 8 degrees of freedom, you can determine it from 4 point correspondences, provided no three of the points are collinear.

Common Mistakes

Mistake: Multiplying by HH and reading off the first two coordinates without dividing by the third.
Correction: The result HvH\mathbf{v} is a homogeneous vector. You must divide its first two entries by the third entry to get the actual point. Skipping this step treats the map as affine and gives wrong images whenever gg or hh is nonzero.

Related Terms