A wedge moves the centre, not the lens
Worth reading first: What survives a pane of glass · Recovering the camera from the picture it drew.
The wedge recovered with the camera put a wedge of glass into the camera model and recovered its angle from directions spread far enough off the axis: nothing inside eighteen degrees, a tenth of a degree by fifty-five. It closed on a concern about what else a real picture contains. A real camera has a lens with distortion of its own, and the wedge and the lens are fitted from the same picture.
The concern was specific. A wedge’s leading effect is a turn of every ray, which the camera’s orientation absorbs. Its next effect is a deflection that grows with the angle off the axis — and a displacement that grows with the angle off the axis is what a radial distortion coefficient describes. So the worry was that the two parameters would compete for one part of the signal, and that a calibration done through a display case would return a distorted lens that does not exist, with nothing in its residual to say so.
The measurement refuses both halves of that worry and finds a different victim.
Two models fitted together are nearly independent
The arrangement extends the earlier one in two ways. The camera now has a lens with a radial coefficient , bending each projected point outward or inward by in the radius measured in focal lengths. And the world directions are read on two rings, one at the stated angle off the axis and one at half of it, six directions on each, so that a radial coefficient has two radii to be told from a change of scale by. A 2° wedge of crown glass, its thick edge turned 25° from the picture’s horizontal, sits in front; the focal length is 620 px.
Fitted with everything free — three numbers of rotation, the wedge’s angle and azimuth, and — from exact readings, the fit returns the wedge and the lens exactly. The question is how the two trade under error, and the fit’s own covariance answers it: the correlation between the wedge’s angle and is −0.148 when the reading reaches ten degrees, −0.095 at thirty-two and −0.155 at fifty-five. A correlation near ±1 is what two parameters look like when one can stand in for the other; these are near zero at every reach.
The reason is the shape of the two displacements rather than their size. A radial coefficient moves every point along the line to the centre, by an amount that depends on its distance from the centre and on nothing else. A wedge moves points by an amount that depends on which way they lie relative to its thick edge: rays heading toward the thick edge meet the glass at a different angle from rays heading away from it. The two patterns overlap only in their average outward component, and that is a small part of either.
A calibration that knows nothing of the glass
The case the earlier essay worried about is the one where the glass is not in the model at all. A calibration of the usual kind fits the camera’s rotation, the radial coefficient, the focal length and the principal point, and has no parameter for a wedge.
The figure shows what it leaves, for a lens with no distortion behind a 2° wedge, read out to forty degrees. The twelve readings are drawn as large dots; the arrows are the difference between where the glass puts each direction and where the calibration puts it, drawn over the whole disc and magnified forty times. At the readings the calibration leaves 1.615 px root-mean-square and 3.42 px at worst. The pattern is two vortices either side of a line through the centre — a swirl set by the wedge’s thick edge — and nothing about it is radial.
The coefficient it reports is small. For a lens with no distortion at all, the calibration finds when the reading reaches ten degrees, 0.0025 at eighteen and 0.0015 from thirty-two on — a trace of pincushion, largest where the reading is narrowest. For a lens with a genuine barrel coefficient of −0.08, it reports −0.0718 to −0.0780: a lens very slightly less barrelled than the real one, not a lens that does not exist. Through no glass the same calibration returns −0.08 at every reach, which is the control.
So a display case does not make a calibration report a strongly distorted lens. It makes the lens read about two per cent less distorted than it is, and it does something else with the rest of the wedge.
The blame goes to the principal point
The wedge’s effect has to go somewhere, and the calibration has four places to put it.
The rotation takes the wedge’s leading effect, the uniform turn of every ray, as it did when there was no lens. What the rotation cannot take goes mostly to the principal point: the calibration moves it by 4.53 px when the reading reaches ten degrees, 7.75 px at forty and 14.42 px at fifty-five, always in nearly the same direction on the picture, between −69° and −66°. The focal length moves by 0.28 per cent at most, and , as above, barely at all.
That is the answer to “the wedge or the lens” — neither. The calibration blames the camera’s centre. A principal point moved by several pixels is a plausible calibration result: the principal point is not the centre measured how far a cropped or shifted frame’s principal point sits from the middle, and a calibration reporting a centre five pixels off is not reporting anything alarming. The wedge hides there.
A tilted sensor is not a distortion found the same place used by a different departure: a sensor tilted out of square with its lens moves every point of the picture, keeps straight lines straight, and is an ordinary pinhole picture whose principal point has moved — absorbed exactly by a calibration that frees its principal point. A wedge is not absorbed exactly, because it is not a pinhole picture at all, but the calibration reaches for the same parameter first. The principal point is where a calibration puts whatever moves the picture without being radial.
The residual announces it
The earlier worry had a second half: that nothing in the residual would say the model was wrong. The residual does say so, once the reading is spread.
With only the rotation and the radial coefficient free, the calibration leaves 0.084 px root-mean-square when the reading reaches ten degrees, 0.58 px at twenty-five, 2.07 px at forty and 6.8 px at fifty-five. Freeing the focal length and the principal point lowers that to 0.073, 0.49, 1.62 and 4.7 px: the extra parameters take something, but far from all of it. Against a reading error of 0.4 px, the residual passes the reading error at about twenty-two degrees.
So there are two regimes, and the boundary between them is roughly where the wedge recovered with the camera found the wedge’s angle first becoming recoverable. Inside about twenty degrees, the wedge is invisible to a calibration that does not model it: the residual is within the reading error, the principal point is quietly several pixels out, and the rotation carries most of the glass’s deviation of about a degree. Outside it, the residual grows faster than the reach, and its pattern — the swirl in the hero figure, not a radial one — is a signature a careful reader can recognise. A calibration report with a residual several times its reading error and a principal point pushed off in one direction is reporting glass.
Fitted together, neither pays for the other
With both in the model, the question left is how well each is known under a real reading error.
At a reading error of 0.4 px, the wedge’s angle is known to 1.93° when the reading reaches only ten degrees — its whole value, nothing recovered — and to 0.031° at fifty-five. The radial coefficient is known to 0.050 at ten degrees and 0.00009 at fifty-five. Both fall together as the reading spreads, and neither falls more slowly because the other is being fitted. That is what the correlation near zero predicts: each parameter’s precision is set by how far the reading reaches, and freeing the other costs almost nothing.
The practical reading follows directly. A calibration through glass that can be modelled — a display case, a port in a housing, a windscreen — gains the glass’s two numbers without losing precision on the lens, provided the reading reaches past the twenty-odd degrees where the glass first shows. Inside that, neither the glass nor the principal point is trustworthy, and adding the glass to the model does not help, because there is nothing in the reading to separate the glass from a turn of the camera and a shift of its centre.
What a reading through glass has to reach
The measurements above turn into a short protocol for anyone calibrating through a window, and each step rests on a number from them.
First, the reading has to reach past about twenty-two degrees off the axis, or the glass cannot be seen at all: inside that, its whole effect is shared between a turn of the camera and a shift of the principal point, and the residual stays within a 0.4 px reading error. That is the same boundary the wedge recovered with the camera found for recovering the wedge’s angle, arrived at from the calibration’s side. A narrow lens behind a display case therefore cannot tell whether the glass is there, and a calibration of it will report a principal point several pixels off with nothing to say why.
Second, a flat pane is not a wedge and does not do any of this. What survives a pane of glass found that a slab with parallel faces moves no direction at all, and a pane gives a product before it gives two numbers that what a pane does to positions depends on its thickness and index only together. The swirl in the hero figure is the signature of faces that are not parallel; a calibration through an ordinary window, whose faces are parallel to a small fraction of a degree, sees a correspondingly small version of it.
Third, the principal point is the parameter to watch. A calibration’s principal point is usually reported and rarely questioned, and a few pixels off the middle of the frame is ordinary. Through a wedge, a few pixels off in one fixed direction, together with a residual several times the reading error, is the combination that identifies glass, and neither half alone does.
A second route to the centre
There is a way to catch the glass with no extra parameter, and it uses the oldest recovery a picture offers.
Recovering the camera reads the principal point out of a picture from the vanishing points of three perpendicular families of edges: the principal point is where the triangle of vanishing points has its altitudes meet. That reading uses directions, as the calibration here does, but it has no radial coefficient and no freedom to trade the principal point against anything; the three vanishing points fix it. Through a wedge, the vanishing points are themselves deflected, each by an amount depending on its direction relative to the thick edge, so the principal point that construction returns is also moved — but by a different amount from the calibration’s, because the two readings use different directions and different models.
So two readings of one camera’s centre, taken through the same glass by two routes, disagree, where through no glass they would agree. That disagreement is a test for glass that needs nothing but the picture. How large it is for a 2° wedge, and how far the vanishing points must lie off the axis for it to exceed their own reading error, was not measured here; it is the kind of cross-check a recovery from vanishing points exists to allow. A calibration target and a building’s edges seen through the same window, read separately, would give it for free, and a disagreement of a few pixels in their centres would be the glass’s signature in a form nobody has to go looking for.
Why the shapes are different
The wedge’s deflection is often described in one line: for a ray along the axis, growing off the axis. That line hides the part that matters here.
A ray crossing a wedge is deflected in the plane that contains it and the wedge’s thickness gradient, and by an amount that depends on its angle of incidence at each face. Two rays at the same angle off the axis but on opposite sides — one heading toward the thick edge, one away — meet the first face at the same angle but the second face at different ones, and are deflected by different amounts. So the deflection has a component that changes sign across the line perpendicular to the thick edge, and that component is what turns into the two vortices of the hero figure once the uniform part has been taken by the camera’s rotation.
A radial coefficient has no such component. It is symmetric about the centre by construction, and straight lines that are not used that symmetry to show that a radial map leaves exactly the lines through the centre straight. A wedge leaves no family of lines straight in general, and its departure from a turn is antisymmetric about a line rather than symmetric about a point. The two can only share their average outward push, which is why the correlation stays near zero.
What this leaves out
Tangential terms. The calibration here has one radial coefficient. Many calibrations add decentring terms, which are not radially symmetric, and those may take more of the wedge’s swirl than the principal point does. A tilted sensor is not a distortion found that such terms describe a change of camera badly; whether they describe a wedge better was not measured.
A thin wedge and a thick one. Every number is for a 2° wedge of crown glass. The deflection is nearly proportional to at small angles, so the principal-point shift and the residual should scale with it; if they do, a display case with faces a quarter of a degree out of parallel moves the principal point by about half a pixel. That scaling was not measured.
A planar target. The readings are world directions, as in the earlier essays, standing for the vanishing points of straight edges. A calibration from a flat checkerboard seen at several poses reads positions rather than directions, and its extrinsics may take a different share of the wedge.
Still open: whether decentring terms take the swirl
The calibration here chose among a rotation, a radial coefficient, a focal length and a principal point, and gave most of the wedge to the principal point and the residual. Standard calibrations have two more parameters for exactly the kind of displacement a radial coefficient cannot describe: the decentring, or tangential, terms, which model a lens whose elements are not quite coaxial.
A wedge in front of a lens is, loosely, a very badly decentred element, and the measurement that settles the question refits the glass-blind calibration with the two decentring terms free and asks three things: how much of the swirl they absorb, whether the principal point then moves less, and whether the decentring terms a glass-blind calibration reports are large enough to look like a defective lens. If they take most of it, a calibration through glass returns a lens that is plausibly misassembled rather than a principal point that is plausibly off, and the residual that announced the glass here goes quiet.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The response is at the ends and the information is not — both name camera calibration, conditioning, least squares, radial distortion, residual
- A fitted radius is wrong before it is uncertain — both name conditioning, least squares, model error, residual
- A floor with a referent — both name conditioning, least squares, model error, residual
- An error with two terms — both name conditioning, least squares, model error, residual
- Fitting a lens from straightness alone — both name camera calibration, conditioning, least squares, residual
- How many lamps a drawing has — both name conditioning, identifiability, model error, residual
Named objects
A flat tag is an object no other essay names yet.
Camera calibrationConditioningIdentifiabilityleast squaresModel errorRadial distortionRefractive indexResidualSnell's law