Surfaces that are not flat

How well the floor has to be known

“Supply the surface” is an instruction with no number in it, and an instruction with no number is a wish. Here is the number: the error in the recovered design is very nearly proportional to the error in the assumed curvature — the constant varies by 1.4% across a twentyfold range — so about nine parts in a thousand of the curvature buys one millimetre on a design 1800 mm wide, and 40% out costs 43.5 mm.

Worth reading first: Undoing a picture made on a curve.

The recovery in the previous rung needs the floor, and knowing the floor makes it exact. That is a satisfying result and it is not usable, because nobody knows a floor exactly. A plan is drawn to a tolerance; a survey has an error bar; a laser scan has noise. The instruction “supply the surface” is a wish until it says how well.

This essay answers that. The shape is taken as known — a ridged floor, curving one way and flat the other — and the parameter that says how much it curves is deliberately got wrong by a stated fraction. What comes back is a number a specification can be written from.

How well the floor has to be known, in per centThe recovery is told a curvature that is wrong by a stated fraction, and the worst recovered mark is measured. The line through the origin is very nearly straight — the error per unit of misknowledge varies by 1.4% across a twentyfold range — so a tolerance can be quoted: 0.91% of the curvature buys 1 mm on a design 1800 mm wide.025507510010203040how wrong the assumed curvature is, as a % of the true oneworst error in the recovered design (mm)0.91% buys 1 mma a ridged floor, k = 0.0644.0 mm at 41% out
Fig. 1 The recovery told a curvature wrong by a stated percentage, against the worst error in the recovered design. The line through the origin is very nearly straight, and the marked crossing is where the error reaches a millimetre.

The measurement

The setup is the one from the previous rung, unchanged: a rectangular grid painted on a ridged floor with a flexible rule, photographed, and recovered by ray-tracing back through the surface into the surface’s own coordinates.

One thing changes. The recovery is told a curvature kk' instead of the true kk. Everything else — the camera, the marks, the shape of the floor as a family — is right.

The results, as a fraction wrong against the worst recovered mark:

curvature wrong by worst error
2% 2.21 mm
5% 5.51 mm
10% 11.00 mm
20% 21.92 mm
40% 43.51 mm

Divide each error by its fraction and the four quotients are 110.3, 110.2, 110.0, 109.6 and 108.8 millimetres per unit of relative error. Across a twentyfold range of misknowledge the constant varies by 1.4%.

So the rule is a proportion, and it is worth writing down in the form a specification takes: the design’s worst error is about 110 mm times the relative error in the curvature, for this floor at this camera and this design size.

The tolerance

Turn it round. To recover a design to one millimetre on a floor 1.8 m across, the curvature has to be known to 0.91%.

That is a demanding number and it is worth sitting with. It is not one per cent of the height of the floor — the ridge here rises about nine centimetres over the patch — it is one per cent of the coefficient that sets that height. Nine parts in ten thousand of a metre, roughly, in the sag itself.

Which means a plan drawn “flat, with a slight fall to the drain” supplies nothing usable. A survey to the nearest centimetre supplies nothing usable. What is needed is either a real measurement of the surface at millimetre accuracy, or a way of fitting the surface from the same photograph — which is possible when the scene contains enough known geometry, and is the honest route when it does.

How well the floor has to be known, in per centThe recovery is told a curvature that is wrong by a stated fraction, and the worst recovered mark is measured. The line through the origin is very nearly straight — the error per unit of misknowledge varies by 2.3% across a twentyfold range — so a tolerance can be quoted: 0.55% of the curvature buys 1 mm on a design 1800 mm wide.025507510010203040how wrong the assumed curvature is, as a % of the true oneworst error in the recovered design (mm)0.55% buys 1 mma a ridged floor, k = 0.171.7 mm at 41% out
Fig. 2 The same measurement on a floor that curves nearly twice as much. The tolerance is quoted as a fraction of the curvature, so it is nearly unchanged — which is the useful form, because it does not have to be re-derived for each floor.

Why the line is straight

The proportionality is the result, and it should not be taken for granted, because nothing in the chain that produces it is linear.

The recovery composes a ray with a root-find against a height field with an inverse arc-length integral. The arc length is a hyperbolic sine; the root-find is a bisection on a quadratic; the perspective divide is a reciprocal. None of those is linear in kk, and the composition of three nonlinear maps has no business behaving like a straight line over a twentyfold range.

It does, and the reason is a first-order argument that is worth having because it says when the straightness will fail.

The recovered design point is a function D(k)D(k'), and the error is D(k)D(k)D(k') - D(k). Expand about the true curvature:

D(k)D(k)  =  Dk(kk)  +  O ⁣((kk)2).D(k') - D(k) \;=\; \frac{\partial D}{\partial k}\,(k' - k) \;+\; O\!\left((k'-k)^2\right).

The linear term dominates as long as the second-order term is small, and the second-order term is small as long as the fractional change in curvature is small compared with the scale on which D/k\partial D/\partial k itself changes. Here that scale turns out to be large — the derivative varies by a per cent or so over a 40% change — so linearity survives much further than a first-order argument usually earns.

The measured spread of 1.4% is the second-order term, seen. It is not zero and it is not noise: it is the curvature of the sensitivity curve, and it grows as the misknowledge does, which is exactly what the expansion predicts.

What one pixel of click error costs, against distanceA 1.80 m object at 3 m is measured to 0.28% per pixel; the same object at 201 m to 18.5% per pixel. The whole object shrinks toward the horizon, so a pixel buys more world.05101550100150200distance from the camera (metres)error in the recovered height, per pixel of click error (%)4 m — 0.38%12 m — 1.11%40 m — 3.68%120 m — 11.02%one pixel, on a 690 px picturelinear in distance
Fig. 3 The same kind of statement from the measuring field, where it is the standard form of an answer. An error in the picture, propagated to an error in the world, with a constant that says what a pixel costs — and the constant, not the error, is the thing worth quoting.
A 5.6 m object, measured off an uncorrected frameOn a pinhole picture the horizon-fraction recovery returns 5.6 m exactly. Through a lens with k₁ = -0.30 it returns 5.44 m — 2.79% out. A 2.2 m object at the same spot on the same lens comes back 0.18% out, because what costs is the radius the three marks span, not where in the frame they are.4.064.084.10-0.400-0.2000k₁ of the lens the photograph was taken withheight recovered from the photograph (m)the true 4.1 m4.07 m4.1 m tall, 11 m away, on a level camera0.63% out — against 0.18% for a 2.2 m object
Fig. 4 And the same again in the lens field: an uncorrected distortion coefficient turned into a height error, linear over the range that matters and quoted as a rate.

What the constant depends on

A number like “110 mm per unit of relative error” is only useful with its conditions attached, so here they are, in the order they matter.

The size of the design. The error scales with it, near enough, because a fractional change in the surface displaces points in proportion to how far along the surface they are. Doubling the patch roughly doubles the worst error, and the tolerance halves.

How obliquely the floor is seen. A camera looking almost along the floor sees a given displacement of the surface as a large displacement in the picture; a camera looking down at it sees a small one. The recovery inherits that, and the sensitivity is worst at grazing incidence — which is the same geometry that makes a grazing view bad for every other measurement here.

How much the floor curves. Quoted as a fraction, the tolerance is nearly independent of it, which is why the fraction is the right form. Quoted as an absolute error in kk, it is not.

And not the number of marks. This is the one worth stating explicitly. The error above is systematic: every mark is displaced in the same smooth way by the same wrong surface. Averaging over more marks does nothing, because they are all wrong in the same direction. That is the distinction between a bias and a noise, and only one of them is bought off by more data.

One photograph of one floor, undone three waysThe design is 1800 mm across. Knowing the surface returns it exactly — nothing is fitted, so there is no residual to report beyond arithmetic. Assuming the floor is flat is exact at the four marks the homography was given and 111 mm out elsewhere. And knowing the shape but getting its curvature 20% wrong costs 21.9 mm, which is the price of the parameter rather than of the shape.what the recovery was toldworst error in the recovered designthe surface, known1.1e-12 mmassumed flat, four marks110.97 mm6e-13 mm at the fourthe surface, curvature 20% out21.92 mma a ridged floor, k = 0.06, design 1800 mm wide1e-12 mm · 111 mm · 21.9 mm
Fig. 5 The three levels with the curvature 20% wrong, so the middle row is a real number rather than a rounding. The flat fit is still worst; the misknown curvature costs a fifth of what the flat assumption does at this size.

The measurement’s own controls

A sensitivity curve is easy to produce and easy to produce wrongly, so it is worth saying what the machinery checks before reporting one.

The exact case has to land at zero. Told the true curvature, the recovery must return the design at arithmetic noise. If it did not, every point on the curve would be sitting on top of an offset that had nothing to do with the misknowledge, and the proportionality would be an artefact of it.

The tolerance has to be bracketed rather than solved. The crossing where the error reaches a millimetre is found by bisection between a fraction known to be inside and one known to be outside, and both ends are asserted before the bisection starts. A bisection whose bracket was never checked returns an endpoint and looks like an answer.

And the misknowledge has to cost something. The smallest fraction tested — two per cent — must produce a non-zero error. A recovery that ignored the curvature it was told would give a flat line at zero and would satisfy the linearity test perfectly.

Those three are the same shape as every measurement here: the thing that should be zero, the thing that should not, and the bracket that keeps the search honest.

The comparison worth making

There are three ways to be wrong about the floor, and putting the numbers side by side changes what is worth spending effort on.

Assume it is flat: 111 mm.

Get the curvature 40% wrong: 43.5 mm.

Get the curvature 10% wrong: 11.0 mm.

So knowing the shape — that it is a ridge rather than a plane — is worth more than knowing the parameter to any reasonable accuracy. A recovery that has the family right and the coefficient badly wrong beats one that has no family at all, by a factor of two even at 40% out.

That ordering is not obvious and it is practically useful. The expensive part of a survey is measuring the surface accurately; the cheap part is establishing what kind of surface it is. The cheap part buys most of the improvement.

What the receiving surface costs a four-point fitThe same lamp and the same occluder, cast onto four surfaces. Four marks of the shadow are matched to four known points of the occluder, the map they determine exactly is built, and the other sixty-eight points are predicted by it. On the plane the prediction is right to 3e-13 mm; on the others it is not, and the fit is still exact at the four everywhere — 2e-13 mm — which is what makes the rest a prediction rather than a residual.a flat floor3e-13 mma homology — four points determine ita dished floor8.40 mmnot a homologya ridged floor13.23 mmnot a homologya floor with a step153.57 mmnot a homologyworst error of the predicted pointsexact at the four fitted, on every surface
Fig. 6 And the reason the shape matters so much more than the parameter. These four floors fail a four-point fit in ways that differ by an order of magnitude between them, and the differences are between shapes rather than between amounts of curvature.

The other error that is not on this plot

Everything above holds the camera fixed and the marks perfect. Two other errors sit on top of it and it is worth knowing their sizes relative to this one, because a specification that controls the smallest of three is not a specification.

The camera. The first step of the recovery is picture-to-ray, and it needs the focal length, the principal point and the pose. An error in the focal length tilts the whole bundle of rays and moves every recovered point; an error in the pose translates and rotates the recovered design. Those are recoverable from the same photograph in favourable scenes and are a genuine error source in unfavourable ones, and unlike the surface error they are partly cancelled by the four-mark registration that a design usually has anyway.

The marks. A mark located to within a pixel produces a recovered position uncertain by whatever a pixel is worth on the floor at that distance — which, for a floor photographed from three metres with a moderate lens, is a millimetre or two. That is the same order as the tolerance derived above, which is a useful coincidence: it says the surface should be known well enough that it stops being the limit, and no better.

That last sentence is the practical form of the whole essay. Match the tolerances. Knowing the floor to a tenth of the pixel-noise limit buys nothing; knowing it to ten times worse throws away the picture’s own accuracy. Nine parts in a thousand is where those two meet for this design at this range.

Where the model itself runs out

Everything above assumes the family is right — that the floor really is a ridge of some curvature, and only the curvature is unknown. That assumption has its own failure and it is not on the plot.

If the floor is a ridge plus something else — a local dip, a settled slab, a rise near a wall — then no value of kk recovers the design, and the sensitivity curve says nothing about how wrong the answer is. The residual after fitting the best kk would say, but there is no residual: the recovery is exact by construction whatever kk it is told, so it produces a confident answer for every value.

That is the most dangerous property of the whole method and it deserves stating plainly. An exact recovery has no residual, so it cannot report that its model was wrong. The flat four-point fit, for all its 111 mm, at least leaves a residual that grows when the floor is not flat. The exact recovery leaves none.

The repair is the one the previous rung ends on: hold marks back. Recover the design from the surface, then check a mark whose position in the design is independently known. That comparison is the only thing in the chain capable of reporting a wrong model, and it costs one mark.

A rectangular grid, painted on a ridged floor and photographedEvery mark is where a flexible rule laid along the floor would put it, so the grid is exactly rectangular on the surface and exactly 1800 × 1200 mm when the floor is unrolled. Undone with the floor known, the design comes back to 1.0e-12 mm. Undone by a homography fitted to the four ringed marks — which is what a rectification tool does — it is exact at those four and 166 mm out at the worst of the others.166 mm outcorrect from 21 cm, at 160 mm wide1e-12 mm with the floor · 166 mm without
Fig. 7 The picture the check is made on. The four ringed marks are the ones a fit is given; every other mark is a place where a wrong surface — of the wrong shape or the wrong curvature — shows up as a displacement, smooth and one-sided rather than scattered.
The valley two distortion coefficients sit ink₁ and k₂ are recovered exactly from clean data and are correlated at -0.996. Walking away from the fit along the stiff direction costs 17.5 px of straightness; the same walk along the soft direction costs 1.17 px. The ratio of the two curvatures is 707.051015-0.200-0.10000.1000.200distance from the fitted coefficients, along each directionstraightness residual (px)stiff directionsoft directioncondition number 707k₁ and k₂ correlate at -0.9964
Fig. 8 The neighbouring problem, where the model is fitted and the residual does report. Two distortion coefficients recovered from straightness alone, with the valley they sit in — and a long flat floor to that valley is what “poorly determined” looks like when there is a residual to see it in.

Two floors, and why the fraction is the right unit

It is worth checking the claim that the tolerance is naturally a fraction rather than an absolute amount, because it is the difference between a rule that transfers and one that does not.

On a floor curving at k=0.03k = 0.03 — a very gentle fall — a millimetre of design costs 1.77% of the curvature. On a floor at k=0.10k = 0.10, four times steeper, it costs 0.55%. Those are not the same fraction, so the fraction is not perfectly transferable either; but the absolute tolerances differ by a factor of five while the fractional ones differ by three, and the fractional one moves the right way.

The residual dependence has a cause worth naming. A gentler floor is not simply a scaled version of a steeper one, because the camera stays where it is. Halving the curvature halves the displacement a given fractional error produces on the floor, and it also changes how obliquely the floor is seen, and the two do not cancel. So the fraction is the better unit and it is not a complete answer; the honest form of the rule carries the design size and the viewing geometry with it, which is what the specification at the end does.

There is a broader lesson in that, and it is a habit rather than a result. A tolerance quoted without its conditions is a tolerance that will be applied to the wrong job. Every rate on this site is quoted with the geometry it was measured at, for the same reason, and the ones that transfer are the ones written as ratios of things that scale together.

A 1.8 m figure, drawn at every distance, by two systemsThe falling curve is a pinhole: f·H/Z, dropping -4.30 px per metre on average and 20.0× overall across the range. The flat one is an oblique system, whose slope is 0e+0 px per metre — zero, not nearly zero. A system with no diminution has no size–distance signal at all, so depth has to be carried by something else, and the something else is where the figure stands on the page.0100200204060distance of the object, metresits drawn height, pxa pinholean oblique systemdrawn height of a fixed object against its distance20.0× against 1.000
Fig. 9 The scaling that does transfer, from the field where it is exact. Angular size against distance is a pure reciprocal, and a rule written in those terms needs no conditions at all — which is what a transferable tolerance looks like when one is available.

A specification, written out

The point of a sensitivity is that somebody can act on it, so here is the result in the form a job would be written.

To recover a design of extent LL on a ridged floor to an accuracy ε\varepsilon, photographed at a moderate angle, the floor’s curvature must be known to a relative accuracy of about

δkk    ε0.06L.\frac{\delta k}{k} \;\approx\; \frac{\varepsilon}{0.06\,L}.

For L=1.8L = 1.8 m and ε=1\varepsilon = 1 mm that is 0.9%, which is the measured figure. For a 6 m floor and the same millimetre it is 0.3%. For a 6 m floor and a 5 mm tolerance it is 1.4%, which is achievable with an ordinary survey.

Three cautions come with it, and each is a section above compressed to a line. The number is a bias and does not improve with more marks. It assumes the family of surfaces is right and says nothing if it is not. And it is quoted at a moderate viewing angle; at grazing incidence it gets worse, in the same way every other measurement on this site does.

How well the floor has to be known, in per centThe recovery is told a curvature that is wrong by a stated fraction, and the worst recovered mark is measured. The line through the origin is very nearly straight — the error per unit of misknowledge varies by 1.4% across a twentyfold range — so a tolerance can be quoted: 1.77% of the curvature buys 1 mm on a design 1800 mm wide.025507510010203040how wrong the assumed curvature is, as a % of the true oneworst error in the recovered design (mm)1.77% buys 1 mma a ridged floor, k = 0.0322.5 mm at 41% out
Fig. 10 The same tolerance on a floor that barely curves at all. A gentler floor is not an easier one: the tolerance is a fraction of the curvature, and a fraction of a small number is a small number.
What reading a floor off its plan costs, on four floorsEvery rectification that treats a floor as flat is using the plan as the flattening. On the flat floor and on the step that is exactly right — both are planes, so the plan is the surface. On the ridge it stretches by 0.86%, and the ridge has an exact unrolling that does not; on the dish it stretches by 1.03%, and no flattening of a dish avoids it, because its curvature is 0.0144 per square metre and no bending removes that.floorwhat reading it off the plan stretchesavoidable?a flat floor0 — the plan is the surfacenothing to avoida ridged floor0.86%yes, by unrollinga floor with a step0 — the plan is the surfacenothing to avoida dished floor1.03%no, by anythingfour floors, k = 0.06only the dish has curvature — 0.0144 m⁻²
Fig. 11 And the reason the whole question is well posed for this floor and not for every floor. The ridge has an exact unrolling to be recovered; a dish has none, and there the question “how well must the surface be known” has no answer because there is nothing to be known well.

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.

Developableerror propagationGaussian curvatureHomographyinstrument limitleast squaresRay tracingRectificationSensitivitysingle-view metrology