Surfaces that are not flat

The parallax you cannot shoot away

A stitched panorama's parallax has two halves and they do not behave alike. The one across the seam falls as the sine of half a frame spacing, so more frames buy it off; the one up the frame is the sine of half the frame's own height, and no quantity of shooting touches it. They cross at π over β, which has no pivot error in it at all.

Worth reading first: The pivot that is not the eye · What a 360-degree photograph actually is · When the picture surface is not flat.

The previous rung ends with a law and a question. The law is that a ray of a panorama shot about the wrong pivot passes that pivot by esinγe \sin\gamma, where γ\gamma is how far off its own frame’s axis the ray points. The question is whether shooting more frames makes the problem go away, since narrowing the strips narrows γ\gamma.

Half of it does. The other half is the subject of this essay and it is the half nobody says out loud.

One half falls away and the other does not moveThe worst miss across the seam and the worst miss at the top of the frame, against the number of frames, for a pivot 60 mm off the pupil and a frame 38° tall. The first is e·sin(π/n) and falls from 60.0 mm to 2.9 mm; the second is e·sin(β) and is 19.53 mm at every count, bit for bit. They cross at π/β = 9.47, so past 10 frames every remaining pixel of parallax is vertical and no further shooting touches it. The upper curve is the corner of the strip, which is what a reader actually gets.0204060204060frames in the panoramadistance from the pivot (mm)π/β = 9.5across the seamup the framepivot 60 mm · frame 38° tallfloor 19.53 mm
Fig. 1 The worst miss across the seam and the worst miss at the top of the frame, against the number of frames. One of them falls away and the other is the same number at every count.

γ has two angles in it

A direction inside a frame has an azimuth α\alpha and an elevation β\beta, and the angle off the axis is not their sum. It is the hypotenuse of a spherical right triangle:

cosγ  =  cosαcosβ\cos\gamma \;=\; \cos\alpha \, \cos\beta

Which is an ordinary identity and carries the whole finding. The photographer controls α\alpha — stitch nn frames round a turn and each contributes απ/n|\alpha| \le \pi/n, so more frames is less azimuth. The photographer does not control β\beta. The frame is as tall as the frame is, and the top of it is at βmax\beta_{\max} whether there are six frames or six hundred.

So the two worst cases are

esin(π/n)andesinβmaxe \sin(\pi/n) \qquad\text{and}\qquad e \sin\beta_{\max}

and only the first has nn in it.

The miss is e sin γ, and nothing else is in itThe perpendicular distance from the pivot to a ray, against how far off its own frame's axis that ray points, for a pupil 60 mm in front of the pivot. The curve is e·sin γ and the marks are the perpendicular distance measured from the actual line, at arbitrary headings; the two agree to 1.4e-14 mm over the sweep. Neither the scene nor the distance to anything appears in it. The two marked angles are the ones a stitch actually uses: half a frame spacing across, at 30.0°, which the frame count controls, and half the frame's height, at 19.0°, which it does not.0204060020406080angle off the frame's own axis, γ (degrees)distance from the pivot (mm)across: 36.2 mmup: 23.6 mmpivot 73 mm off the pupiltwo routes agree to 1.4e-14 mm
Fig. 2 The law, with the two angles marked on it. The one on the left is set by the frame count; the one on the right is set by how tall the frames are, and the sweep does not distinguish them because it has never been told which is which.

The floor is a property of the frame’s height

Fix the pivot error and change nothing else. Shoot with a wide lens held upright and the frame is tall: sixty degrees of vertical field, so βmax=30°\beta_{\max} = 30°, and the floor is half the pivot error. Shoot with a long lens and the frame is short: twenty degrees, so βmax=10°\beta_{\max} = 10°, and the floor is a sixth of it.

The floor is the frame's height, and so is the crossoverBoth halves of the finding as functions of one number nobody thinks of as a panorama setting. The irreducible miss is e·sin(β), where β is half the frame's vertical field: 20.0 mm at 38° with a pivot 60 mm off. The second curve is π/β, the frame count past which every remaining pixel of parallax is vertical — 9.2 here, so 10 frames. Shooting a taller frame raises the floor and lowers the count at which you meet it; nothing about the offset appears in the second number at all.02040204060the frame's vertical field of view (degrees)floor (mm), and frames to reach itfloor (mm)frames to reach itpivot 60 mm off the pupilat 39°: 20.0 mm, 10 frames
Fig. 3 The floor against the frame’s vertical field, with the frame count at which it takes over drawn beside it. Both curves are about the frame’s height and neither is about the mounting.

That is the practical form. A photographer who cannot fit a rail to a tripod head — or who does not have one, or who is holding the camera — improves the picture more by turning the camera on its side and shooting narrow frames than by shooting more of them. The first changes βmax\beta_{\max}; the second only changes α\alpha.

It also inverts the usual advice, which is to shoot in portrait orientation to get more vertical coverage from fewer frames. That is right about coverage and wrong about parallax: a portrait frame is taller, so its floor is higher, and fewer frames means each contributes more azimuth as well. The two errors move the same way and the advice moves against both.

The same lens behind five sensorsA 24 mm lens subtends 73.7° across full frame and 18.0° across a phone sensor. The focal length is the same in every one of these; what changes is the rectangle behind it. Two setups matched on angle rather than on focal length are correct from the same distance — 222 mm for a 160 mm print — whatever their formats.full frame · 73.7°APS-C · 52.4°Micro Four Thirds · 39.6°1 inch · 30.8°phone (1/1.7″) · 18.0°one 24 mm lens · the angle is a property of the rectangle behind itMicro Four Thirds: 2.00× diagonal, 2.08× wide, 1.85× tall24 mm across five formats73.7° down to 18.0°
Fig. 4 Where the frame’s height comes from, which is a focal length and a piece of silicon of a stated size. Neither of them is a fact about panoramas and both of them set this floor.

The crossover has no offset in it

The two halves are equal when sin(π/n)=sinβmax\sin(\pi/n) = \sin\beta_{\max}, so

n  =  πβmaxn \;=\; \frac{\pi}{\beta_{\max}}

and ee has cancelled. The frame count past which every remaining scrap of parallax is vertical is a property of how tall the frames are and of nothing else — not of the mounting error, not of the lens, not of the scene.

At a thirty-eight degree vertical field that is nine point four seven, so ten frames. Past ten frames the photographer is buying nothing.

One half falls away and the other does not moveThe worst miss across the seam and the worst miss at the top of the frame, against the number of frames, for a pivot 60 mm off the pupil and a frame 60° tall. The first is e·sin(π/n) and falls from 60.0 mm to 2.9 mm; the second is e·sin(β) and is 30.00 mm at every count, bit for bit. They cross at π/β = 6.00, so past 6 frames every remaining pixel of parallax is vertical and no further shooting touches it. The upper curve is the corner of the strip, which is what a reader actually gets.0204060204060frames in the panoramadistance from the pivot (mm)π/β = 6.0across the seamup the framepivot 60 mm · frame 60° tallfloor 30.00 mm
Fig. 5 A taller frame. The floor is higher and the crossover comes sooner, which is the same statement twice: a tall frame reaches its own limit early and the limit it reaches is worse.

That is an unusually clean result for a practical question, and the reason it is clean is that the sine has already separated the variables. Both halves are ee times a sine; the ratio between them has no ee; and the ratio is what decides which one to work on.

It is worth noticing what kind of statement that is. This site keeps finding quantities that survive a change of everything else — the cross-ratio under a projection, the axis scales under a parallel drawing, the seven directions no quantity of pictures fixes. A crossover with the offset cancelled out of it belongs on that list: it is a fact about the shape of the arrangement rather than about how badly the arrangement was made, so it holds for a tripod head with a rail nearly right and for one with no rail at all.

The vertical half is what a spherical camera is made of

The most familiar instrument this applies to is not a tripod at all.

A consumer 360° camera has two fisheye lenses back to back, and the format it writes asserts, by being one rectangle, that its contents are the directions from one point. They are not: they are the directions from two pupils a few centimetres apart, and the stitch treats them as halves of one sphere.

Read against this essay, that camera is the extreme case of the horizontal half being bought off entirely — two frames, but each covering a full hemisphere, so there is no seam inside either. What is left is the join, and the join runs all the way round, top to bottom. Every angle on it is a γ\gamma near ninety degrees, so the miss is nearly the whole separation of the two pupils, everywhere along it.

Six flat pictures, and what happens where two of them meetEach face is a flat picture at 90°, so a straight line inside one is drawn exactly straight — 1e-15 of its chord. Across a seam the two straight pieces meet at 1.80°. The shading is the area scale, which runs from 1 at a face's centre to 5.196 at its corner, with an anisotropy of 1.7321 there.leftfrontrightbackupdownacross the left/front seam: 1.80°, with each side straight to 7e-16corner area ×5.196anisotropy √3 = 1.7321 there
Fig. 6 The other way of storing the same directions, which changes the addressing and not the premise. Six flat faces or one rectangle, and either of them says the light came from one place.

That is why the ghost on a spherical camera is a ring rather than a pair of lines, and why nothing about the file records it. The format has no place to write down a second centre.

The assertion that makes it a measurement

“The vertical miss does not change with the frame count” is the kind of sentence that gets written down and never tested, and there are two ways to test it badly.

The first is to check that it changes little. That passes for a quantity that changes slowly, and it would pass for a wrong implementation in which βmax\beta_{\max} leaked a dependence on nn through the strip geometry.

The second is to check it at two counts. That passes for a quantity that happens to agree at those two.

assertOneHalfOfTheParallaxIsForSale requires the set of distinct values of the vertical miss, over eight frame counts from two to sixty-four, to have one element. Bit for bit, not to a tolerance. And it requires the crossover to land at the two frame counts either side of π/β\pi/\beta — one short of it the horizontal is still the larger, at it the horizontal is not — which is a statement about the closed form rather than about a list of counts somebody chose.

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. 7 The half that is for sale, in the currency a reader can see. The curve flattens rather than falling away, because the baseline between adjacent pupils is a sine and a sine flattens.

A number that is not the miss, and is the one to quote

There is a temptation to report the floor as a single figure of merit and it should be resisted, for a reason the lens field has already met.

A miss in metres is a length in the room. Whether it matters depends on how far away the thing being drawn is, because what a reader sees is an angle: the miss divided by the distance, times the panorama’s own focal length. So the same floor is invisible on a landscape and gross on a table, and a specification that quotes the metres alone has stated a fact and answered no question.

The honest quantity is a pair — the floor, and the nearest distance at which it stays under a pixel. For twenty millimetres of floor on an eight-thousand-pixel panorama that distance is a little over a hundred and fifty metres, which is a way of saying that a badly-mounted panorama of anything indoors is a badly-mounted panorama.

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 60 mm off the pupil. At 0.8 m it is 102 px and at 32 m it is 2.4 px. The second curve is the product of the two, which stays inside a factor of 1.067 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.025507510000.50011.50distance to the object being stitched (log₁₀ metres)ghost (px), and ghost × distance ÷ 4ghost × distance6 frames · pivot 60 mm offproduct flat to 1.067
Fig. 8 The conversion, drawn: the miss turned into what a reader sees, against distance. The product of the two is flat, which is the whole reason one number cannot stand for both.

What is left at the limit, and what it looks like

Take the frame count to infinity and the horizontal miss goes to nothing. What is left is a picture whose horizon row is exact and whose top and bottom rows are drawn from somewhere else.

That is a strange object and it is worth saying what it is not. It is not a picture with a soft edge, and it is not a picture that is worse at the top. It is a picture whose rays are tangent to a sphere of radius esinβmaxe\sin\beta_{\max} — the same tangent sphere the previous rung draws, with its equator collapsed to a point.

A panorama pivoted 60 mm behind its own pupilLooking down on 24 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 γ — 7.8 mm at 7.5° 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 14.86 mm.the pivottangent circle, 7.8 mmno single viewpoint — the rays miss by 14.86 mm24 frames · pivot 60 mm off
Fig. 9 Twenty-four frames. The tangent circle in the horizon plane has nearly gone; the sphere it belongs to has not, because the figure’s plan view cannot show the part of it that is above and below the page.

So the defect changes shape as the frame count rises. At two frames it is a horizontal doubling at the seam. At twenty it is a vertical disagreement between the top of one frame and the top of its neighbour, which reads as a slight shear of anything tall near a join rather than as a ghost.

Anybody who has stitched a room with a doorway in it has seen the second and not recognised it as the same defect, because it does not look like a doubling. It looks like the doorframe leaning.

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 16 frames, against how far away the object is, with the pivot 60 mm off the pupil. At 0.8 m it is 40 px and at 32 m it is 0.9 px. The second curve is the product of the two, which stays inside a factor of 1.077 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.01020304000.50011.50distance to the object being stitched (log₁₀ metres)ghost (px), and ghost × distance ÷ 4ghost × distance16 frames · pivot 60 mm offproduct flat to 1.077
Fig. 10 The ghost at sixteen frames, which is past the crossover. What the number here is measuring is the horizontal half, which has become the smaller of the two — so a reader who sees this figure alone would conclude the problem was nearly solved.

The same shape of answer, twice on this site

This is the second time this collection has found an error with two terms that behave differently, and the other one arrives from a completely different question.

A silhouette reconstruction has an error outside the convex hull that falls as one over the square of the view count, and an error inside a concavity that does not move at any count. Same structure: one term for sale, one not, and the useful engineering fact is which is which rather than how large either is.

One error term falls away and the other never movesThe two things a silhouette reconstruction gets wrong, on the same object, against how many views it was given. The falling curve is the area outside the convex hull that the views have not yet cut away: it goes as n raised to -1.995, fitted rather than asserted, so at 128 views it is 1.38e-4. The flat line is the notch — 0.1556 of area, 5.3% of the object — and it is the same number at four views and at a hundred and twenty-eight, because an outline is a pair of numbers per direction and no pair of numbers ever reaches inside a concavity. Only 85.1% of this boundary is ever on a silhouette from any direction at all.-4-3-2-111.502views taken round the object (log₁₀)area still wrong (log₁₀)the notch: 0.1564slope -1.99a notch of 60°one term for sale, one not
Fig. 11 The other instance, from the metrology field and with no camera pivot anywhere in it. One curve falls away and one line is flat, and the flat one is what the method cannot do rather than what it has not done yet.

The pattern is worth naming because it is the difference between a specification and a complaint. A quantity that falls with effort belongs in a shooting instruction; a quantity that does not belongs in the description of what the instrument is. Reporting them as one number — “the parallax is thirty-four millimetres” — hides which of the two a reader is looking at.

When an error has more than one term, measure whether each of them responds to the thing a user can change. A term that does is a setting; a term that does not is a property of the instrument, and calling both of them “the error” is what turns a design into a grievance.

What sets the floor in practice, and the number

The floor is esinβmaxe \sin\beta_{\max} and the two factors are independent, which means there are exactly two ways to lower it.

Move the pupil onto the pivot. That is the rail, and it is the only thing that removes the defect rather than reducing it — at e=0e = 0 both halves are exactly zero, which the control checks at the arithmetic floor rather than at a tolerance.

Or shoot shorter frames. That is a longer lens and more of them, and it costs shooting time and stitching area rather than hardware.

A panorama pivoted 0 mm behind its own pupilLooking down on 6 frames taken by turning a camera about a point 0 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 γ — 0.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 0.00 mm.the pivottangent circle, 0.0 mmthe rays meet at the pivot, exactlywhich is what a pivot on the pupil buys
Fig. 12 The control, and the only complete repair. With the pupil on the pivot every ray of every frame passes through it, and the figure prints a bundle that meets rather than the strip that says it has nowhere.

There is no third way, and in particular there is no post-processing way. A warp applied to a delivered panorama is a map from picture coordinates to picture coordinates; the defect is that different depths want different maps; and a map that does not know the depth cannot be the right one for two depths at once. That is the same argument a rig’s stitching depth makes with a real baseline instead of a mounting error, and it has an exact optimum there because the baseline is large enough that choosing a depth is the honest thing to do.

A rig's stitch is right on one surface and nowhere elseThe residual a rig's warp leaves, against depth, for three choices of the depth it was computed for: the harmonic midpoint at 2.86 m, the arithmetic one at 15.8 m, and one close in at 1.65 m. Each curve crosses zero exactly once, at its own stitching depth, and the crossing is the surface the picture is correct on. Everywhere else the same feature is drawn twice, or cut in half, by f·b·(1/z − 1/z₀) pixels — a disparity, so it is reciprocal in depth and the near end always costs more than the far one. There is no fourth curve that is flat.-500500.5001distance to the thing being stitched (log₁₀ metres)what the stitch leaves behind (px)2.86 m80 mm baselinezero at one depth each
Fig. 13 The general case, which the pivot error is a small instance of: a warp is right on one surface, and the residual everywhere else is a disparity.

Why this is not the rolling shutter’s problem

It is worth separating this from a defect it resembles, because both are about a frame not being one thing.

A rolling shutter reads its rows one after another, so a frame taken while the camera moves is a stack of projections indexed by height — the rays leave from wherever the eye was at that instant. The miss there is the spread of the eye’s own track, and it is zero whenever the world and the camera are still.

The pivot error is not conditional on anything moving. Its miss is esinγe \sin\gamma whether the shot is a thousandth of a second or an hour, and it is there in a picture of a stone building on a windless day.

Every row is a different camera, so a vertical is not verticalThree vertical poles at 6 m, imaged by a shutter that takes 33.3 ms to read its 300 rows while the camera crosses at 4.0 m/s. The pale lines are where a global shutter would draw them. The lean is 1.403° and the closed form — image speed × readout ÷ frame height — says 1.406°.0.0 ms8.3 ms16.7 ms25.0 ms33.3 mslean 1.403° drawn against 1.406° predicted · a still world leans 0.000°no single viewpoint — the rays miss by 33.3 ms of travelthe frame is a stack of projections indexed by row
Fig. 14 The defect that looks like this one and is not: a frame whose rows are exposed at different moments, whose miss is a property of the motion rather than of the mounting.

The two do compose, and unpleasantly: a rolling shutter on a badly-mounted camera has a miss that varies down the frame for one reason and across it for another. Neither figure on this site draws both at once, and the reason is that the sum would be a picture of two things nobody can separate by looking.

What this does not settle

It does not say the floor matters. On a landscape at a hundred metres, twenty millimetres of miss is a fifth of a milliradian and is under the lens’s own errors; on a table two metres away it is not. The floor is a length in the room and whether it matters is a division the scene performs.

It does not say the frame count is free. Sixty frames is sixty exposures and sixty registrations, and the registration itself has errors that grow with the count.

And it does not say a stitched panorama should be avoided. It says the thing being bought when frames are added, and where the buying stops — which is a specification, and is what the previous rung’s law is for.

Neither instrument is exact, and they are inexact in different thingsSix numbers on one arrangement: a 6-frame stitch with the pivot 60 mm off the pupil against a swing-lens camera, both delivering the same panorama, with a subject 1.4 m/s at 3 m. The swing lens has no parallax — exactly none, because it turns about its own pupil — and pays for it twice: 2.08 times less detail round the turn, and a 32 px shear on anything that moves, because its two ends are exposed a moment apart. The stitched camera's own motion failure is 956 px and is a different shape: a tear at the seam rather than a bend, because its frames are seconds apart rather than continuous. A shear is a picture of a distorted subject; a tear is a picture of no subject.stitched · parallax at the seam26swing lens · parallax0stitched · detail, px per degree100swing lens · detail, px per degree48stitched · a moving subject, torn1410swing lens · a moving subject, sheared686 frames · pivot 60 mm offdetail ratio 2.08×
Fig. 15 And the instrument that has neither half, because it turns about its own pupil. What it pays instead is the next rung.
Curving straight lines and having no centre are two different thingsThe rms miss of the best single centre, for two cameras that both draw straight world lines as curves. A rotating eye keeps its centre exactly — 2e-15 m, which is the solver's noise floor. A translating eye has none: 7.97 m over 27 m of track. A panorama is a projection and a scroll is not, and no amount of looking at the curves tells them apart.a rotating eye — the panorama2e-15 ma projectiona translating eye — the scroll7.97 mnot oneboth of these draw a straight world line as a curverms miss of the least-squares centreone of them is a projection
Fig. 16 The premise underneath all of it. A rotating eye keeps its centre exactly however far it turns — which is true of the pupil and is not what the tripod is turning.
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. 17 Twelve frames. The tangent circle in the horizon plane has halved and the sphere it belongs to has not, because the plan view cannot draw the part of it above and below the page.
The rays of a refracted picture, continued into the waterEvery ray leaves the pinhole, bends at the surface and carries on. Fitted to a common point they miss it by 22.7 mm — the circle is that miss drawn at the figure's own scale. With the water removed the same fit misses by 0e+0 m.the water surfacethe pinholethe rays miss by 22.7 mmno single viewpoint — the rays miss by 22.7 mmdry control: 0e+0 m
Fig. 18 The measurement in its original setting, from the refraction field: a bundle continued into water, missing its own least-squares centre by millimetres. Same solver, same currency, a different reason for the miss.

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.

Named objects

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

centre of projectionDemonstrationEntrance pupilfield of viewFree parameterinstrument limitPanoramaParallaxPicture surfaceStitching