The response is at the ends and the information is not
Worth reading first: Fitting a lens from straightness alone · Straight lines that are not.
The lines that calibrate a lens places whole edges. One straight edge through the middle of a picture says nothing about a lens’s distortion; one a hundred and eighty pixels off the middle determines the coefficient to 9.0 × 10⁻⁴, and the precision rises in proportion to the offset. Crowd three edges on one side and, once the distortion centre is also unknown, the coefficient comes back ten times worse.
The finer question places the marks along one edge rather than the edges in the frame, and the obvious answer to it is wrong.
The response, and where it is
A radial map moves every point along its own radius. Straight lines that are not establishes what that does to an edge: the only line it leaves straight is one through the principal point, and the bend of every other is decided by how far it passes from that place.
Along a single edge the bend is not uniform. The edge’s closest approach to the centre is where the radial displacement is most nearly along the edge itself and so most nearly invisible; toward either end the displacement turns across the edge, and the departure from straightness grows as the square of the distance along it.
Cut one edge into tenths and measure each mark’s own response to the coefficient. The two outer tenths carry 63 per cent of it between them, the two middle tenths carry 1.4, and the outer quarters carry 93.3 per cent of the whole.
The advice that follows, and does not work
A calibration from a photograph has a budget: every mark is a place somebody has to find, and on a real edge near the corner of a frame they are hard to place. So the question has a practical form — if only twenty marks can be read along an edge, where should they go — and the response above answers it immediately. Put them where the response is: in the outer quarters, and better still in the outer tenths.
Measured, that is worse. At twenty-one marks and a known distortion centre, an even spread along the whole edge determines the coefficient to 2.04 × 10⁻³ and the outer quarters alone to 2.39 × 10⁻³ — seventeen per cent worse for marks placed exactly where nearly all the response is. The outer tenths, at the nine marks that fit there, are worse again.
What a straight line can absorb
The reason is the edge itself, and it is worth stating because it is the general form of a mistake that recurs.
The fit does not know where the edge is or which way it runs. Those two numbers are nuisances, fitted alongside the coefficient, and they can absorb a great deal: a constant displacement across the edge is absorbed by moving the line, and a displacement growing linearly along it is absorbed by rotating the line.
What cannot be absorbed is curvature. The distinguishing signature of a radial map on a straight edge is that the marks bow rather than merely shift and tilt, and a bow is a second difference.
Two clusters of marks, one at each end, give a second difference no lever at all. Whatever the two clusters say, a straight line placed somewhere and tilted somehow passes through both — so the response those marks show is very largely the part the nuisances swallow. The marks in the middle are what say the line is not straight between the ends, and that is the entire content of the measurement.
Three places, not two
If a curvature is the quantity, three separated places is the minimum, and a design with three does best.
Marks placed at both ends and in a cluster at the middle determine the coefficient to 1.77 × 10⁻³ at twenty-one marks — thirteen per cent better than the even spread. Tightening the three clusters improves it further, to 1.53 × 10⁻³, which is twenty-five per cent better than the even spread and thirty-six per cent better than the ends alone.
That number has a name elsewhere. Fitting a quadratic through noisy data, the arrangement of observations that determines its coefficients best is three equally weighted clusters at the two ends of the range and its middle. A bow is a quadratic, so the design a lens wants is the one a textbook on experiment design would have written down — arrived at here by measuring rather than by looking it up, which is what makes the agreement worth something.
And the ends are not dispensable. Marks in the middle half alone give 1.34 × 10⁻², nearly seven times worse than the even spread, because a bow measured only where it is small is measured badly. So the recipe has both halves in it: the ends supply the size of the bow and the middle supplies the fact that it is a bow.
With the centre unknown the gap widens
Everything above holds the distortion centre at the principal point. The lines that calibrate a lens found that freeing it is what turns a crowded design from mildly worse into ten times worse, so it is the case to check.
Freeing it here makes every design worse, keeps most of the ordering, and reverses one place in it. At twenty-one marks the even spread gives 1.92 × 10⁻², the outer quarters 3.00 × 10⁻² — now fifty-six per cent worse rather than seventeen — and the loose three-cluster design 1.79 × 10⁻², still the best. The middle alone collapses to 7.2 × 10⁻¹, thirty-seven times the even spread.
The reversal is the tight three-cluster design, which was the best of all with the centre known and is now 2.30 × 10⁻², worse than the even spread. The reason is that an unknown distortion centre has to be read from how the bow changes with distance from the middle of the picture, and three tight clusters supply almost no variety of distance. So the best design depends on what else is unknown, and a design chosen for one coefficient can be a poor design for four parameters.
The practical form of that is the loose three-cluster design: not quite the best with the centre known, and the best when it is not. Since a calibration from found edges rarely knows the centre, that is the one to use.
The absorbed part, written down
The whole result follows from one decomposition, and writing it out says why three places rather than two and why the middle is not optional.
Measure position along the edge as , running from at one end to at the other. The radial map’s displacement across the edge is, to leading order, proportional to times a quadratic in — that is the bow. The edge’s own unknowns contribute a constant (moving the line across itself) and a term linear in (rotating it).
So the measurement is a regression of the observed across-edge displacements on three basis functions, , and , and only the third carries the coefficient. What determines is therefore not how large the displacements are but how much of the quadratic survives after the constant and the linear part are projected out — and a quadratic is orthogonal to those two only if the marks are spread in .
That is why two clusters fail. Marks at only see the quadratic at one value of , where it is indistinguishable from a constant; the fit obligingly explains it as a moved line. Adding marks at gives the quadratic a second value, the constant cannot follow, and the coefficient appears.
It also explains why tighter clusters are better once the centre is known: for estimating a quadratic from three positions, the positions that separate it furthest are the extremes and the middle, and blurring each cluster spends marks at values of that are nearly duplicates. And it explains the reversal when the centre is free: the centre is read from how the bow’s size varies with distance from the picture’s middle, which a design confined to three values of cannot report.
Where this leaves the coefficient’s other uses
A coefficient determined better is worth something only where the coefficient is used, and it is used for two quite different things.
The first is undistorting a picture, where the precision translates directly into pixels of residual bend. The second is the model’s own limit: a barrel model folds at a radius it sets itself shows the fold’s position follows from the coefficient alone, so an uncertainty in the coefficient is an uncertainty in where the model stops being invertible.
That second use makes the precision matter at a place nobody looks. At the fold is at 47.49 degrees of field; a coefficient uncertain by 2 × 10⁻³ puts the fold uncertain by about a fifth of a degree, which is small. A coefficient uncertain by 2 × 10⁻² — what a crowded design gives once the centre is free — moves the fold by two degrees, and a reader comparing a fold at forty-seven degrees against a camera’s own forty-five-degree half-field is making a decision the uncertainty can flip.
A model that inverts has a horizon instead of a fold is the other model’s version of the same dependence, with a horizon in place of a fold and the same arithmetic from the same one number.
Why the response looked like the answer
The mistake has a name in this collection and it is worth attaching, because the same shape has turned up under several disguises.
A quantity’s response to a parameter is how much it moves when the parameter moves. Its information about that parameter is how much of that movement survives everything else that is unknown. The two are the same only when nothing else is unknown, and something else is nearly always unknown.
Here the something else is the edge’s own position and angle, which are not incidental: they are unknown precisely because the method’s whole point is that no calibration target is needed and the edges are whatever happened to be in the scene. Fitting a lens from straightness alone is that method — no target, no known scene, no camera — and the nuisances are the price of it.
So the correct reading of the first figure is not “put the marks here”. It is “the ends are where the signal is largest”, which is a fact about the map, and the placement question needs the second measurement to answer.
The same question, one level up
The measurement here is about marks along one edge and the lines that calibrate a lens is about edges in a frame, and the two answers have the same shape once both are stated.
That one found that distance from the centre is not enough: three edges crowded on one side of the frame determine the coefficient ten times worse than a spread once the distortion centre is free, because a bow on one side looks like a moved centre. This one finds that distance along an edge is not enough either: marks crowded at its ends determine the coefficient worse than a spread, because a bow seen at one distance along looks like a moved line.
Both are the same sentence with different nuisances in it. The coefficient is identified by a variation — of bend with position in the frame, or of displacement with position along an edge — and any design that supplies the variation at too few values hands it to whatever else is free. Fitting a lens from straightness alone is the method both are about, and the reason it has so many nuisances is exactly the reason it needs no target.
What this changes about reading an edge
Three practical statements, and the first is the one worth carrying.
Do not skip the middle of an edge. A reader tracing an edge in a photograph naturally attends to the ends, where the bow is visible, and may not bother with the straight-looking middle. Those marks are carrying the fact that the bow is a bow.
Twenty-one marks in three clusters are worth about thirty spread evenly, on the numbers above, which is a real saving when marks are expensive to place.
And the outermost tenths are not worth chasing on their own. The nine marks that fit inside the outer tenths give 5.5 × 10⁻³ against an even spread’s 2.6 × 10⁻³ at the same count, so the hardest marks to place — at the very corners of the frame — are the least useful per mark once the edge’s own freedom is accounted for. They earn their keep only in company with marks from the middle.
What this does not settle
One edge, one orientation, one offset. The edge measured is a horizontal one a hundred and fifty pixels below the centre. The share of response in the outer quarters depends on how far the edge passes from the centre and on how much of it the frame shows, and the best design may depend on those too. The direction of the result — three places beating two — follows from the curvature argument and should not, but it is not measured across the family.
Only one coefficient, and only a radial one. A lens destroys the invariant measures what a lens does to the one quantity a projection is supposed to preserve, and a tilted sensor is not a distortion measures a departure from a pinhole that the radial model does not contain at all. Neither is affected by where the marks sit along an edge, since both are about what the model can represent rather than about how well its coefficient is determined.
The noise is independent and uniform. Half a pixel at every mark, uncorrelated. A real edge traced by a detector has errors correlated along its length, and correlation along the edge is exactly what a nuisance absorbs, so the effect measured here would be larger rather than smaller.
The edge is assumed to be straight. That is the whole premise of the method and it is an assumption about the world rather than about the picture: a gutter that sags, a wall that bows, a shelf that has settled. A slightly curved edge is absorbed by exactly the quadratic term the coefficient is read from, which is the failure mode the three-cluster design is most exposed to, and nothing here measures how much real curvature is tolerable. The render is distorted on purpose is the one case where the bend is known in advance and the question does not arise.
And only is free. With a second radial coefficient in the model the two are strongly correlated — fitting a lens from straightness alone measures that correlation at −0.997 — and the mark placement that best separates two coefficients need not be the one that best determines one. That is a different design question with the same shape.
Still open: which marks separate the two coefficients
The design above determines one coefficient. A model with two has a harder problem, and the earlier correlation of −0.997 says how much harder: the two coefficients are nearly the same parameter over the field a single edge occupies.
Separating them needs marks at radii that differ enough for r² and r⁴ to look different, which is a statement about distance from the picture’s centre rather than about distance along an edge. So the two design questions point in different directions: the one measured here wants three places along an edge, and the other wants edges at several distances from the middle.
The measurement that settles it computes, for a fixed total number of marks, the precision of each coefficient and the correlation between them across designs that trade the two — marks spread along few edges, against fewer marks along many edges at different offsets — and asks whether a design good for one coefficient is ever good for both, or whether the budget has to be split deliberately. It would also say what the earlier measurement’s −0.997 becomes under a design chosen to break it, which is the number a reader would actually want before deciding whether a second coefficient is worth fitting at all.
The short version
A radial map’s effect on a straight edge grows as the square of the distance along it, so 93.3 per cent of an edge’s response to the coefficient sits in its outer quarters and 1.4 per cent in its middle fifth.
That is not where the marks should go. At twenty marks the outer quarters alone determine the coefficient sixteen per cent worse than an even spread, because two clusters at the ends are consistent with a straight line shifted and tilted, and the fit is free to shift and tilt the line. Marks at both ends and in the middle are eleven per cent better than an even spread, and the middle alone is seven times worse — so the ends give the size of the bow and the middle gives the fact that there is one. With the distortion centre free as well the ordering is the same and the gap widens to sixty-one per cent.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The proportion is the assumption — both name camera calibration, conditioning, demonstration, error propagation, principal point
- A fitted radius is wrong before it is uncertain — both name conditioning, demonstration, least squares, residual
- A pixel is not a point — both name camera calibration, demonstration, principal point, residual
- A third ray is worth what its picture is worth — both name conditioning, demonstration, least squares, residual
- An error with two terms — both name conditioning, demonstration, least squares, residual
- The curvature a shadow reports — both name conditioning, demonstration, least squares, residual
Named objects
A flat tag is an object no other essay names yet.
Camera calibrationConditioningCorrelationDemonstrationerror propagationleast squaresplumb-line calibrationPrincipal pointRadial distortionResidual