A lens destroys the invariant
A projection destroys length, angle, area and the ratio in which a point divides a segment. One quantity survives, and the whole of this site’s checking machinery is built on it: the cross-ratio of four collinear points.
A lens is not a projection. So the question is not whether the invariant survives it — it cannot — but by how much it fails, and what that failure costs where the invariant is being used to measure something.
The measurement, with its control
Four collinear world points, imaged. Through a pinhole, the cross-ratio comes back to 2e-16 relative — the last bit of a double, which is what “exactly” means in arithmetic. Through a lens with it comes back 1.29% out.
The control is the point of quoting the first number. A departure of 1.29% could be the invariant failing or it could be the code failing, and the only way to tell is to run the same four points through the same code with the lens set to nothing. That gives 2e-16, so the 1.29% is geometry.
This is the same discipline the refraction field runs on, and it is the reason the two fields’ numbers can be compared at all: water costs the invariant 1.20% in its figure, a lens costs it 1.29% in this one, and both are measured against the same exact control.
Why the curve has the shape it has
Read the curve and two things stand out.
It passes through zero at and nowhere else. That is not a numerical accident, it is the structure: the map is projective exactly when the polynomial is the identity.
And it is not symmetric about zero. Barrel and pincushion of the same magnitude do not cost the same, because the four points sit at particular radii and the polynomial’s effect at those radii is not an odd function of the coefficient. Which means, practically, that a lens’s sign matters as much as its magnitude to anyone measuring — and the sign is the one thing about a lens that a photographer can name from memory.
The magnitude of the departure also depends on where the four points are. A row close to the principal point is barely touched; a row at the edge of the frame is badly touched. The slider moves the row’s height above the ground, and the departure follows.
What “not projective” costs, more precisely
The cross-ratio is one instance of a larger loss and it is worth naming the others, because they are the things a reader might expect to still work.
Four collinear points stop being collinear. The figure’s row is nearly radial so the effect is small there, but in general the images of four points on a world line are four points on a curve. That is the primitive failure; everything else follows from it.
A rectangle no longer rectifies to a rectangle. Flattening a façade works by fitting the homography that sends the façade’s four corners to a rectangle, and every other point of the plane then goes where the homography says. On a distorted picture the corners still map, because four points always determine a homography — and every other point lands somewhere wrong. The residual is not visible in the corners, which is exactly the trap.
A vanishing point becomes an approximation. Bundles of parallel edges no longer meet at a point; they meet in a small region, and the least-squares fit returns its centre with a residual that is no longer at the 10⁻¹³ px the site’s clean figures report. The residual is the honest signal that something is wrong, and it is why the recovery reports its bundle residuals rather than only its focal length.
And the recovered camera is biased. Three vanishing points that are each a little off give a focal length that is a little off, and — worse — the error is not random. All three bundles are pulled in the same radial sense by the same coefficient, so the biases conspire rather than cancelling.
That last one is the reason a serious calibration solves for the distortion and the intrinsics together rather than in sequence. Correcting with a k₁ obtained from a biased focal length, then re-estimating the focal length from the corrected picture, converges — but it converges to the wrong pair unless the two are solved jointly.
From the invariant to a measurement
A per cent on the cross-ratio is abstract. Here is where it lands.
A height from one photograph is recovered from three or four marks on the picture and one known length. There are two routes, and this site carries both. The cross-ratio route uses the base, the horizon crossing, the top and the vertical vanishing point. The horizon-fraction route uses just the base, the horizon crossing and the top, and is exact when the picture plane is vertical.
Feed either of them a photograph from an uncorrected lens and the answer is wrong. How wrong is the question, and the answer turned out not to be what a first guess suggests.
The quantity the error tracks
The first version of this figure put a 3.4 m object 11 m away and reported an error of 0.06%. That is a real measurement and it reads as distortion does not matter here.
It does not, for that object, and the reason is the whole finding. The horizon-fraction method uses three marks that all sit on one vertical in the picture. If the object is short, those three marks are within a few pixels of one radius from the principal point — and a radial map moves points along their own radius. Three points at nearly the same radius are moved by nearly the same amount, in nearly the same direction, and the ratio between them barely changes.
So the error is not a function of where the object is in the frame. Moving the object from the middle of the picture to its edge changes the answer by almost nothing. The error is a function of how much radius its three marks span.
A 2.2 m object at that spot on that lens comes back 0.14% out. A 5.6 m object at the same spot on the same lens comes back 2.15% out — fifteen times worse, and the only thing that changed is how far up the frame the top mark went.
That is a rule worth carrying out of this essay, because it is actionable and it is the opposite of the intuitive one: on an uncorrected frame it is not the corners that cost, it is the tall things.
And the error is not monotone
There is a smaller finding inside that one, and it is the kind this site records rather than smooths over.
An earlier draft of the figure asserted that the error grows with the object’s height, which is what the paragraph above suggests and what any reader would expect. It is false. The signed error runs from +0.14% at 2.2 m through zero at about 3.2 m to −2.15% at 5.6 m. There is an object height at which an uncorrected lens gives exactly the right answer, by cancellation.
So the assertion in the figure is about the quantity that is monotone — the radial span of the three marks — and about the magnitudes at the two ends. Asserting the growth of the error would have meant either narrowing the slider until the claim held or dodging part of the figure’s own domain, and both are ways of not measuring the thing the figure is about.
The crossing point is not a useful place to work. It moves with the coefficient, with the camera’s height, with the object’s distance; it is a coincidence rather than a technique. But it is a real feature of the arithmetic and worth knowing about, because somebody comparing an uncorrected measurement against a known length and finding perfect agreement should not conclude that the lens is fine.
Which route degrades worse
The two height routes fail differently and it is worth saying how.
The horizon-fraction route is the one measured above, and it is the robust one — because all three of its marks lie on one line through the object, and a radial map is gentle on collinear-and-nearly-coradial points.
The cross-ratio route uses the vertical vanishing point as its fourth point, and that point is typically thousands of pixels off the canvas on a tilted frame. Distortion is not defined out there in any useful sense: the polynomial was fitted to the region the sensor covers and extrapolating it to focal lengths is meaningless. So the honest way to run the cross-ratio route on a distorted picture is to find the vertical vanishing point by fitting the drawn verticals — which are bent — and the fit is then compromised in a way that is much harder to characterise than a per cent.
That asymmetry is a small argument for the elementary method. On a level camera, where the horizon-fraction route works, it degrades predictably under distortion; the general method does not.
What to do about it
The practical position is simple and worth stating plainly, because the essay so far reads as a catalogue of trouble.
Correct first, measure second. Applying the lens profile restores the picture to being a projection, and after that every theorem on this site applies exactly. The correction is geometrically exact to the accuracy of the coefficients; what it costs is field of view at the corners and a little resolution, and neither of those affects a measurement.
If the profile is unknown, fit it. The plumb-line method needs nothing but the knowledge that some edges in the scene were straight, which almost every architectural photograph supplies for free.
If neither is possible, quote the sensitivity. A measurement off an uncorrected frame is not worthless; it is worth what its error bar says, and the error bar is computable from the radial span of the marks. That is a better outcome than either ignoring the problem or refusing to make the measurement.
The one place the invariant still holds exactly
There is a corner of the picture where a lens costs nothing at all, and it is worth pointing at because it is the same corner the previous essay found the undistorted line in.
Take four collinear points that lie on a line through the principal point. A radial map moves each of them along that line, so their images stay collinear, and the map restricted to that line is a monotone reparameterisation of it.
A reparameterisation is not projective in general, so the cross-ratio still changes — but it changes by an amount that is a function of the radii alone, and it does not change at all when the four points are placed symmetrically about the centre. There is a whole family of configurations for which an uncorrected picture gives the right answer.
That is a curiosity rather than a technique, in the same way as the height error’s zero crossing. What it is good for is a warning: a measurement that happens to come out right on an uncorrected frame is not evidence that the lens does not matter. The radial structure is full of places where the departure cancels, and hitting one of them proves nothing about the next measurement.
The pattern across two fields
This essay and the water one measure the same quantity failing for two different reasons, and the difference between them decides what can be done about each.
A lens’s distortion is a function of the image point alone. So it is correctable by warping the image, and that is exactly what lens correction is. The cross-ratio is destroyed and then restored.
Refraction’s is not. The displacement depends on the object’s distance, which the picture does not carry, so no warp repairs it and the invariant stays broken.
Both break the same theorem by about the same amount. One is a nuisance with a known cure and the other is a change in what kind of problem is being solved. That distinction is not visible in the per cent, which is the argument for measuring the structure — the near-and-far split, the depth-dependence — rather than only the departure.
Random error and systematic error, side by side
It is worth putting this essay’s error next to the one the metrology field already measured, because they are the two error terms in every single-view measurement and they behave in opposite ways.
The sensitivity per pixel is a random error: it says how much the answer moves if the mark is placed a pixel wrong, and the field found that it tracks distance linearly rather than the object’s own height. Being random, it shrinks with care — mark the points more precisely, average several readings, use a higher-resolution frame.
Distortion is a systematic error: every mark is displaced in a determined direction by a determined amount, and no amount of care with the marking touches it. It tracks the radial span of the marks rather than the distance, so the two error terms are not even functions of the same variable.
Which dominates depends on the configuration, and the pair of curves says which. A short object far away is sensitivity-limited: the marks are close together and a pixel matters a great deal, while the radial span is tiny. A tall object nearby is distortion-limited: the marks are far apart so a pixel matters little, and the radial span is large.
That is a genuinely useful thing to know before setting up a measurement, and neither field could have produced it alone.
A last note on the size of these numbers
One and a third per cent, two per cent on a height. These are not large numbers and it would be easy to read the field as making a fuss.
Two things keep them worth the fuss. The first is that they are systematic rather than random: repeating the measurement does not reduce them, averaging over many photographs from the same lens does not reduce them, and every measurement made with that lens is wrong in the same direction by the same amount. A two per cent systematic error is a very different object from a two per cent scatter.
The second is that they are invisible. Nothing in the picture announces them. The vanishing points of a lightly distorted picture still meet, near enough; the recovery still returns a plausible camera; the marks still look like marks. The whole content of this field is that a departure of this size leaves a picture that passes every eye test and fails a measurement — which is the same shape as the fourteen captions this site shipped quoting numbers its own figures never drew, and the reason both have gates now.