A lens's curve is known where its coefficients are not
Worth reading first: Fitting a lens from straightness alone · Straight lines that are not.
A closer pose sharpens one coefficient and not the pair pooled photographs of a ring target, tilted four ways and taken at several distances, and asked whether any arrangement of poses separates a lens’s two radial coefficients. None did. Their correlation stayed between −0.97 and −0.99 through every pool, a target further off added nothing, and a target brought closer sharpened the first coefficient by about half and pushed the pair closer together. The essay ended by turning the question round. Practice does not want the two coefficients. It wants the curve they make, the distance the lens moves a point at each radius, and a pair of coefficients that cannot be told apart might still make a curve that is very well known.
That was a guess about what a correlation near minus one means. It can be measured. The same fits that gave each coefficient’s scatter give the full covariance of the pair, and the displacement at any radius is a fixed linear combination of the two, so its scatter follows exactly. The question is how good the curve is, where in the picture it is best and worst known, and whether the distinctions between pools that mattered for the first coefficient matter for the curve at all.
The curve is a combination of the two
The lens model moves a point at radius from the distortion centre, with its radius in units of the focal length, outward by
For the lens in these essays, and on a camera with a focal length of 426 px, so the displacement is inward, a barrel. A fitted pair of coefficients is wrong by some errors and , and the fitted curve is then wrong at each radius by . Its variance is a weighted sum of the two coefficients’ variances and their covariance,
and the middle term is negative when the coefficients are anticorrelated. With a correlation of −0.993 it nearly cancels the other two. Where the two errors are tied so that , they cancel exactly at the radius , a node, and nearly cancel everywhere near it.
A quarter of a pixel at the edge
One photograph of the target square on to the lens, its marks read to half a pixel, gives the coefficients a correlation of −0.993 and the first a scatter of 4.77 thousandths. That is the worst calibration in the earlier comparison, and the one whose coefficients look most hopeless.
At 300 px from the centre, just inside the 310 px the lens can reach at all, it has moved a point inward by 95 px, and the fitted curve says where to within 0.24 px. If the two coefficients’ errors were independent, their scatters alone would put 2.40 px there, and the first coefficient’s scatter by itself, read as though it were the whole story, would put 1.62 px. The curve is known ten times better than its coefficients would suggest, and nearly seven times better than the number most calibration reports quote.
The figure’s other feature is that the scatter does not simply grow outward. It rises from nothing at the centre, where the lens moves nothing, to 0.27 px at about 250 px, and then falls, to 0.17 px at 295 px, before rising sharply at the last few pixels. The dip is the node, and the sharp rise beyond it is the fold a barrel model folds at a radius it sets itself found: near 310 px a small change in the drawn radius is a large change in the undistorted one, and the curve’s scatter is read at the undistorted radius.
The ellipse lies along the curve
The node has a picture. The two coefficients’ errors, drawn as an ellipse, and the set of errors that leave the curve unchanged at one radius, drawn as a line, show it directly.
The ellipse is 9.5 thousandths across in and 12 in , which is what the coefficients’ scatters say, and almost no width at all in the direction across its length. The dashed line holds every pair of errors that leaves the displacement at the chosen radius exactly where the true lens has it. Where that line lies along the ellipse, the fit’s errors are almost all errors that do not change the curve there, and the curve is known almost perfectly; where it crosses the ellipse, the errors move the curve, and the ellipse’s width across the line is the curve’s scatter.
Dragging the slider turns the line. At 100 px it crosses the ellipse steeply, but the ellipse is small in that direction and the displacement there is tiny anyway, so the curve’s scatter is 0.026 px. At 200 px it crosses at a shallower angle, 0.18 px. At 295 px it lies along the ellipse’s own axis, and the curve’s scatter there is just the residual the correlation leaves, 0.17 px. The ellipse is not a failure to measure two numbers. It is an accurate measurement of one number, the curve near the node, together with an honest statement that the photograph says almost nothing about another, the curve’s shape far from the marks, which nobody asked about.
The node is not chosen by the lens. It sits where the marks are densest in their leverage on the two coefficients, which is near the outer rings of the target, so moving the target moves the node. No design separates the two coefficients found the correlation set by the radii the marks cover; this is the same fact from the other side. The radii the marks cover are the radii where the curve is known.
Every pool reads it to a fraction of a pixel
The pools of the earlier essay can each be read the same way.
At 300 px: one photograph square on, 0.244 px; one tilted by 50°, 0.253; four tilts, 0.149; four tilts at two distances, 0.147; four tilts at four distances with one close, 0.084. Every pool knows the whole curve, to the edge of the image circle, to better than a quarter of a pixel, and the best to a twelfth. Each curve has the same shape: nothing at the centre, a rise through the middle of the picture, a plateau across the outer marks.
That settles what the earlier comparison’s wall meant. The coefficients cannot be separated; the curve is known, everywhere the lens can draw, to a precision well inside a single pixel. The wall would matter only to someone who wanted as a number in its own right, to compare lenses, or to hand one coefficient to software that uses a different second term, or to extrapolate the curve past the radii the model is good for. Undistorting a picture needs none of those.
The gains that do not carry over
The pools differed a great deal in the first coefficient. They differ less in the curve, and not in the same order.
Tilting the single photograph by 50° read the first coefficient 1.46 times better, which a tilted target pays for its tilt in perspective counted as a real gain. It reads the curve 0.98 times as well at its worst radius, slightly worse. The tilt moved the ellipse, mostly along its own length, and that is a direction the curve does not care about. Four tilts read the first coefficient 2.6 times better and the curve 1.8 times better; four tilts at two distances, 2.7 and 1.9; the pool with a close pose, 4.8 and 3.0.
So the pools’ gains in the first coefficient overstate their gains in the curve, by a factor between one and a half and two, and the single tilt’s gain does not carry over at all. The close pose’s gain does, which is the reassuring part: it brings marks to new radii and new leverage, and the curve improves with them. The rule that comes out is the one the earlier essays kept approaching. A pose is worth what it adds to the curve at the radii the pictures will be undistorted at, and the scatter of is a poor proxy for that, because most of what makes it small is a sharpening along the ellipse that changes no displacement.
The centre decides the middle of the picture
The curve is one part of where a fitted lens draws a point. The distortion centre is the other, and its error moves every point by the same amount in the same direction, which matters most where the curve itself matters least.
Near the middle of the picture the curve contributes nothing and the centre contributes everything: at 50 px from the centre the drawn point’s scatter is 0.196 px from one square-on photograph, 0.070 from four tilts, 0.032 from the pool with a close pose, all of it the centre. At 300 px the curve dominates and the centre adds a little: 0.244 and 0.313 px for one photograph, 0.149 and 0.165 for four tilts. The tilts help the centre far more than they help the curve, since a tilt is what lets the fit tell a shifted centre from a turned target, and that is where four tilts beat one photograph by a factor of nearly three.
So a calibration report that quotes the first coefficient’s scatter is quoting the wrong number twice. The number that says how well the lens is undone at a radius is the curve’s scatter there, and near the middle of the picture it is the centre’s scatter instead, which no coefficient’s standard deviation describes. Both are available from the same covariance the coefficients came from, and neither takes any more measurement to find.
What a calibration should report instead
The measurement suggests a different report, and it costs nothing to produce. A calibration that has fitted two coefficients has their covariance, and from it the scatter of the displacement at any radius, and of the drawn position at any point once the centre’s covariance is included. Three numbers carry nearly all of it: the scatter of the displacement at the outer edge of the region the pictures will be used in, the same at half that radius, and the scatter of the centre. For the square-on photograph those are 0.24 px, 0.08 px and 0.13 px; for four tilts, 0.15, 0.03 and 0.05. Those are numbers a user can compare directly with the half-pixel a reading is worth, and they say at once that either calibration is good enough to undistort a picture to well under a pixel everywhere, and that four tilts are worth taking if the centre matters.
The coefficients’ scatters say none of that. Quoted alone, 4.77 thousandths in on a lens whose is 280 thousandths reads as a 1.7 per cent coefficient error, which sounds respectable; quoted with ’s, 6.0 thousandths on a coefficient whose true value is zero, it reads as a second term that cannot even be given a sign, which sounds alarming. Neither impression is about the thing being calibrated. The lines that calibrate a lens set out to find which arrangement of lines best fixes a lens; the arrangement it should be judged by is the one that best fixes the curve at the radii in use, and by that test several arrangements the coefficient comparison ranked apart come out nearly level.
A comparison of two lenses is where the coefficients’ habit does real harm. Two copies of one lens design calibrated from different pools can report coefficient pairs that differ by several of their own standard deviations along the ellipse’s long axis, and look like different lenses, while drawing curves that agree to a tenth of a pixel. The test for whether two lenses differ is whether their curves differ by more than the curves’ scatters, at the radii both are used at, and that test is one line of arithmetic from the covariances both calibrations already produced.
Why the curve is well known and the pair is not
The arithmetic has a plain reading. The marks sample the lens’s displacement at a band of radii, and in that band the two functions and look very alike; a little more of the first and a little less of the second makes very nearly the same curve across the band. That is why the fit cannot say how much of each there is, and it is also exactly why it does not need to: whatever split it chooses, the curve across the band comes out the same. The response is at the ends and the information is not found the same thing on straight lines, where the lens’s response is largest at the frame’s edge while what the fit learns is spread through the middle.
The two coefficients are a coordinate system for the space of curves, and it happens to be a badly skewed one for this band: its two axes point in nearly the same direction. A correlation of −0.993 is a property of the coordinates, not of what is known. Written in better coordinates, say the displacement at two stated radii, the same fit would report two numbers with modest scatters and a modest correlation, and nobody would think it had failed. Fitting a lens from straightness alone read its result as a curve for this reason; the calibration that reads it as two coefficients makes the result look worse than it is.
A two-term lens, read to half a pixel, with the pose fitted
Every figure here assumes the lens is exactly the two-term model it is fitted with, so that the curve’s only error is the coefficients’ scatter. A real lens has higher terms, and a fit with two terms then has a model error as well, a systematic departure of the fitted curve from the true one that no number of poses removes and no covariance reports. Across the band of radii the marks cover, that error is small because the fit is chosen to be good there; past the marks it is an extrapolation, and the curve’s small scatter there is a statement about the model, not about the lens. Straight lines that are not found that a few tenths of a per cent of displacement bows a long line by pixels, and a third term of that size would be invisible to everything measured here.
The marks are read to half a pixel across the drawn curve, independently, as in a known target sharpens the fit and does not separate it, with no mark past the model’s fold; the scale and tilts of every pose are fitted with the lens. The scatters are first-order, from the Fisher information, which is accurate for errors this small.
Still open: what a third term does to the curve the two terms know
The two-term fit knows its own curve to a quarter of a pixel, which is a statement about precision. Whether that curve is the lens’s is a statement about the model, and it can be tested by giving the true lens a third radial term and fitting it with two.
The measurement that settles it draws the target through a lens with a stated small third coefficient, fits two terms as every essay here has, and asks how far the fitted curve sits from the true one at each radius, against the scatter measured here; whether the error is largest past the outer marks, as an extrapolation would be, or spread through the band the fit was good at; and whether the residual of each fit, the misfit left in the marks themselves, is large enough to say that a third term is needed, before the curve’s quarter of a pixel is believed.
A pair of radial coefficients correlated at −0.993 is an accurate measurement of a curve written in coordinates that cannot separate its parts. The curve is known to a quarter of a pixel at the edge, ten times better than the coefficients suggest, and a pose’s worth is what it adds to that curve, which the scatter of the first coefficient overstates.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A calibration through glass reports a prism — both name brown–conrady, camera calibration, identifiability, radial distortion
- A wedge moves the centre, not the lens — both name camera calibration, conditioning, identifiability, radial distortion
- Turning the glass tells the window from the lens — both name brown–conrady, camera calibration, identifiability, radial distortion
- A model that inverts has a horizon instead of a fold — both name brown–conrady, camera calibration, radial distortion
- A tilted sensor is not a distortion — both name brown–conrady, camera calibration, radial distortion
- The render is distorted on purpose — both name brown–conrady, camera calibration, radial distortion
Named objects
A flat tag is an object no other essay names yet.
Brown–ConradyCamera calibrationConditioningCovarianceIdentifiabilityRadial distortion