Metric Rectification: Two Constraints from a Circle or Length Ratios
Published:
An affinely-rectified plane is still not “Euclidean”: angles and true length ratios are still wrong because there is a remaining unknown \(2\times 2\) linear distortion.
Metric rectification is the final upgrade: recover a transform that makes the plane Euclidean again (up to an overall similarity: rotation + translation + uniform scale).
This post summarizes a clean geometric fact:
- A single imaged circle (which appears as an ellipse after affine distortion), or
- two known length-ratio constraints
each provide exactly the two independent constraints you need to perform metric rectification.
1. What is still unknown after affine rectification?
After affine rectification, the plane coordinates are correct up to an unknown \(2\times 2\) linear map \(A\) (shear + non-uniform scale). In these coordinates, squared lengths are measured by an unknown metric tensor
\[G \;=\; A^{-T}A^{-1}\]Equivalently, metric rectification is finding a \(2\times 2\) matrix \(T\) such that
\[G = T^T T\]where the rectified coordinates are \(x_m = T x_a\) (subscripts: \(a\)=affine, \(m\)=metric).
Because \(G\) is symmetric \(2\times2\), it has 3 parameters, but overall scale does not matter for metric rectification. So it has 2 degrees of freedom → you need two independent constraints.
2. Circular points and why they matter
In the Euclidean plane, the two circular points at infinity are
\[I=(1,i,0)^T,\qquad J=(1,-i,0)^T\]They lie on the line at infinity \(l_\infty\) (in homogeneous coordinates \(X=(x,y,w)^T\), that line is \(w=0\)).
Two key facts:
- Every Euclidean circle passes through \(I\) and \(J\) (in the projective extension).
- \(I,J\) encode metric structure (angles / orthogonality) that gets destroyed by affine distortion.
An affine transform maps points at infinity to points at infinity, so \(I,J\) become some \(I’,J’\) still on \(l_\infty\) — but no longer the canonical circular points. That loss is exactly why circles become ellipses and angles are not preserved.
3. “Ellipse \(\cap l_\infty\)” (why the book can say this)
A conic is defined projectively by
\[X^T C X = 0\]Intersecting the conic with \(l_\infty\) just means solving
\[X^T C X=0,\qquad w=0.\]Those intersection points can be complex, so they are not visible as pixels — but they are still well-defined projectively.
Example: a standard ellipse meets \(l_\infty\) in complex points
Start from
\[\frac{x^2}{a^2}+\frac{y^2}{b^2}=1.\]Homogeneous form:
\[b^2 x^2 + a^2 y^2 - a^2 b^2 w^2 = 0.\]On \(l_\infty\) we set \(w=0\), giving
\[b^2 x^2 + a^2 y^2 = 0 \;\Rightarrow\; \left(\frac{x}{y}\right)^2 = -\frac{a^2}{b^2} \;\Rightarrow\; \frac{x}{y}=\pm i\frac{a}{b}.\]So the ellipse intersects \(l_\infty\) in two complex points. For a circle, those two points are exactly \(I\) and \(J\); for an affinely distorted circle (an ellipse), the two points are the transformed \(I’,J’\).
If you have already affinely rectified the plane, then \(l_\infty\) is known, so the ellipse (image of a real circle) provides the remaining two constraints needed for metric rectification.
4. Practical circle method (don’t compute complex points)
In practice you usually do not compute complex intersections explicitly. Instead:
- In the affinely rectified image, fit the ellipse that comes from a known circle on the plane.
- Extract the ellipse’s \(2\times2\) quadratic form \(Q\) (the part that controls shape).
- Factor \(Q\) to get \(T\), then build a homography.
Ellipse quadratic form
Write the ellipse as
\[(x-c)^T\,Q\,(x-c)=1,\]where \(x=[u,v]^T\), \(c=[c_x,c_y]^T\), and \(Q\) is symmetric positive definite.
From ellipse axes \(a,b\) and rotation \(\theta\), one convenient parameterization is
\[Q = R^T \begin{bmatrix} 1/a^2 & 0\\ 0 & 1/b^2 \end{bmatrix} R, \qquad R= \begin{bmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{bmatrix}.\]Metric rectification from \(Q\)
For a true circle, in metric coordinates the quadratic form is proportional to the identity. Under affine distortion, that becomes an ellipse, and its \(Q\) equals the unknown metric tensor (up to scale):
\[Q \propto G = T^T T.\]So you can obtain \(T\) by a symmetric factorization, e.g. Cholesky:
\[T = \mathrm{chol}(Q).\]Then the plane-upgrade homography is
\[H = \begin{bmatrix} T & 0\\ 0 & 1 \end{bmatrix},\]and you warp the affinely rectified image by \(H\) (or \(H^{-1}\), depending on your warp convention).
5. Two known length ratios (linear constraints in \(G\))
If you don’t have a circle, you can use known ratios of lengths on the plane.
Suppose in the real world you know
\[\frac{\|P_1P_2\|}{\|P_3P_4\|}=r.\]In the affinely rectified image, form displacement vectors
\[v = x_2-x_1,\qquad u = x_4-x_3.\]In the unknown metric, squared lengths are proportional to
\[\|P_1P_2\|^2 \propto v^T G v,\qquad \|P_3P_4\|^2 \propto u^T G u.\]So the ratio constraint becomes
\[v^T G v \;-\; r^2\, u^T G u \;=\; 0,\]which is linear in the entries of
\[G= \begin{bmatrix} g_{11}&g_{12}\\ g_{12}&g_{22} \end{bmatrix}.\]Two independent ratios give two independent linear equations. Solve for \((g_{11},g_{12},g_{22})\) up to scale (nullspace/SVD), then factor \(G=T^T T\) and build the same homography \(H\).
6. Takeaway
- After affine rectification, the remaining unknown metric has 2 DOF, so you need two constraints.
- A single circle on the plane (ellipse after affine distortion) provides exactly those two constraints (geometrically via the imaged circular points on \(l_\infty\), computationally via the ellipse quadratic form \(Q\)).
- Alternatively, two known length ratios give two linear constraints in the symmetric metric tensor \(G\), solved the same way and factored to obtain the metric-rectifying homography.
