Surfaces that are not flat

Which rule a fisheye obeys, from straightness alone

Four candidate rules for a fisheye lens part by 54.0 per cent at 45° off axis, and a plumb-line fit shown no scene, no camera and no calibration target can still name which one took a photograph — reliably from about 45° of half-field. Below that the four are indistinguishable in the marks, and naming one collapses to guessing.
21 min read 6 figures Fitted, not assumedThe round trip

Worth reading first: Every fisheye is a different rule · Fitting a lens from straightness alone.

Fitting a lens from straightness alone recovers a single number — a distortion coefficient, k₁ — from nothing but the bent images of edges that were straight in the world. It works because a radial polynomial has one free parameter for a given picture, and one parameter is exactly what a residual can pin down from enough marks.

Every fisheye is a different rule established that a fisheye is not one thing: equidistant, equal-area and stereographic are three different rules for turning an angle into a radius, and a fourth, orthographic, is a fourth. That essay compared them as shapes. It did not ask whether a picture, on its own, says which of the four took it — because answering that needs the same blind fit turned on a harder question: not a coefficient sliding along one axis, but a choice among four qualitatively different curves.

Below about fifty degrees of half-field, the fit cannot tell the four apart, and that failure is not a shortcoming of the method — it is a fact about how little the rules disagree near the middle of a picture. Past that field the same fit, given nothing but marks it is told are straight, names the right rule reliably. Both halves of that sentence carry a number, and the essay owes both, in order: what the fit is capable of before reporting where it stops being capable of it.

The question is not idle. A fisheye lens is usually sold by its focal length and its field of view, and neither of those determines which rule it obeys; a manufacturer’s marketing copy calls a lens “equisolid” far more often than it publishes the mapping that would let anyone check. Archival footage, an unlabelled security camera, a still pulled from a decades-old film print — in every one of those a straight world edge is often the only fact available, and the question of which rule produced the bend is exactly the question straightness alone is asked to answer. What follows is what that question is actually worth, quantified rather than assumed either way.

Four rules that agree to first order and part by 54.0% at 45°The image radius each fisheye rule gives, against the angle off the optical axis, with every curve divided by its own value at ninety degrees so that the four are compared on their shape rather than on a choice of focal length. All four are the same straight line near the middle of the picture — each is fθ plus a cubic — and the cubic coefficients are equidistant 0.000, equal-area -0.042, stereographic 0.083, orthographic -0.167. That is the entire difference between them, and it is why identifying the rule from a picture is a question about the periphery. The flat plane is drawn as the control at the far end: it is not a fisheye rule at all and it is unbounded at ninety degrees.00.2500.5000.7501020406080angle off the optical axis (degrees)image radius, against the radius the same lens gives at 90°equidistantequal-areastereographicorthographicflat planeeach curve divided by its own radius at 90°54.0% apart at 45°
Fig. 1 The four rules’ own radius, plotted against angle off the axis and divided by each curve’s own value at ninety degrees so the comparison is about shape rather than a choice of focal length. Near the centre all four collapse onto the same straight line — each is fθ plus a cubic correction — with coefficients equidistant 0.000, equal-area −0.042, stereographic 0.083 and orthographic −0.167. The curves part by 54.0 per cent at 45° off axis, and that divergence is confined to the cubic term: it is a fact about the edge of the frame, not the middle.

What the cubic term is, and why it is small before it is large

A polynomial correction to fθ sounds like the kind of thing a lens destroys the invariant already measured: barrel and pincushion distortion are themselves radial polynomials layered on a rectilinear lens, recovered from bent lines exactly as a fisheye rule is recovered here. The difference is what the polynomial is correcting. There, the true rule is fixed (rectilinear) and the polynomial is the fault. Here, the polynomial coefficient is not a fault at all — it is the signature of which of four legitimate rules the lens was built to.

The cubic coefficients above are what the previous essay’s shape comparison already implied and never quoted as a number: equidistant is exactly fθ with no cubic term, and the other three are fθ plus a term that is small near θ = 0 and grows as θ³. A cubic vanishes fastest of anything non-trivial near the origin, so of course the four rules agree near the centre of a picture — that is what “vanishes as θ³” means in a sentence rather than a Taylor series. The whole question this essay asks is where θ³ stops being negligible against whatever noise the marks carry, and that is a field-of-view threshold rather than a fixed angle, because it depends on how precisely the marks can be read.

The sign of the coefficient is itself readable once it is isolated this way. Stereographic’s +0.083 puts it outside equidistant, radially, past the middle of the frame — the rule stereographic keeps every angle already showed grows faster than linear in θ to preserve local shape. Equal-area’s −0.042 and orthographic’s −0.167 sit inside equidistant, and orthographic by a wide margin, which is the same fact as its rim: a rule that runs out of image at ninety degrees has to be crowding everything ahead of that limit, and crowding is exactly what a negative cubic against a linear term does. None of that arithmetic is new information beyond what the four defining formulas already contain; what it buys is a single number, per rule, that a residual can be built around.

What makes four rules identifiable and not merely different

Being different is not the same claim as being identifiable, and the distinction is worth making precisely before any fit is run. Two curves are identifiable from noisy samples when the smallest gap between them, over the region the samples cover, still exceeds what the noise could produce by chance. The 54.0 per cent figure above describes the gap between two curves; it says nothing yet about whether that gap survives being read through a handful of marked points with a marking error attached. That is a second, separate question, and it is the one the rest of this essay actually answers.

A fit that already succeeds, on a harder kind of parameter

Before measuring where the fit for a discrete rule fails, it is worth being exact about what a fit for a continuous one already does, because the contrast is the whole of what makes this essay’s difficulty real rather than assumed.

k₁ recovered from 6 bent lines and nothing elseThe fit is never shown the coefficient, the camera or the scene — only which sets of points came from straight edges. It returns -0.350000000 against a true -0.350000, off by 6e-15, and straightens its own input to 4e-13 px.fitted k₁ = -0.350000true -0.350000, off by 6e-15
Fig. 2 The continuous case, borrowed from the essay that establishes it: six bent lines in, one coefficient out, with no scene, no camera and no calibration target given to the fit — only which sets of points came from edges that were straight. It returns −0.350000000 against a true −0.350000, off by 6e-15, and straightens its own input to 4e-13 pixels.

That fit is not merely accurate; it is accurate to the point where the fifteenth digit is the interesting one, because k₁ is one real number and the residual surface it minimises has one dimension to search. A discrete choice among four named rules is a different kind of problem even though the machinery underneath is identical — fit each candidate rule’s own focal length to the same marks and read off which residual is smallest. There is no dial to turn continuously from equidistant to stereographic; there are four separate fits, and the question is whether their four residuals are far enough apart to be told apart at all.

That is a model-selection problem wearing the clothes of a parameter fit, and the two kinds of problem fail differently. A continuous fit like k₁’s can be ill-conditioned — nailed exactly by clean data yet barely constrained once the data carries noise, which is the whole content of the two-coefficient valley the plumb-line essay’s own family measures elsewhere, where a correlation of −0.997 between two distortion terms means either can be traded against the other almost for free. A discrete choice cannot be ill-conditioned in that sense; there is no direction to trade along between “equidistant” and “stereographic”. It can only be unresolved — the four candidate residuals sitting close enough together that noise decides which is smallest — and unresolved is a cliff rather than a slope, which is exactly the shape the rest of this essay finds.

At ninety degrees the separation is not subtle

Run that four-way fit on a picture taken at a wide field and the answer is immediate.

With exact marks the right rule bottoms out at 2.7e-12 px and the nearest wrong one at 3.54The plumb-line objective, walked across candidate focal lengths for each of the four rules on one picture taken at 90° half-field with the stereographic rule. Nothing about the scene is given to the fit: no lengths, no angles, no camera — only which sets of marks came from edges that are straight in the world. The stereographic curve falls off the bottom of the plot at its own focal length, which is the arithmetic floor; the other three have minima that do not reach it, and the depth of the gap is what makes the rule identifiable. The floor here is exact marks. What the next figure adds is a marking error.-4-20244006008001e+3candidate focal length (pixels)straightness residual, log₁₀ pixelsequidistantequal-areastereographicorthographic20 straight edges, 180 exact marksstereographic reaches 2.7e-12 px
Fig. 3 The plumb-line objective at 90° half-field, on a picture actually taken with the stereographic rule, walked across a candidate focal length for each of the four laws in turn. The stereographic curve falls to 2.7 × 10⁻¹² pixels at its own focal length — the arithmetic floor, which is what a fit reaches when the candidate rule is exactly the one that took the picture. The nearest wrong rule bottoms out at 3.54 pixels and none of the other three comes near the floor at any focal length.

That gap — twelve orders of magnitude between the right answer and the best of the wrong ones — is what identifiability looks like when it is present. Nothing about the fit changed between this figure and the plumb-line fit above; the same objective, the same kind of marks, the same absence of any given scene or camera. What changed is the field of view, and at ninety degrees the cubic term the previous section named has grown large enough that a wrong rule’s prediction visibly disagrees with marks that came from a genuinely straight edge. A fit that cannot be fooled at 90° is doing real work. The question the rest of the essay has to answer is where that work stops being possible.

The shape of the residual well matters as much as its floor. At the true rule’s own focal length the objective does not merely touch zero; it does so at the bottom of a narrow parabola, because moving the candidate focal length away in either direction reintroduces the very bend the fit is measuring. A wrong rule’s minimum, by contrast, is a compromise: no focal length straightens marks that the rule cannot straighten exactly, so its best achievable residual is a floor set by the shape mismatch itself rather than by any adjustable number. 3.54 pixels is that floor for the nearest wrong rule at 90°, and it does not go to zero at any focal length whatsoever — which is the real distinction between “the wrong candidate fits less well” and “the wrong candidate cannot fit at all”, and it is the second of those the identification test actually relies on.

Below fifty degrees, naming collapses toward guessing

Run the same identification at every field from a full hemisphere down to a narrow-ish wide-angle, and score the fit only by whether the winning rule was the one that actually took the picture.

Named from about 45° up, and the other three excluded only past 57°Each of the four rules is used in turn to take the picture, the fit is run without being told which, and the winner is the rule with the smallest straightness residual — so guessing scores one in four exactly, which is the flat line across the bottom. With a 0.6 pixel marking error on an 1800-pixel frame the fit names the right rule reliably from about 45° of half-field, and at 15° it is at 29 per cent, which is not far enough above the one in four that guessing gives to act on. Naming the likeliest rule is the easier question: the vertical rule marks where the systematic bend a wrong rule carries first exceeds what 180 marks can detect at three sigma, which is 57° — below that, none of the four can be ruled out.00.2500.5000.750120406080half the field the picture holds (degrees)how often the fit names the rule that took the pictureguessingexcluded past 57°4 rules, 6 draws each, 0.6 px markschance is 25%
Fig. 4 Each of the four rules used in turn to take a picture, identified blind by which candidate gives the smallest straightness residual, against half-field of view, with marks read to 0.6 pixels on an 1800-pixel frame. Guessing scores one rule in four exactly — the flat floor at 25 per cent. With this marking precision the fit names the right rule reliably from about 45° of half-field; at 15° it manages only 29 per cent, barely above chance. The vertical line at 57° marks where a wrong rule’s systematic bend first exceeds what 180 marks can detect at three standard deviations — below that, none of the four can be excluded at all.

Twenty-nine per cent against a floor of twenty-five is not a weak signal to be improved with a better fitting algorithm; it is close to the number a coin toss produces, dressed up as a percentage. The mechanism is exactly the one the cubic-term argument predicted: at 15° of half-field the four rules’ predictions differ from each other by less than the noise on the marks, so the residual surface has four minima that sit within a whisker of one another and the smallest of the four is nearly a coin flip about which curve the noise happened to favour. Nothing is wrong with the fit at narrow field. There is simply not enough of the picture where the rules disagree.

The flat 25 per cent line across the bottom of that figure is doing real work and deserves to be read as the control it is. It is not a modelling assumption; it is what the same counting procedure returns when it is run on nothing but coin flips among four options, and the fact that the narrow-field measurement sits at 29 per cent rather than, say, 70 per cent, is what says the method has not gone wrong at narrow field — it has correctly reported that it has nothing to work with. A method that returned confident, incorrect answers at 15° would be worse than this one, because it would be indistinguishable from success without the guessing floor drawn alongside it. That is the same discipline what a null result is worth in decades insists on for camera parameters generally: an honest failure to resolve something is a finding, and reporting it as such is what lets the wide-field success above be trusted rather than merely hoped for.

The threshold restated as a calibration budget

The identification curve above fixes the marking precision and sweeps the field. The complementary question is to fix a target field and ask how precisely the marks would need to be read to reach it — which turns the same fact into something a photographer setting up a shoot could actually use.

A third of a pixel excludes the alternatives at 53°; a whole pixel needs 75°The field a picture has to hold before the three rules that did not take it can be ruled out, against how precisely its marks can be read. The threshold is not the marking error itself: with 180 marks a systematic bend of 0.169 pixels is already three standard deviations of the total squared residual, which is a good deal smaller than one mark's own error, and it falls as the fourth root of the number of marks. So reading twice as many marks buys about a fifth of the answer and reading them twice as well buys rather more. The curve is what a calibration budget looks like when the only prior knowledge is that some edges in the world are straight.02550750.2500.5000.7501marking error, pixels of a 1800-pixel framehalf-field at which the other three rules are excluded (degrees)40°48°53°60°67°75°180 marks on 20 straight edgesthree-sigma exclusion, 0.169 px at 0.3 px marks
Fig. 5 The half-field at which the three wrong rules are excluded, against how precisely the marks can be read, on a smaller frame than the wide-field figures above use. With marks good to a third of a pixel the exclusion needs 53° of half-field; with marks good only to a whole pixel it needs 75°. Beneath both curves, with 180 marks on 20 straight edges, a systematic bend of 0.169 pixels is already three standard deviations of the total squared residual — a good deal smaller than the marking error on any single point, because the threshold falls as the fourth root of how many marks there are.

That fourth-root relationship is worth being explicit about, because it is the part of the budget most easily spent on the wrong thing. Doubling the number of marks read along the straight edges buys a reduction in the detectable bend of only 2^(1/4), about sixteen per cent — a fifth of the answer, roughly, for twice the labour. Reading the same marks twice as precisely buys a full halving. A calibration effort that responds to “the fit will not commit” by marking more points along the same edges is spending on the wrong axis; the axis that pays is precision, not quantity.

This is also the figure that ties the two earlier readings together into one instrument. The identification sweep fixed a marking precision and read off a field; this one fixes a field and reads off the precision that field demands, and the two are the same threshold looked at from either axis. A photographer who knows the marking precision a straight-edge detector can actually deliver — and that number is a property of the lens’s own resolution and the detector, not of anything about the rule being sought — reads straight off this curve how wide a field the shot needs before the question is worth asking at all. Below that field, no amount of additional analysis recovers information the picture never captured.

Why the gap is a few pixels rather than a few per cent

The identify and floor figures both measure the fit’s resolving power. What they do not show directly is why the underlying pictures are so close to begin with — and that is worth seeing once, because it is the fact that makes everything above unsurprising rather than merely stated.

Equal-area against equidistant: the same hall, 3.0 px apart at worst on a 168 px discTwo rules drawing one room from one place, superposed, both scaled so that 120° of the world exactly fills the disc. Nothing about the scene, the station point or the field differs; only the rule does. The two agree exactly at the centre and by construction at the rim, and the greatest disagreement between them is 3.0 pixels, in the middle band of the picture where neither constraint holds. That is what has to be measured through a marking error before anybody can say which rule took a photograph.equal-areaequidistant120° across, both rules at the same disc radius3.0 px apart at worst
Fig. 6 Two rules — equal-area and equidistant — drawing the same room from the same station, superposed on a disc where 120° of the world exactly fills the frame. The two agree exactly at the centre and, by construction, at the rim; the greatest disagreement between them anywhere is 3.0 pixels on a disc 168 pixels across. Nothing about the scene, the station point or the field differs between the two curves — only the rule assigning radius to angle.

Three pixels on a picture that size is a fraction of a per cent of the frame, and it is the entire signal a fit at this field has to work with. The 54.0 per cent divergence quoted at the top of this essay is a ratio of the curves themselves at 45° off axis — a real and large difference in where a given direction lands, expressed as a fraction of one rule’s own radius there. What a straightness residual actually receives is not that ratio; it receives the absolute pixel gap between two candidate curves drawn through the same handful of marked points, and that gap is what stays small until the field opens far enough for the θ³ term to separate the curves by more than the marking noise. A percentage difference between two mathematical functions and a pixel difference between two fitted pictures are not the same quantity, and conflating them is the natural way to expect this fit to succeed at fields where it demonstrably cannot.

It also explains why the calibration-budget figure above answers in pixels rather than in a percentage of anything: a picture’s raw resolution sets the absolute size of the gap the fit has to see, so the same rule pair drawn onto a larger frame — a higher-resolution sensor, or simply a picture printed larger before its edges are marked — separates by more pixels at the same field of view, and the field at which identification becomes possible moves inward. Where a surface spends its pixels measures a related but distinct consequence of the same fact: how many marks a surface gives a patch of world depends on where in the frame that patch sits, so the pixel budget behind an identification is never spent evenly across the picture even before any rule-fitting begins.

What this does not settle

The negative result above is exact for the marks it was given, and it is worth being equally exact about what it does not extend to.

Nothing here says a real lens is well described by any of these four rules in the first place. A manufactured fisheye is, at best, close to one of them; every fisheye is a different rule already noted that lenses sold as equisolid are usually near the equal-area rule and not exactly on it, and a fit forced to choose among four idealised curves will return whichever is nearest even when none is right. Identifiability among four hypotheses is not the same claim as correctness of any of them.

The fit also needs edges independently known to be straight; nothing in this essay’s machinery discovers straightness on its own. And the whole measurement is geometric — it says nothing about vignetting, chromatic aberration or any other way a lens announces itself that is not a matter of where a ray lands. A fisheye could be identified by its falloff at fields where the geometry alone gives no purchase at all; that is a different subject and a different kind of evidence, borrowed from radiometry rather than projection.

Finally, the threshold quoted here — fifty-odd degrees, moving with marking precision — is specific to a straightness objective fed nothing else. A target with known angles between features, or two independent stations, would identify the rule at narrower fields than straightness alone ever could, for the ordinary reason that more information resolves more.

And the four-way contest never asks the more basic question of whether the lens is a fisheye at all. Rectilinear is drawn in the first figure only as the control at the far end of the family — the flat plane is not a fisheye rule, has no cubic correction, and is unbounded rather than merely different — and it is deliberately absent from the identification and threshold figures, which choose only among the four bounded rules. A picture that is secretly rectilinear, mistakenly fed to this same architecture, would be assigned to whichever of the four fisheye rules happened to fit its own moderate barrel or pincushion character best, and nothing in the four-way residual would flag that the true answer was outside the set on offer. Identifiability is always identifiability among the candidates asked about, and naming the candidates is a decision made before the fit runs rather than a conclusion it reaches.

One fit, run on three different pictures

The method this essay puts to a fisheye lens does not know it is looking at a lens. It is given a set of marks, told which sets came from edges that were straight, and asked which of several candidate rules straightens them best — and that is exactly the fit an error with two terms and what a null result is worth in decades apply to camera parameters more generally, where an honest null result is the answer rather than a failure to find one. The bias out of reach makes the companion point from the other side: a measurement that has never been shown an input capable of defeating it has not measured anything, which is why this essay reports the coin-flip figure at narrow field rather than only the clean one at ninety degrees.

The same fit is put to two more pictures elsewhere in this collection, on subjects that are not photographic lenses at all. The eye is a picture surface too runs it on a schematic retina and asks which of the four rules the eye’s own optics come closest to. The arcs the five-point construction actually draws runs it on the marks a draughtsman’s curvilinear-perspective construction leaves, with no photograph involved at all. In both cases the object under test has never seen this fit before, and in both cases the same twelve-orders-of-magnitude gap between the right rule and the nearest wrong one shows up when the field is wide enough — which is the real content of “from straightness alone”: the method does not care what drew the lines, only whether one candidate rule straightens them and the others do not.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Camera calibrationEquidistant projectionEquisolidfield of viewFisheyeIdentifiabilityplumb-line calibrationResidualStereographic projectionStraightedge construction