A water surface's height trades against its index
Worth reading first: What a ray does at a surface · Two rays that do not meet.
A third eye sees the water the pair cannot put a camera ten centimetres above a level stereo pair looking at a stick half under water, and found that the three rays to each point, read as if in air, disagree by pixels where the pair’s two agreed exactly. Told that there is a flat surface where the water is, and asked for the index, the three eyes found 1.333 — the index of water — and put the metre-long stick back at a thousand millimetres; read to a quarter of a pixel, the index came back as 1.336 ± 0.059.
That fit was given the surface. A rig looking into a tank can see the surface’s rim and place it; one looking into a pond, or at a river bed through moving water, has to find the surface from the same pictures it is trying to correct. The essay ended by pointing out that raising the surface and weakening the index do similar things to a ray — both change where a bent ray goes as it deepens — and asking whether three eyes, which see the stick at several angles through the surface, can tell them apart.
They can, in principle, and badly in practice.
The valley the two lie in
The rig is the earlier essay’s, and the bending at the surface is the one what a ray does at a surface set out: a level pair 65 millimetres apart 1.6 metres above the water, a third eye raised a hundred millimetres above their middle, a metre-long stick leaning thirty degrees under the surface two metres out, eight points along it. Each eye’s reading of each point is a direction in air. Read with an assumed surface height and an assumed index, every direction becomes a ray that meets the surface at that height and bends there by that index; the three bent rays to each point are brought as close together as they will go — where exactly is the choice the midpoint is a choice of ruler examined, made here by angle at each eye — and how far each misses, as an angle at its eye, is the disagreement. At the true surface and the true index, with exact readings, the disagreement is exactly nothing.
The disagreement is zero at one place and small along a line through it. A surface assumed higher than it is meets every ray sooner, so the rays turn downward sooner; an index assumed weaker turns them less; and for points under the surface a moderate distance away the two changes nearly cancel. The dashed curve marks the floor of the valley, and it runs from an index of 1.2 with the surface ten centimetres high to an index of 1.5 with it several centimetres low.
The ellipse is what a quarter of a pixel of reading error makes of that. Linearised at the truth, the fit’s own curvature says the index is known to ±0.143 and the surface’s height to ±48 millimetres, and the two are correlated at −0.85: the ellipse is long and lies in the valley. The same readings, told the surface, give the index to ±0.075, which is consistent with the earlier essay’s ±0.059 from twelve points; told the index, they give the surface to ±25 millimetres. Freeing the second unknown costs each of them about a factor of two, and it costs it along one particular line.
Why the valley exists
The trade is the geometry of a flat surface, and it has the same shape as the one a pair of eyes met in air at the start of this sequence. A point under water has two depths found that the rays from a submerged point to an eye pass through the surface at a point whose depth below it scales the image, and the scaling depends on how steeply the ray arrives: a steep ray’s image is lifted by about one over the index, a shallow ray’s by less. Raising the surface lifts every point’s crossing by the same amount; weakening the index lifts steep and shallow rays by different amounts. For the two to be told apart the rig has to see the water at angles that differ enough for their different lifts to show.
Three eyes a hundred millimetres apart, two metres from a stick, see each point at nearly one angle, the angle a straight stick in water is a kink and a curve found shaping the whole of the stick’s image. That is what makes the ellipse long. The directions from which the eyes see the stick differ by a few degrees at most, and the only spread of angles in the whole reading comes from the stick’s own depth — its tip seen more steeply than its top — which is a spread of angles in one plane over a metre of stick. The remedy the earlier essay proposed was a second stick at a different distance, seen through the surface at a different angle.
A second stick, further out
The second stick helps in proportion to how differently it is seen. Standing a metre out, where it is seen more steeply than the first, it brings the surface’s spread from 48 millimetres to 42; at two and a half metres, just beyond the first, to 27; at four metres to 15, at six to 9.5 and at eight to 7.6. The correlation between the index and the height falls from −0.85 to −0.42, so the ellipse is not only smaller but rounder. The index improves less — from ±0.143 to ±0.080 — because each stick’s points still see it through a narrow range of angles; what the second stick adds is a second slope of the valley.
The reason is the one the previous section gave. A stick eight metres out is seen through the surface at a grazing angle, about eleven degrees above it from a 1.6-metre eye, where the index bends a ray far more than it does the first stick’s steeper rays. A surface assumed too high then moves the two sticks’ images in proportions no single index can reproduce. More sticks at other distances continue the effect: with sticks at two, four and six metres the linearised spread of the surface is ±8.5 millimetres.
What the fits actually do
The ellipses are what a linear model of the fit promises. The fit itself is not linear, and the valley is curved, and the difference shows as soon as the readings carry real error.
The forty fits from one stick do not scatter about the truth. They lie along the valley, and mostly on one side of it: the index averages 1.257, well below water’s 1.333, and the surface averages 69 millimetres above where it is. The spread is about what the ellipse promised — ±0.127 in index — but the cloud’s centre has slid a large part of that distance down the valley. With a second stick four metres out the spread of the surface falls to ±35 millimetres, as the second stick promised, and the slide does not go away: the index averages 1.191 and the surface 50 millimetres high.
The slide is not a feature of a quarter of a pixel. At every reading error from a twentieth of a pixel to a quarter, the index comes back low by between 37 and 53 per cent of the spread the fit reports for itself, and the surface high by a matching amount — four millimetres at a twentieth of a pixel, sixty-nine at a quarter. It grows with the reading error a little faster than the spread does. A fit that quotes its curvature as its uncertainty is therefore always between a third and a half of an uncertainty off, and always on the same side — the shape of failure the residual does not warn met in the pair, where a confident fit reported nothing of its own bias; at 0.3 pixels one rig in forty runs off down the valley altogether and reports an index of 159.
The cause is the valley’s curvature. Noise moves each fit off the truth in a random direction, the fit then settles on the valley’s floor, and a curved floor is closer, on average, on its gentler side. The shape of that bias could be computed and subtracted — it is a property of the rig and the scene, not of the readings — but a reader who does not know it is there, and takes the fit’s reported uncertainty at face value, is wrong in a consistent direction.
What a better matcher buys
A quarter of a pixel is a careful reading of a well-lit edge. A good matcher on a textured stick does better, and the question is whether the slide is a problem only for rough readings.
It is not, though it shrinks. At a tenth of a pixel the one-stick rig’s index is promised to ±0.057, and it comes back 0.024 low on average, with the surface 11 millimetres high; at a twentieth of a pixel, ±0.029 promised and 0.011 low, the surface 4 millimetres high. The slide falls with the reading error, as every error does, but it falls no faster than the spread, so it stays at a third to a half of it. A rig five times more precise than this one has a slide about seven times smaller and a spread five times smaller, and is still more than a third of its own uncertainty off.
That is the property worth remembering. An error that scales with the spread is not rescued by precision: it can only be removed by changing the estimate — subtracting the slide, which a simulation of the rig can compute, or fitting fewer nuisance numbers, or holding one of the two unknowns from outside.
What the slide costs a length
The quantity the rig was built for is the stick, and the valley’s slide reaches it directly: a surface fitted too high with an index fitted too weak puts every point too shallow, and the stick comes back short.
With both the index and the surface fitted from the stick itself, the metre comes back 881 ± 182 millimetres — short in the way a miss-weighted fit trusts the surface found a fit short when it leaned on the wrong part of the stick: short by the slide and scattered by more than the earlier essay’s surface-known rig. Adding the second stick shrinks the scatter to ±117 and deepens the shortfall, to 792: the second stick’s shallow rays pull the index weaker still, which matters to the first stick’s length. The surface-known rig of the earlier essay, reading eight points instead of twelve, gives 988 ± 129 from one stick; with the second stick added it too is pulled short, to 925 — the grazing rays bias the index even when the surface is given, which the linear figures did not show and which was not derived here.
Holding the index at water’s 1.333 and fitting only the surface is better than all of them: 994 ± 85 millimetres, with the surface placed at 8 ± 23 millimetres from one stick and 7 ± 17 from two. That is the practical answer for water. The index of clear fresh water is known to the third decimal from its temperature, and a rig that trusts it has one unknown, the surface, which three eyes place to a couple of centimetres, and a stick that comes back to within a centimetre of its length on average.
When the index is the unknown
The trade matters when the liquid is not water — a brine of unknown strength, an oil, a syrup, a tank of some reagent — or when the surface carries a film, or the rig is calibrated for air and does not know what it is looking into. Then the index is a real unknown and so, unless its rim can be seen, is the surface.
For that case the measurements give a procedure and a warning. The procedure: see the liquid at as wide a range of angles as possible, which in practice means objects at very different distances — a stick near the rig and one far across the pool, seen almost edge-on through the surface — since that is what separates a raised surface from a weaker index. The warning: even then the fit slides, and the slide is a third to a half of the reported uncertainty in the direction of a weaker index and a higher surface. A length rebuilt from such a fit is short, and the shortfall should be expected rather than discovered.
The stick a stereo pair puts back found the level pair’s error systematic: 285 millimetres short, with no scatter, and no way for more readings of the same kind to reveal it. The earlier essay traded that for a random error by adding a third eye and a known surface. Freeing the surface brings a systematic error back, smaller and of a different kind — not the geometry’s blindness but the estimator’s curvature — and it can be removed, by the same move that removed the first: bring in what is known from outside the pictures.
What a rig should report
The measurements suggest a form for the answer that is more useful than a pair of numbers. What three eyes actually determine from one stick is a line — the valley — along which the index and the surface’s height may lie, and a short distance along it. Reported as a point with an ellipse, that answer invites a reader to trust the point; reported as the valley, it invites the reader to bring in whatever fixes a position along it.
For water, the index fixes it. For a tank with a visible rim, the rim fixes the height. For a pool whose far edge is in the picture, a second object seen at a grazing angle narrows it. Each of these is outside information that the pictures alone do not carry, and each moves the answer from the valley’s floor to one place on it. A rig that reports the valley — its direction, the correlation of the two unknowns along it, and where on it the fit settled — leaves that choice to the reader who has the outside information, instead of making it silently and a third of an uncertainty off.
What was assumed
The surface is flat and level. A real pond’s surface ripples, and a river’s slopes and moves. The fit here has one height for the whole surface; a surface that varies across the pictures adds a height per place, and the valley then has as many dimensions as there are places.
The eyes know where they are. The rig’s own geometry is exact. A rig that recovers its cameras from the same pictures adds the cameras’ poses to the unknowns, and an uncertainty is quoted from something found that a height measured from a rig carries the rig’s own uncertainty with it; the camera heights and the surface’s height would trade too.
The sticks are straight and their points known to lie on them. Each point is triangulated on its own here; a fit that also knew the points lie on a straight line would have far fewer nuisance numbers, and would likely slide less.
Reading errors are independent and the same size for every ray. A ray arriving at a grazing angle through the surface is imaged through a thin sliver of water and is harder to read than a steep one. Weighting the far stick’s readings down would reduce its pull on the index, and with it the bias it introduces.
Still open: whether knowing the points lie on a line stops the slide
The fits here triangulate every point on its own, so each of the sixteen points carries three numbers of its own for the fit to adjust, against two numbers — the index and the height — that all of them share. That is the shape of estimation problem in which the shared numbers are known to be pulled off by the nuisance ones, and the slide measured above is consistent with it; that it is the cause was not shown here.
The measurement that settles it fits the same readings with each stick constrained to be a straight line — five numbers a stick instead of three a point — and asks whether the index still comes back low by a third to a half of its spread. If the slide disappears, it was the nuisance numbers’, and any rig whose objects have known shapes should fit the shapes rather than the points. If it stays, it belongs to the refraction itself, and the only cure is the one this essay found for water: know one of the two.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A pane gives a product before it gives two numbers — both name instrument limit, least squares, refractive index
- A third ray is worth what its picture is worth — both name least squares, reprojection error, triangulation
- A fitted radius is wrong before it is uncertain — both name instrument limit, least squares
- A floor with a referent — both name instrument limit, least squares
- A mismatch on its own line needs a third eye — both name least squares, triangulation
- A scroll camera rings with its vehicle's suspension — both name instrument limit, least squares
Named objects
A flat tag is an object no other essay names yet.
instrument limitleast squaresMultiviewRefractionRefractive indexReprojection errorTriangulation