Surfaces that are not flat

The pivot that is not the eye

A camera bolted to a tripod turns about the screw under its baseplate, and the light crosses somewhere else. Every ray of the panorama that results passes the pivot by e sin γ — the offset times the sine of how far off its own frame's axis the ray points — so the picture has a radius where a projection would have a point.

Worth reading first: What a 360-degree photograph actually is · The cylinder, and the price of going all the way round · The eye is a place, not a point.

Every panorama in this field so far has been a surface. The cylinder is a map from a direction to a mark; so is the equirectangular rectangle, and so are the four others this collection carries. Each of them is a perfectly good picture surface and each of them quietly assumes the thing this essay is about, which is that all those directions were taken from one place.

An instrument does not oblige. A camera is bolted to a tripod by the screw under its baseplate, and the light crosses the lens somewhere in front of that. Turn the camera and the pupil goes round a small circle.

A panorama pivoted 60 mm behind its own pupilLooking down on 6 frames taken by turning a camera about a point 60 mm from where the light actually crosses. The small circle is the path the entrance pupil takes; the heavy rays are each frame's own axis and they pass through the pivot exactly; the lighter rays are the edges of the strip each frame contributes, and they miss it by e·sin γ — 30.0 mm at 30.0° off axis. Every ray the stitch uses is tangent to a circle of that radius, drawn here, so the picture has a radius where a projection would have a point. The rays of the whole strip, top of frame to bottom, miss their own least-squares centre by 24.98 mm.the pivottangent circle, 30.0 mmno single viewpoint — the rays miss by 24.98 mm6 frames · pivot 60 mm off
Fig. 1 Six frames, from above. The small dotted circle is where the entrance pupil actually was for each frame. The heavy rays are each frame’s own optical axis and they pass through the pivot exactly; the lighter ones are the edges of the strip that frame contributes, and they do not.

One line of geometry, and it is exact

Put the pivot at the origin and the entrance pupil a distance ee in front of it, along the optical axis. A ray leaving the pupil at an angle γ\gamma from that axis is the line through ef^e\hat{f} in the direction d^\hat{d}, and its distance from the pivot is a cross product:

miss(γ)  =  ∣e f^×d^∣  =  esin⁡γ\text{miss}(\gamma) \;=\; \left| e\,\hat{f} \times \hat{d} \right| \;=\; e \sin\gamma

That is the whole of it. Nothing else is in it — not the scene, not the distance to anything, not the focal length, not which way the camera is pointing.

The two routes matter because the site’s habit is that a figure quoting only algebra is quoting algebra. missAt writes esin⁡γe\sin\gamma down; measuredMiss builds the ray and drops a perpendicular onto it from the pivot. They are not the same computation and they have to give the same number.

Three consequences fall straight out and each of them is a surprise the first time.

The centre column of every frame is exact

At γ=0\gamma = 0 the miss is zero. A ray along a frame’s own optical axis leaves the pupil at ef^e\hat{f} and travels along f^\hat{f}, so it is the radial line through the pivot. It passes through the pivot exactly, and it does so whatever ee is.

So a panorama assembled from infinitely narrow strips — one column of pixels per frame, taken at the centre of each — is a genuine central projection. Not approximately: exactly. And its centre is the pivot, which is a point where no lens has ever been.

Narrow the strips and the rays close on the pivotThe same solver the refraction and scroll fields use, run on a stitched panorama's own rays: how far they pass from their least-squares common point, against the number of frames the panorama was made from. At 6 frames it is 24.98 mm and the picture is a projection of nothing from anywhere; at four hundred it is 13.855 mm and the point it closes on is the pivot — 60 mm from where the lens was. With the pivot at the pupil the same fit lands at 0.0e+0 m, which is the control that makes the rest of these numbers mean anything. The curve does not go to zero, and the reason is the next figure.02040600.50011.5022.50frames in the panorama (log₁₀)the rays' miss from their centre (mm)6 framespivot 75 mm off the pupilcontrol at the pupil: 0.0e+0 m
Fig. 2 The fit the refraction and scroll fields use on the same kind of failure, run on a stitch’s own rays: how far they pass from their least-squares common point, against the number of frames. It falls, and the point it falls toward is the pivot rather than the pupil.

That is a strange thing to be true. The photographer’s error is measured in millimetres of hardware, and the picture it produces — if the strips are narrow enough — is a correct picture from a place six centimetres behind the glass.

It is also the reason the offset is not fatal by nature. A defect that vanishes in a limit is a defect with a price on it, and the rest of the field is about what that price is.

The rays are tangent to a circle, so the picture has a radius

For a strip of finite width the rays do not meet. Every one of them passes the pivot at esin⁡γe\sin\gamma, and the family of them is tangent to a sphere of that radius. Draw the horizon row alone and it is a circle; take the whole strip and it is a sphere.

That is the honest replacement for a centre of projection. A perspective picture is a projection from a point. A panorama stitched from a camera on the wrong pivot is a projection from a ball, and its radius is a number the arrangement fixes.

The rest of this site has met the same shape of failure four times, and it is worth putting the five side by side because they are not variations of one thing.

A picture through water has no centre because the medium bends the light. A scroll has none because the eye travels. A curved mirror has none because the reflector turns with position. A picture with two eyes in it has none because it was drawn from two on purpose. This one has none because the instrument was screwed to its mount in the ordinary way.

The ghost a reader can actually see

None of the above is visible in a photograph. What is visible is the seam: the place where two frames were joined, where a railing appears twice and a lamp-post has a kink in it.

A stitcher registers frames on their far field, which is what a homography through four points at infinity does. That registration is exact for anything at infinity and wrong for everything else, because the two frames were taken from two places. The residual is a parallax.

The flatness of that second curve is the whole argument. A misregistration that did not fall off with distance would be a calibration error — a lens whose focal length was wrong, a rotation that was mismeasured. One that falls as 1/D1/D is two eyes in different places, and there is nothing else it can be.

This is the same instrument the lens field uses on a plumb line: a residual is not a number, it is a shape, and the shape says which model is missing.

What the strip width buys

The seam sits half a frame-spacing from each frame’s axis. Stitch nn frames evenly round a turn and each contributes the strip ∣α∣≤π/n|\alpha| \le \pi/n, so the worst horizontal miss is

esin⁡(π/n)e \sin(\pi/n)

and it halves when the frame count doubles. The photographer who shoots more frames is buying exactly this.

The two halves are one number

The tangent sphere and the seam ghost are described above as two consequences. They are one, and joining them turns the essay’s geometry into a number a photographer can act on.

The two frames meeting at a seam have their pupils at ±π/n\pm\pi/n around the pivot circle, so those two pupils are separated by a chord of 2esin⁡(π/n)2e\sin(\pi/n) — twice the worst miss, and lying perpendicular to the seam’s own bearing. Two eyes that far apart looking at something DD away disagree by 2esin⁡(π/n)/D2e\sin(\pi/n)/D radians, which on a camera of focal length ff pixels is a doubling of

ghost  =  2 e f sin⁡(π/n)D pixels.\text{ghost} \;=\; \frac{2\,e\,f\,\sin(\pi/n)}{D} \ \text{pixels}.

So the ball the picture is projected from and the railing drawn twice are the same fact measured in different units: the ball’s radius is the parallax baseline, and the ghost is what a baseline of that size does at that distance. The 1/D1/D the seam figure reports is in the expression, and so is the halving with frame count, and so is the exactness of the centre column — at n→∞n \to \infty the sine goes to zero and both vanish together.

Put numbers in it and the practical picture changes shape. A 60 mm offset, six frames round the turn, a foreground at two metres, and a lens of about 950 pixels of focal length gives 28 pixels of doubling, which is a railing visibly drawn twice. Requiring under one pixel needs

esin⁡(π/n)  <  D2f,e\sin(\pi/n) \;<\; \frac{D}{2f},

which for those numbers is 1.06 mm — so at six frames the pivot has to be right to two millimetres, which is the tolerance the cylindrical panorama arrives at from the single-offset case and is the reason the no-parallax point is worth finding rather than estimating.

The same inequality settles what more frames can and cannot rescue, and the answer is bracing. Holding the 60 mm error and asking how many frames would bring the ghost under a pixel gives sin⁡(π/n)<1.06/60\sin(\pi/n) < 1.06/60, that is n>178n > 178. A hundred and seventy-nine frames, to make up for six centimetres of hardware, on a turn that six frames would otherwise cover.

Two readings, and they pull in opposite directions.

Frame count is a weak remedy and a real one. It buys a factor of nn, linearly, and linear is not much against an error of the wrong order — but it is the only remedy available after the photographs have been taken, since nothing in software can move a pupil that has already been somewhere. A stitch of many narrow strips from a badly mounted camera is genuinely better than a stitch of few wide ones, and the improvement is exactly proportional.

And the tolerance is a fact about the scene, not about the rig. DD is in the numerator of the requirement, so the same camera on the same misaligned mount is faultless for a landscape and hopeless for a room. The photographer who has never seen a ghost has not calibrated anything; they have photographed distant things.

The expression also says which of the two remedies is worth the effort in a given case, which is a division. Doubling the frame count and halving the offset buy the same factor, so the question is only which is cheaper — and moving a camera back on a rail is a one-time adjustment measured in millimetres while doubling the frames is paid on every panorama for ever. The pivot is the thing to fix, and the strip width is what to do when it is too late.

One last reading, because it explains a practice that looks like superstition. A slit-scan panoramic camera exposes one narrow column at a time while the body turns, which is the n→∞n \to \infty limit made mechanical: the sine goes to zero, the tangent sphere collapses to the pivot, and the picture is a true central projection from a point inside the camera whatever the lens’s pupil is doing. Such a camera therefore needs no no-parallax adjustment at all, and photographers who have used one report exactly that and are usually not believed. The expression above says they are right, and says why the same freedom is unavailable to anybody assembling a panorama out of whole frames.

More frames, less ghost — and it never reaches zeroThe doubling at the seam, in pixels of a 8,000-pixel panorama, for an object 3 m away and a pivot 60 mm off the pupil. Two frames give 51 px and thirty-six give 4.5 px: the baseline between adjacent pupils is 2 e sin(π/n), so halving the frame spacing halves the ghost. This is the half of the parallax a photographer can buy off by shooting more, and it is not the whole of it.0204060102030frames in the panoramaghost at the seam (pixels)75 mm off, at 3 m64 px → 5.7 px
Fig. 3 The ghost against the number of frames, at a fixed distance and a fixed pivot error. The baseline between adjacent pupils is 2e sin(π/n), so the curve is a sine and not a hyperbola — it flattens rather than falling away.

Which raises the obvious question and it has a non-obvious answer. Shoot enough frames and the ghost goes to nothing; so is the whole problem a matter of shooting more? No, and the reason is the other angle in γ\gamma. That is the next rung and it is the part of this that nobody says out loud.

Why the miss is a sine and not a distance

It is worth pausing on the form of the law, because it is the reason the whole thing is tractable.

The miss does not depend on how far away anything is. It is a property of the ray, not of what the ray hits, so it can be computed before a scene exists — and it can be quoted as a length in the room rather than as a disagreement about a photograph. That is the same move the refraction field makes when it reports millimetres of world rather than pixels of picture: a picture-space residual mixes the defect with the focal length, and a world-space one does not.

It also means the offset and the angle are separable. Doubling ee doubles every miss; changing the strip width changes the sine and nothing else. Two knobs, one product, and neither of them is the scene.

Two frames stitched on the sky, with the pivot 40 mm behind the pupilThe far field registers to 1e-13 px, which is what makes the stitch look correct. The near field does not: the nearest post lands 2.6 px from where the other frame put it and the furthest 0.25 px, an error falling as 1/distance — the signature of a parallax rather than a calibration error.the far field — where the stitch was fitted2.2 m — 2.6 px out24 m — 0.2 px outthe sky registers to 1e-13 pxthe foreground does not — up to 2.6 px
Fig. 4 The condition on “one eye”, drawn as the two frames a stitch actually registers. Where the entrance pupil is at all is itself an idealisation — a lens has an aperture of some size and the pupil is its image — which is what the lens field has to price before this one can quote an offset.

The two circles are not the same circle

The plan view has two circles in it and they are worth separating, because conflating them is the natural mistake.

The pupil circle has radius ee. It is where the lens actually went, and it is the hardware error: sixty millimetres of rail, measured with a ruler on a workbench.

The tangent circle has radius esin⁡(π/n)e\sin(\pi/n). It is what the picture has instead of a centre, and it is smaller — by the sine of half a frame spacing, which at six frames is a half. So the defect in the picture is not the defect in the mounting; it is the mounting’s error multiplied by a number the photographer chose when deciding how many frames to shoot.

A panorama pivoted 60 mm behind its own pupilLooking down on 12 frames taken by turning a camera about a point 60 mm from where the light actually crosses. The small circle is the path the entrance pupil takes; the heavy rays are each frame's own axis and they pass through the pivot exactly; the lighter rays are the edges of the strip each frame contributes, and they miss it by e·sin γ — 15.5 mm at 15.0° off axis. Every ray the stitch uses is tangent to a circle of that radius, drawn here, so the picture has a radius where a projection would have a point. The rays of the whole strip, top of frame to bottom, miss their own least-squares centre by 17.50 mm.the pivottangent circle, 15.5 mmno single viewpoint — the rays miss by 17.50 mm12 frames · pivot 60 mm off
Fig. 5 Twelve frames instead of six. The pupil circle is unchanged, because the hardware has not moved; the tangent circle has halved, because each frame now contributes half as much angle.

That separation is the useful one. A reader with a photograph and a complaint wants to know which of the two to change, and the answer is that they multiply — so halving either halves the result, and the cheaper one to halve is usually the count.

What a stitcher could do instead, and what it would need

The obvious repair is to stop registering on the far field and register on the scene: warp each frame by a map that depends on how far away each piece of it is, so that near things line up too.

That works, and the reason it is not what stitching software does is instructive. The map is a function of depth, and a pair of photographs from two places does not carry depth for nothing — it has to be recovered, from correspondences, with all the machinery the two-view field sets out and all the failures it prices. A stitcher that did this would be a stereo reconstruction with a panorama on the end of it.

So the far-field registration is not laziness. It is the choice to make a picture out of an assumption that is exactly true for everything at infinity and false by a computable amount for everything else — and the computable amount is what this essay is.

Two rays, 5.07 mm apart, in the plane that contains bothThe ray from the left eye through its mark and the ray from the right eye through its. With the marks placed exactly they meet, to 1.9e-15 m. With the same marks read to 1 px they miss by 5.07 mm at a range of 7.19 m. Triangulation is not an intersection; the reported point is a choice about what to minimise, and the gap is the part a residual alone will not tell you.midpoint — 5.07 mm gapfrom the left eyefrom the right eyegap 5.07 mm at 7.19 mexact marks: 1.9e-15 m
Fig. 6 What the alternative would cost. Two rays from two places meet at a point only when the match between them is right, and a match that is wrong is not a small error.

The refusal, and what it protects

A panorama needs at least two frames, and stitchMiss refuses one. That looks like housekeeping and is not quite: the single-frame case is a perfectly good photograph with a perfectly good centre — its own pupil — and calling it a panorama with a pivot error would be attaching a defect to a picture that does not have one.

The distinction the refusal enforces is that the offset only becomes a defect when frames are combined. One frame from a badly-mounted camera is exact. Two are not, and the amount by which they are not is a property of the join rather than of either.

The control, which is the whole reason the numbers mean anything

Set the offset to zero and every ray of every frame passes through the pivot exactly. The least-squares fit lands on it at the arithmetic floor — not small, zero — and the tangent circle has no radius because there is nothing for it to be tangent to.

That figure is worth looking at twice, because it is the one place on this site where the no-viewpoint strip and the viewing-distance strip are drawn by the same generator at two ends of one slider. The exemption belongs to the configuration rather than to the name — which is how the rolling shutter and the curved mirror are treated, and for the same reason.

The tripod rail, priced

The practical form of all this is a rail: a bracket that slides the camera back over its mount until the pupil sits on the axis. Panoramic heads have had one for a century and the instructions never say what it is worth.

It is worth esin⁡γe\sin\gamma, and that is a length in the room. At six centimetres of error and six frames the strip’s edges miss the pivot by three centimetres; the whole bundle, top of frame to bottom, misses its own best point by two and a half. Whether that matters is a question about the scene — a landscape at a hundred metres does not care, a table two metres away does — and the useful thing is that the scene enters only at the last step, through a division.

The ghost falls as one over the distance, which is what parallax doesThe seam's doubling in pixels of a 8,000-pixel panorama stitched from 6 frames, against how far away the object is, with the pivot 20 mm off the pupil. At 0.8 m it is 33 px and at 32 m it is 0.8 px. The second curve is the product of the two, which stays inside a factor of 1.022 across a forty-fold change of distance — and that flatness is the whole diagnosis. A misregistration that did not fall off with distance would be a calibration error; one that falls as 1/D is two eyes in different places.010203000.50011.50distance to the object being stitched (log₁₀ metres)ghost (px), and ghost × distance ÷ 4ghost × distance6 frames · pivot 20 mm offproduct flat to 1.022
Fig. 7 A smaller error, still visible. The rail is a linear adjustment and the ghost is linear in it, so half the rail is half the ghost.

What this does not say

It does not say a stitched panorama is not a picture. It is a picture; it is not a projection, which is a narrower claim and is the one this site makes about everything.

It does not say the offset is the largest error in a panorama. The lens is usually larger, and the lens field measures it; so is the assumption that the rotation was about a fixed axis at all.

And it does not say the pivot is a good centre of projection to use. It is the centre, in the narrow-strip limit, and a reader wanting the picture’s viewing distance should take it from there. But the strips are not narrow, and how far from narrow they are is the subject of the next rung.

A defect that vanishes in a limit has a price rather than a verdict. Find the limit first, then measure how far the instrument is from it — the two numbers together are a design, and either one alone is a complaint.

The limit here is a slit, and the instrument that actually takes it is a real camera with a real name. That one has no parallax at all and pays for it somewhere else entirely, which is two rungs along.

A swing-lens camera is the cylinder, exactlyThe instrument in plan: the entrance pupil at the centre, film bent into a circle of radius R about it, and a slit that sweeps with the lens. A ray from a subject at 34° of azimuth passes through the pupil and strikes the film half a turn away, at the marked point. Unrolling the film and undoing the pinhole's inversion gives a mark at azimuth 0.593412 in units of R — and lib/surfaces.js's cylinder, which is defined from a direction and has never been shown an instrument, puts it at 0.593412. The two agree to 1.1e-16 of a focal length over 861 directions, so this camera does not approximate a named picture surface; it is one.the pupil, and the pivotsubject at 34°the filmcorrect from 15 cm, at 160 mm wideagrees with the cylinder to 1.1e-16
Fig. 8 The instrument that turns about its own pupil, and puts its picture on film bent into a circle concentric with it. It has the centre this one does not, exactly.

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.

Causticcentre of projectionCylindrical projectionDemonstrationEntrance pupilleast-squares intersectionPanoramaParallaxPicture surfaceStitching