Through water and glass

A fit weighted by the miss trusts only the surface

Weight each point of a reconstructed underwater stick by how well its two rays meet, and the fit hands all but a ten-billionth of its trust to the one point where the stick enters the water — and reports a residual of nothing at every rolled baseline. Floored at the reading error, the weighting changes the answer by a few thousandths of a millimetre. And the miss itself, the one honest number, is exactly zero at a level baseline where the stick comes back 285 mm short.

Worth reading first: What a ray does at a surface · Two rays that do not meet.

The residual does not warn fitted a straight line to the stick a stereo pair puts back when it looks into water, and found the fit’s residual running the wrong way. It was 0.535 mm at a level baseline, where the two rays to every point meet exactly, and fell to 0.038 mm at sixty degrees of roll, inside the band where the rays miss by more than a pixel can explain. Meanwhile the fitted line was 285 to 584 mm short of the stick’s metre. The one quantity that behaved was the rays’ own miss — zero at the two rolls whose reconstructions are real images, positive between them — and the essay closed by proposing to put it to work: weight each point of the fit by the inverse of its own rays’ miss, so that the fit trusts the points the rays agree about.

It is the obvious repair, and it is the kind of repair a careful pipeline actually makes. A third ray is worth what its picture is worth is the case for weighting an observation by what it is worth, and the miss looks like exactly the number that says what each reconstructed point is worth. The essay asked three things of the weighted fit: whether its direction comes closer to the stick’s, whether its residual falls where the miss falls, and what becomes of it at the two exact rolls, where every weight is infinite.

The answer to all three comes from one fact about where the miss is zero. It is worth establishing that fact first.

The miss is zero at the surface, at every roll

The miss is not scattered along the stick the way a matcher’s errors would be. It is a smooth function of the geometry, and it has a zero in a place that no roll of the baseline can move.

Along the stick the miss grows from nothing at the surface to 3.13 mm at the tipHow far the two rays to each point of a one-metre stick miss each other, against how deep the point is, for the baseline rolled 15, 30, 45, 60, 75 degrees from level. Every curve starts at exactly zero, because the point where the stick enters the water sends unbent rays to both eyes; every curve grows close to in proportion to depth, 3.86 mm a metre at 45 degrees with a departure from proportion of 0.21 mm; and of the rolls drawn only 45 degrees carries its deepest points past the 2.85 mm a pixel covers at this range. A weight that is the inverse of the miss is a weight that trusts the shallow end of the stick and distrusts the deep end, at every roll alike.0123020406080how deep the point is, cmhow far its two rays miss, mmone pixel, 2.85 mmrolled 15°rolled 30°rolled 45°rolled 60°rolled 75°a one-metre stick, thirty degrees into waterzero at the surface, every roll
Fig. 1 How far the two rays to each point of the stick miss, against the point’s depth, for five rolls of the baseline. Every curve starts at exactly zero at the surface and grows with depth; only the deepest points at forty-five degrees get past a pixel.

The point where the stick enters the water sends each eye a ray that crosses no surface on the way, so it bends nowhere and the two rays to it meet exactly. That is true at a level baseline, at an upright one, and at every roll between. Below the surface the rays bend, and bend differently for the two eyes, and the miss grows with the depth of the point. At forty-five degrees of roll it runs from nothing to 3.13 mm at the tip, 3.86 mm per metre of depth on average and within 0.21 mm of strict proportion; at fifteen and seventy-five degrees it grows half as fast.

So a weight that is the inverse of the miss is not a weight about individual points at all. It is a weight about depth — trust the shallow end, distrust the deep end — and it says the same thing at every roll. The curves differ in how steeply they climb, not in where they start.

The zero at the surface is not a feature of this stick or this pool. A point on a refracting boundary is the one point refraction cannot misplace, because a ray from it reaches the eye without crossing the boundary at all; it is reconstructed exactly by any pair of eyes, from any roll, at any index. Every object that breaks the surface carries such a point at its waterline, and every one of those points is, to a triangulation, the most trustworthy point in the scene. It is also the only point on the object whose position was never in doubt. The measurement that most wants a weight — how deep does this go, and at what angle — is the one the weight steers away from.

That is already enough to predict what the weighted fit will do, and the prediction is not the one the proposal hoped for.

Unfloored, one point takes all the trust

The inverse of zero is infinite, which is why the proposal itself said the weighting would need regularising. The plainest regularisation adds a floor in quadrature: weight each point by one over the miss squared plus a floor squared. A floor of a billionth of a metre is the literal proposal with the division by zero removed.

With no floor the point where the stick enters the water carries all but 2e-10 of the fitThe share of a weighted fit's trust each point of the reconstruction gets, with the baseline rolled 45 degrees and the weight the inverse of the miss squared plus a floor. With no floor the entry point, whose rays meet exactly, takes all but 2e-10 of the weight and the next point 1.4e-10 of the whole; the fit is a line pinned to the surface. With a floor of a tenth of a millimetre the entry point still takes 42.4 per cent. With the floor at the 2.85 mm a pixel covers, the shares run from 1.27 to 2.80 per cent against an even 2.04 — close to no weighting at all. The slider rolls the baseline, and at every roll between level and upright the unfloored weight goes to the entry point.10⁻¹²10⁻⁸10⁻⁴1020406080how deep the point is, cmshare of the fit's weightno floor0.1 mm floor2.85 mm floorbaseline rolled 45°, weight 1 / (miss² + floor²)no floor: one point
Fig. 2 The share of the fit’s weight each point of the stick receives at forty-five degrees of roll, for three floors. With no floor the entry point takes all but a ten-billionth of it; with a floor of a tenth of a millimetre it still takes 42 per cent; at a pixel the shares are nearly even. The slider rolls the baseline.

With no real floor, the entry point takes all but two ten-billionths of the fit’s weight. The next point down, a couple of centimetres into the water, has a miss of 0.09 mm and gets a hundred-and-forty-billionth of the whole. The fit is a line pinned to the one point where the stick enters the water, with its direction settled by points it trusts ten orders of magnitude less.

A floor of a tenth of a millimetre — small against the miss, which reaches three — spreads the weight, but the entry point still takes 42 per cent on its own. Only at a floor of the size of the reading error, the 2.85 mm a pixel covers at this range, do the shares come out near even: 1.27 to 2.80 per cent each, against the 2.04 an unweighted fit gives every point. A floor that large is below most of the miss, so the weights barely differ, and the weighted fit is close to no weighting at all.

There is no floor between these that is not arbitrary. Below the reading error the weighting prefers points for agreeing more closely than the pictures can measure; at the reading error it has nothing to prefer them for.

The weighted residual runs the wrong way harder

With the weights understood, the residual follows.

Weighted by the miss, the fit reports a residual of nothing at every rolled baseline and its old values where the rays meetThe residual a straight line leaves on the reconstructed stick, against the roll of the baseline, three ways. Unweighted it runs from 0.535 mm at a level baseline to its minimum of 0.038 at sixty degrees. Weighted by the inverse square of each point's miss with no floor, it is zero to 1e-8 m at every roll between level and upright, because all the weight goes to the entry point, and it jumps back to the unweighted 0.535 and 0.371 mm at the two rolls where the rays meet and every weight is equal. Floored at a pixel, it lies on the unweighted curve to within 0.003 mm. The rays' own miss, 1.94 mm rms at forty-five degrees, is the only curve that rises where the trouble is.00.50011.502020406080roll of the baseline, degreesmillimetresunweighted residualfloored at a pixelweighted, no floorthe rays' miss, rmsa one-metre stick, the baseline rolledthe weighting runs the wrong way harder
Fig. 3 The residual across the roll of the baseline, unweighted, weighted by the miss with no floor, and weighted with the floor at a pixel, beside the rays’ own miss. With no floor the weighted residual is zero at every roll between level and upright and jumps back to the old values at the ends.

Weighted with no floor, the residual is zero — under a hundred-thousandth of a millimetre — at every roll from ten degrees to seventy-five. A line pinned to one point and weighted almost entirely at that point leaves almost nothing unexplained, because almost nothing is being asked of it. At the two exact rolls, level and upright, the rays meet at every point, every miss is zero, every weight is the same, and the fit is exactly the unweighted one: 0.535 and 0.371 mm.

So the weighted residual is largest precisely at the two arrangements where the reconstruction is an honest image of something, and zero at every arrangement where it is not. That is the failure the residual does not warn measured, made total. The unweighted residual was merely smaller where the trouble was; the weighted one reports perfection there.

Floored at the reading error, the weighted residual lies on the unweighted curve to within 0.003 mm at every roll. Nothing is repaired and nothing is made worse; the weighting has simply been turned down until it does nothing. And the rays’ miss, root-mean-square over the stick, is still the only curve in the figure that rises where the rays disagree — 1.94 mm at forty-five degrees.

The floor decides the number

The two extremes are two answers, and between them is a dial.

The weighted residual climbs from nothing to the unweighted 0.214 mm as the floor rises through the miss itselfThe residual of a fit weighted by the miss, at 45 degrees of roll, against the floor added to the miss before it is inverted. Below a thousandth of a millimetre the fit is pinned to the entry point and reports 2e-4 mm. It passes half the unweighted value at a floor of 0.30 mm, inside the range the miss itself runs through, and at the 2.85 mm a pixel covers it reports 0.214 mm against 0.214 unweighted. Nothing on the way says anything about the reconstruction: the number reported is set by the floor chosen, and the only floor with a reason behind it gives back the residual that did not warn.10⁻⁴0.0010.010.111000.0500.1000.1500.200the floor under the miss, mmweighted residual, mmone pixelunweightedbaseline rolled 45°the floor decides the number
Fig. 4 The weighted residual at forty-five degrees of roll against the floor under the miss. It climbs from nothing to the unweighted 0.214 mm as the floor rises through the range the miss itself occupies, and at a pixel it is the unweighted value.

At forty-five degrees of roll the weighted residual climbs smoothly from nothing, at floors of a ten-thousandth of a millimetre, to the unweighted 0.214 mm at floors of a pixel and above. It passes half that value at a floor of 0.30 mm, which sits inside the range the miss runs through along the stick. The curve is smooth and monotone and has no feature at any floor that could be read as the right one.

That is the finding the proposal did not expect. A weighted residual is a number the analyst sets by choosing the floor, and at any floor it is a statement about how much the analyst chose to trust the surface. The one floor with a reason behind it — the reading error, below which a smaller miss is not evidence of anything — returns the residual that did not warn in the first place.

Weighting does not straighten the line either

The first thing the proposal asked was whether the weighted fit’s direction comes closer to the stick’s. Even a residual that warns badly would be worth something if the fit it came from were better.

Weighting moves the fitted direction by at most 0.26 degrees against an error of 10.4 to 14.3How far the fitted line's direction is from the stick's, against the roll of the baseline, unweighted and weighted by the miss. With no floor the weighted line is worse by up to 0.26 degrees at the shallow rolls and better by up to 0.22 at the steep ones; floored at a pixel it is within 0.022 degrees of the unweighted line everywhere. Against an error of 10.4 to 14.3 degrees, none of that is a repair: every point of the reconstruction is bent the same way, the trusted ones included.101214020406080roll of the baseline, degreesfitted direction off the stick, degreesunweightedweighted, no floorfloored at a pixela one-metre stick, the baseline rolled±0.26° at most
Fig. 5 How far the fitted direction is from the stick’s, across the roll, unweighted and weighted by the miss with and without a floor. The three curves lie within a quarter of a degree of each other against an error of ten to fourteen degrees.

It does not, by any amount that matters. With no floor the weighted line is up to 0.26 degrees worse than the unweighted one at the shallow rolls and up to 0.22 degrees better at the steep ones; with the floor at a pixel the two are within 0.022 degrees everywhere. The unweighted error over the same sweep runs from 10.4 to 14.3 degrees.

The reason is visible in the first figure. The points the weighting trusts are the shallow ones, and the shallow points are bent too — less than the deep ones, but in the same direction, because a straight stick in water is a kink and a curve: the reconstruction leaves the surface already 14.96 degrees off the stick at a level baseline, before any depth has accumulated. Choosing which bent points to trust chooses between bents. It cannot find the straight stick, because no point of the reconstruction is on it except the one at the surface, and one point has no direction.

The miss measures agreement, not accuracy

That leaves the miss itself, which every figure so far has treated as the honest number. It is honest. The question is what it is honest about.

The stick comes back 285 mm short where the rays miss by nothing, and 584 mm short where they also miss by nothingEach roll of the baseline as one point: how far the two rays to the stick's points miss each other, root-mean-square over the stick, against how far short of its metre the reconstruction comes back. The two rolls at which the rays meet exactly — level and upright — are the two ends of the range of error, 285 and 584 mm short, both at a miss of zero. Between them the miss rises to 1.94 mm and falls again while the shortfall climbs steadily with the roll. The miss says whether the two eyes agree, and the two eyes agree perfectly about two different wrong sticks.020040060000.50011.502how far the rays miss, rms over the stick, mmhow far short the stick comes back, mm10°20°30°45°60°75°90°level: rays meetupright: rays meetone point per roll of the baselineagreement is not accuracy
Fig. 6 Each roll of the baseline as a point: how far the rays miss, root-mean-square over the stick, against how far short the stick comes back. The two rolls where the rays meet exactly are the two ends of the range of error, 285 and 584 mm short.

Plot each roll as one point, the miss across and the shortfall up, and the two rolls where the rays meet exactly are the two extremes of the error. A level baseline returns the stick 285 mm short at a miss of zero; an upright one returns it 584 mm short at a miss of zero. Between them the miss rises to 1.94 mm and falls again while the shortfall climbs steadily from one end of the range to the other. There is no relation between the two quantities to exploit, because they are measuring different things.

The miss measures whether two eyes agree. At a level baseline they agree perfectly, and what they agree on is the sagittal image of the stick — a real image, formed by rays that genuinely meet, and a real image of the wrong thing. A point under water has two depths is about why there are two: the rays from one point pass through two focal lines, and a pair of eyes side by side reads one while a pair one above the other reads the other. Both are consistent. Both are wrong.

So the miss can say that a reconstruction is a compromise between two images; it cannot say that either image is right. At the two rolls where it is zero, nothing available to the pair — not the miss, not the residual, not any weighting of one by the other — distinguishes the reconstruction from a real stick of a different length and lean. What would is information from outside the two pictures: the index of the water, a third view from a different height, or the known length of something in the scene.

What a pipeline can do with the miss

None of that makes the miss useless. It changes what it is good for.

It is a flag, not a weight. A miss larger than the reading error says, point by point, that the two rays do not come from one place, and that the reconstruction there is a compromise nothing in the scene supports. That is worth reporting beside every reconstructed point, and the midpoint is a choice of ruler already argued that a midpoint which discards it has thrown away the evidence that the question was ill-posed. What the miss cannot be is a weight that repairs the fit, because the points with the smallest miss are not the most accurate ones; they are the shallowest.

Its zero is not a certificate. A reconstruction whose rays meet everywhere is consistent, and a consistent reconstruction through water is a real image — the sagittal stick or the tangential one. A pipeline that reports “rays meet, residual small” for a level stereo rig looking into a pool is reporting the truth about the rays and nothing about the pool.

And the fix for refraction is refraction. Every number in these essays is the water’s; the residual does not warn ran the identical reconstruction in air and got the stick back to 4×10134\times10^{-13} m. A triangulation that traces each ray through the surface with the water’s index has no miss to weight and no compromise to fit, and the reconstruction is exact. The repair is not a better statistic applied after the geometry is wrong. It is the right geometry.

Where this reading stops

The surface is flat and known. Every ray here crosses one level surface of water whose height is given. A wavy surface has no fixed entry point and a miss that is not zero anywhere, and the pinning found here would not happen in that form — though the weights would still sort points by how the surface happened to bend their rays, which is not accuracy either.

The floor is added in quadrature. Other regularisations exist — a cap on the weight, a weight that falls off with the miss rather than dividing by it — and each chooses a different curve through the dial in the fourth figure. None was measured, and nothing about their construction suggests any would find the straight stick when every trusted point is bent.

The stick is in the plane through the eye. As in the two essays before this one, the stick leans directly away from the eye, which is what gives the two exact rolls their symmetry. A stick turned out of that plane has no exact roll and no zero miss except at the surface, so the extremes of the missvserror figure would not exist; the pinning at the surface would.

And one stick. A fit to many sticks at once — a floor, a grid, a scene — would carry many entry points, one per object, each with a zero miss. A weighting by the miss would then pin the fit to the waterline of every object in view, which is a picture of the surface rather than of anything below it.

The weighted fit, weighed

The miss between two rays to a submerged point is zero at the surface at every roll of the baseline and grows with depth, so weighting a fit by its inverse is weighting by depth. With no floor the entry point takes all but two ten-billionths of the trust and the weighted residual is zero at every rolled baseline, returning to the unweighted 0.535 and 0.371 mm only where the rays meet exactly — the failure the residual already had, made total. With a floor at the reading error the weighted fit is the unweighted one to 0.003 mm, and between the two the reported residual is whatever the chosen floor makes it.

The weighted direction is within a quarter of a degree of the unweighted one against an error of ten to fourteen degrees, because every trusted point is bent the same way as the distrusted ones. And the miss itself is zero at a level baseline where the stick is 285 mm short and at an upright one where it is 584 mm short. It measures whether two eyes agree, and two eyes agree perfectly about two different wrong sticks.

Still open: whether a third eye at another height breaks the agreement

The two exact rolls are exact because each pair of eyes lies in one of the two families of planes the refraction is symmetric about. A level pair reads the sagittal image and an upright pair reads the tangential one, and each pair is perfectly consistent with itself. The two images disagree with each other by hundreds of millimetres.

A third eye placed off both families — above and to the side of a level pair — sees the stick through rays that belong to neither image, and its ray to each point would miss the level pair’s reconstructed point by an amount the pair alone cannot see. A third ray is worth what its picture is worth measured what a third view buys in air, where every ray meets.

The measurement that follows adds a third camera at a stated offset above a level pair, reconstructs the stick from the pair as before, and asks how far the third camera’s rays miss the pair’s points: whether the disagreement grows with depth the way the pair’s own miss does between the exact rolls, how large an offset it takes before the third ray’s miss crosses the reading error at the tip, and whether the third camera’s miss is larger where the pair’s error in length is larger. If it is, a third eye turns the pair’s perfect agreement into a measurable disagreement, and a rig can detect that it is looking through water without being told.

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.

Baselineleast squaresMidpointRefractionResidualskew raysStereo pairTriangulation