Surfaces that are not flat

The third column is area

This field has measured what each picture surface does to straight lines and to shape. Both are questions for somebody looking at the picture. Somebody counting in it wants a third column, and the machinery has been returning it since the day it was written without anybody asking: the equal-area fisheye holds a square degree at one printed area to 8e-8 across 80° off axis, while a flat plane inflates it 191-fold.

Worth reading first: When the picture surface is not flat · Every fisheye is a different rule.

Every picture surface here has been put through the same two questions. Does it keep straight lines straight? Does it keep shapes? The answers make a table with a hole in one corner — nothing keeps both, and Beltrami’s theorem says nothing can.

Both of those are questions asked by somebody looking at the picture. There is a third question, asked by somebody counting in it, and it has been answerable from the same machinery since the day the machinery was written. Nobody asked it.

What each picture surface does to areaA square degree of world, printed at each angle off the axis, against what the same square degree prints in the middle of the picture. The equal-area fisheye is flat at 1 to 8.3e-8 across 80°; the equidistant one reaches 1.42×, the cylinder 2.71×, stereographic 2.90× and the flat plane 191×. The sweep runs at 45° to the axes on purpose: straight across, the cylinder reads a perfect 1.00 and is not equal-area at all.012020406080angle off the axis (degrees)area printed per solid angle, against its value on axis (log₁₀)equal-areaequidistantcylinderstereographicplaneswept at 45° to the axes, out to 80°equal-area 1.000 · flat plane 191×
Fig. 1 A square degree of world, printed at each angle off the axis, against what the same square degree prints in the middle of the picture. The equal-area fisheye is flat at 1; the flat plane reaches 191 times by 80°.

Counting is not a marginal use. How much of the sky is cloud, how much of the canopy is leaf, how much of a wall a projector covers, how much of a hemisphere a lamp reaches: every one of those is a fraction of solid angle, and every one is measured by counting picture. Whether that is legitimate depends on a property nothing in this field had measured.

What area scale is

At a direction, a picture surface maps a small patch of the sphere to a small patch of the picture. The ratio of the two areas is the area scale, and it is the determinant of the map’s differential — the same object whose two singular values give the anisotropy this field already reports.

So it costs nothing new. The differencing that was written to measure whether a right angle survives, and by how much the two arms are magnified, produces the determinant on the way past. It was returned, stored, and never plotted.

Normalising by the value on the axis is what makes it a claim about the surface rather than about the picture’s size. A picture can be printed at any scale; what matters is whether a square degree at the edge of the frame prints the same area as one in the middle.

The trap the cylinder set, again

The first version of this measurement swept straight across the field — directions at increasing azimuth, elevation zero — and reported the cylinder’s area scale as exactly 1.000 at every angle.

That is wrong, and it is wrong for a reason this field has already recorded once.

A cylinder about the vertical preserves area along its own equator. Sweeping straight across runs along that equator, so the sweep is evaluated at exactly the directions where the surface cannot fail. The same file already contains a measurement that fails this way on purpose: the naive conformality test differences along the surface’s own tangent basis, gives the cylinder a perfect score, and is kept because the failure is the essay.

Walking into it a second time, by a different function, some rounds of work later, is worth recording rather than quietly fixing. A test evaluated along a surface’s own axis is a test evaluated where it cannot fail, and the shape of that mistake is not memorable enough to be avoided by remembering it.

The sweep here runs at 45° to the axes, and the cylinder reaches 2.71 times.

Area scale across the picture, for six surfacesThe flat plane's area scale is sec³θ and leaves the frame before 70°. The equal-area fisheye is the flat line at 1, which is what its name asserts and what this measures.02468020406080angle off the optical axis (degrees)area scale, relative to the centreplanecylinderstereographicequidistantequal-areaequirect.measured by differencing on the spherethe plane leaves the frame
Fig. 2 The same quantity from the field’s own earlier measurement, which had it all along. What is new is asking for it as a comparison across the family rather than as one surface’s property.

The family, measured

Out to 80° off axis, area scale relative to the axis:

surface worst ratio
equal-area fisheye 1.0000
equidistant fisheye 1.42
cylinder 2.71
stereographic 2.90
flat plane 191

The first row is the result and the last row is the warning.

The equal-area fisheye is exact, to 8×1088\times10^{-8}, which is the differencing noise. That is not an approximation that happens to be good; the rule ρ=2sin(θ/2)\rho = 2\sin(\theta/2) is constructed so that the Jacobian determinant is constant, and the measurement confirms it rather than discovering it. What is worth having is the confirmation, because the name is often attached to lenses that do not obey the rule.

The flat plane is catastrophic. Its area scale is sec3θ\sec^3\theta, so it grows without bound as the field approaches 180°, and by 80° a square degree at the edge prints 191 times the area of one on the axis. Counting pixels in a wide rectilinear photograph is not approximately measuring solid angle; it is measuring something else entirely.

And the two in between are not small. A 42% error at the edge of an equidistant fisheye, or a factor of three on stereographic, would ruin any count they were used for, and neither is a surface anybody thinks of as extreme.

What each picture surface does to areaA square degree of world, printed at each angle off the axis, against what the same square degree prints in the middle of the picture. The equal-area fisheye is flat at 1 to 8.3e-8 across 60°; the equidistant one reaches 1.21×, the cylinder 2.02×, stereographic 1.78× and the flat plane 8×. The sweep runs at 45° to the axes on purpose: straight across, the cylinder reads a perfect 1.00 and is not equal-area at all.00.2500.5000.7500204060angle off the axis (degrees)area printed per solid angle, against its value on axis (log₁₀)equal-areaequidistantcylinderstereographicplaneswept at 45° to the axes, out to 60°equal-area 1.000 · flat plane 8×
Fig. 3 The same comparison over a narrower field. The flat plane is nearly usable out to 60° and hopeless beyond it, which is why the failure is invisible to anybody who has only ever used ordinary lenses.

What the numbers mean on a real frame

The table is in ratios and a reader wants to know what they cost, so here are three readings of the same fact.

A rectilinear photograph at 90° across. Its corners are about 55° off axis, where the area scale is roughly 5.4. So a cloud in the corner of the frame occupies about five and a half times the picture area of an identical cloud in the middle. Anybody estimating cover by eye from such a frame is over-weighting the corners by that factor, and anybody counting pixels is doing it exactly.

A fisheye sold as “equidistant”, used for canopy cover. Its rim is 90° off axis; by 80° it is 1.42 times, and the error is one-sided — the edge of the frame is over-represented, so an obstruction near the horizon counts for more than one overhead. For a canopy measurement, where the horizon ring is exactly where the branches are, that bias runs the wrong way and is not small.

And a stereographic reprojection, which people reach for because it looks best. Out to 80° it is 2.9 times, and taken to the extremes a little-planet projection uses it runs to a factor of over a thousand. It is the correct choice for shape and the worst available choice for counting, and the two facts are the same fact: conformality and equal area cannot be had together.

The general form of the caution is that the error is systematic and one-directional. It does not average out over many frames, it does not shrink with a better sensor, and it does not announce itself, because a picture on the wrong surface is a perfectly good picture.

What each picture surface does to areaA square degree of world, printed at each angle off the axis, against what the same square degree prints in the middle of the picture. The equal-area fisheye is flat at 1 to 8.3e-8 across 88°; the equidistant one reaches 1.54×, the cylinder 2.82×, stereographic 3.73× and the flat plane 23526×. The sweep runs at 45° to the axes on purpose: straight across, the cylinder reads a perfect 1.00 and is not equal-area at all.024020406080angle off the axis (degrees)area printed per solid angle, against its value on axis (log₁₀)equal-areaequidistantcylinderstereographicplaneswept at 45° to the axes, out to 88°equal-area 1.000 · flat plane 23526×
Fig. 4 The comparison pushed to the edge of what a flat picture can hold. The plane’s curve leaves the frame; every other surface is still on it, which is the whole reason the wide-field surfaces exist.

Why it has to be given up

The obvious next question is whether some surface could keep straight lines, shape and area at once. It cannot, and the reason is the theorem the neighbouring rung is about.

A surface preserving both angles and areas everywhere is an isometry, and an isometry from the sphere to a plane would mean the sphere has zero Gaussian curvature. It does not. So conformal-and-equal-area is impossible before any candidate is examined, which is why stereographic — the conformal one — has the second-worst area behaviour in the table, and the equal-area one bends every line it touches.

That makes three properties and a set of exclusions rather than a ranking, and the table is the honest form of the field’s whole position: perspective is a row rather than a header, and so is every other surface.

Straight, or conformal — the corner that is emptySix picture surfaces plotted by how much they bend a straight line (across) against how far they are from preserving shape (up). The plane sits on the left edge and the top; stereographic on the bottom and the right. Nothing sits in the bottom-left corner, and by Beltrami's theorem nothing can.straight AND conformal — empty10⁻⁷10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹10⁰10⁻⁷10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹10⁰10¹10²bend of a straight line, as a fraction of its own chorddeparture from conformal (degrees, or % of anisotropy)planecylinderstereographicequidistantequal-areaequirect.sampled over a 120° fanlower left would be a surface with no cost
Fig. 5 The two properties the field measured first, plotted against each other. The empty corner is Beltrami’s theorem, and area is a third axis coming out of the page.

What each surface is for

Once there are three columns, the surfaces stop being a ranking and become a set of tools, each with a job it is exactly right for.

Flat plane — when straightness matters and the field is narrow. Architecture, documents, anything where an edge must stay an edge. Never for counting.

Stereographic — when local shape matters. A face at the edge of a wide picture is the right shape on stereographic and squashed on everything else. Never for counting.

Equidistant — when angular distance from the axis is what is being read. A surveyor measuring the elevation of a horizon obstruction wants radius proportional to angle, and gets it. Not for counting, and not badly wrong for it either.

Equal-area — when a fraction of solid angle is what is wanted, and only then. It bends everything and it is the only member of the family whose counts are right.

Cylinder — when the field is wide horizontally and narrow vertically, and verticals must stay vertical. Panoramas. Its area behaviour is poor at high elevations and nobody photographs the zenith with one.

One room at 110° across, cast onto six picture surfacesEach panel holds the same angular width of the same scene. The flat plane keeps every straight line straight and pays for it at the edges; the five curved surfaces bend the ground lines by 3.5% to 6.0% of their own length.plane — bend 0.0%cylinder — bend 6.0%stereographic — bend 3.5%equidistant — bend 4.5%equal-area — bend 5.1%equirect. — bend 5.7%110° across in every panelsame scene, same angle, six surfaces
Fig. 6 The five, and the cube map, given the same scene. Nothing in this picture ranks them; each is doing something different with the width it was given.
How wide the picture gets as the field of view opensOn a flat plane the picture's half-width is tan(θ/2): it multiplies by 6.6 between 120° and 170° and is unbounded at 180°. On a cylinder it multiplies by 1.42 over the same range and keeps going past 180° without incident.0246850100150field of view across the picture (degrees)half-width of the picture, in focal lengthsplanecylinderstereographicequidistantcut off at eight focal lengthsthe plane crosses it at 166°
Fig. 7 The flat plane’s own limit, which is what makes its area column run away. As the field approaches 180° the picture is unbounded, and area is the quantity that notices first.

Where the area goes on each surface

It is worth knowing not only how much a surface distorts area but where, because the two surfaces with similar worst-case numbers put their error in completely different places.

The flat plane puts all of it at the edges. Its area scale is sec3θ\sec^3\theta, which is nearly 1 out to 30° and then climbs steeply. A rectilinear frame is trustworthy for counting in its middle and useless at its corners, and there is no gradual region between.

The cylinder puts it at high elevation and none at all across. Along the horizon its area scale is exactly 1 — which is the trap this essay opened with — and above and below it climbs. So a cylindrical panorama counts a horizontal band correctly and a zenith badly.

Stereographic puts it everywhere, smoothly. It has no flat region: the area scale departs from 1 immediately and keeps going, which is the price of holding every angle exactly everywhere.

And the equal-area fisheye puts it nowhere, which is the definition, at the cost of bending every line that is not a radius.

That distribution matters more than the worst case for most jobs. A measurement confined to a narrow cone about the axis can be made on almost any surface; one that uses the whole frame needs the surface whose error is flat rather than the one whose worst case is smallest.

One room at 150° across, cast onto six picture surfacesEach panel holds the same angular width of the same scene. The flat plane keeps every straight line straight and pays for it at the edges; the five curved surfaces bend the ground lines by 3.5% to 6.0% of their own length.plane — bend 0.0%cylinder — bend 6.0%stereographic — bend 3.5%equidistant — bend 4.5%equal-area — bend 5.1%equirect. — bend 5.7%150° across in every panelsame scene, same angle, six surfaces
Fig. 8 And what the different distributions look like as pictures rather than as curves. The plane’s stretch is concentrated at the corners, the cylinder’s at the top and bottom, and the fisheye’s is spread — three ways of spending the same unavoidable budget.

The measurement’s controls

A table where one row is exactly 1 and another is 191 invites the suspicion that the machinery is doing something different in the two cases, so it is worth saying what keeps it honest.

One code path. Every row comes from the same central differencing on the sphere. There is no closed form used anywhere in the table.

One closed-form check. The flat plane’s area scale is sec3θ\sec^3\theta, which is short enough to write down, and it is the only place in this field where the differencing can be compared against something that did not come out of it. It agrees. If that drifted, every number in the table would be reporting the step size.

And a sweep that is not along anybody’s axis. The 45° bearing, for the reason above.

The equal-area row’s 10810^{-8} is therefore differencing noise rather than an assertion, and the 191 is a measurement rather than a formula quoted.

What each surface does to a right angleOnly stereographic holds every right angle. The cylinder holds the one between its own vertical and horizontal and bends every other, which is how a test measured in a surface's own coordinates reports zero for a surface that is not conformal.02040600204060angle off the optical axis (degrees)worst departure of a right angle from 90° (degrees)planecylinderstereographicequidistantequal-areaequirect.measured by differencing on the spherea flat line is a preserved quantity
Fig. 9 The same machinery asked for the angle instead of the area, which is the check that the differencing produces what it claims: two singular values whose product is the area scale and whose ratio is the anisotropy. It is also where the cylinder’s trap was first recorded — the reading that gives it a perfect score is taken in its own coordinates.
Every angle exact, and unrecognisableA 360 photograph re-projected stereographically from below. Every crossing in the original crosses at the same angle here — the worst departure over 170° of the sphere is 1.0e-7° — while the area scale runs over a factor of 1213. Conformal is not a synonym for undistorted.angle, worst over the sphere1.0e-7°anisotropy, worst1.000000025area scale, largest over smallest×1213what a reader calls distortedthe third row, not the firstthe disc is 170° of the spheredrawn to 170° off axisthe first two rows are conformality
Fig. 10 And where the area column matters most. A little planet is stereographic, which is conformal and therefore not equal-area, and the ground under the viewer’s feet occupies a fraction of the picture that has nothing to do with the fraction of the world it is.

Reading the rule off a photograph

If area scale depends on the rule, and a lens is sold with a name rather than a rule, the practical question is how to find out which rule a given lens obeys. It is answerable from a photograph, and it is the same trade the rest of this site makes.

Photograph something with known angular structure. A row of marks at known angles from the axis — a calibrated target, or a set of stars, or a plumb line at a measured distance — gives pairs of (angle, radius in the picture).

Fit the radius against the four candidate rules, each with one free scale, because the size of the picture is not part of the claim. The rules are ρθ\rho \propto \theta, 2sin(θ/2)2\sin(\theta/2), 2tan(θ/2)2\tan(\theta/2) and sinθ\sin\theta, and they separate at large angles even when they agree near the axis.

And look at the residual, not the best name. All four agree to first order about the axis, so a fit over a narrow field identifies nothing. What identifies a lens is the shape of the curve at 60° and beyond, and a residual of a per cent or two of the picture’s radius is the difference between a lens that obeys a rule and one that merely resembles it.

That procedure has a pleasant consequence which belongs to another field on this site: a mirror ball, photographed from far enough away, turns out to obey the equal-area rule exactly, and it does so because of a two-line argument about reflection rather than because anybody designed it that way.

The third column changes what a picture is for

The habit worth taking from this is not about lenses.

A picture surface is a measuring instrument with a stated calibration, and which calibration is the right one depends on the question. There is no undistorted picture, so there is no default. Choosing a rectilinear lens because it looks natural and then counting pixels in it is choosing an instrument for its appearance and using it for a measurement it does not make.

That framing also says when to correct rather than re-shoot. A count made on the wrong surface is recoverable — the area scale is known, so each pixel can be weighted by it — provided the rule is known. What is not recoverable is a count made on an unknown surface, and “fisheye” is not a rule.

Counting cloud by counting pixels, on four picture surfacesOne sky, four cameras. The cloud really covers 10.31% of the 70° field, exactly, because it is made of caps whose solid angles add. Counting the pixels inside it gives 10.32%, 9.37%, 7.57%, 2.39% — right on the equal-area fisheye to 0.08%, which is the grid's own error, and out by -9%, -27%, -77% on the others. Weighting each pixel by the surface's area scale brings every one of them back to within 0.49%.share of the 70° field counted as cloud — the truth is 10.31%equal-area fisheye10.32% (+0.1%)equidistant fisheye9.37% (-9.2%)stereographic7.57% (-26.6%)flat plane2.39% (-76.9%)321² of picture, four caps of cloud0.08% on the equal-area rule, -77% on the flat plane
Fig. 11 The correction and its size, on one sky and four surfaces. Counting pixels is right on the equal-area rule and out by up to three-quarters on a flat plane, and weighting by the area scale brings every one of them back.
Area scale across the picture, for six surfacesThe flat plane's area scale is sec³θ and leaves the frame before 70°. The equal-area fisheye is the flat line at 1, which is what its name asserts and what this measures.024680204060angle off the optical axis (degrees)area scale, relative to the centreplanecylinderstereographicequidistantequal-areaequirect.measured by differencing on the spherethe plane leaves the frame
Fig. 12 The area column over a narrower field, where the flat plane is still nearly usable — which is why the failure is invisible to anybody who has only ever used ordinary lenses.
The same 96° view, projected onto a plane and onto a cylinderOn the plane every straight line stays straight (2e-13 px of bend) and the edges stretch; on the cylinder the stretch is even and straight lines bow by up to 700 px.flat picture plane — straight lines stay straightcylindrical picture surface — even stretch, bowed linesone scene, two picture surfacesneither is the distorted one
Fig. 13 And the older comparison this joins. The flat picture and the curved one differ in ways this field has measured three ways now, and the third way is the one a counter needs.

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.

AnisotropyArea scaleConformalCylinderEquidistantEquisolidFisheyeJacobiannecessary, not sufficientPicture planeQuadratureSolid angleStereographic