The rectangle behind the lens

A rolling frame on a bend is a coarse curvature gauge

Read row by row on a bend, a frame leans every vertical by an amount proportional to one over its range less one over the bend's radius, so posts at several ranges lie on a straight line that crosses zero at the radius — exactly, to a thousandth of a metre. Off the axis the zero moves to R·cos of the bearing, the circle on which a camera on a bend is sharp. As a gauge it is coarse: one frame's eight posts read a 50 m bend as 45 m (35–74) with tops placed to half a pixel, and sixteen frames as 51 m (47–55). The slower the sensor reads, the better it measures the road.

Worth reading first: A frame is an interval · Every row is a different camera.

A rolling frame on a bend is right at its centre followed a camera car round a fifty-metre bend with a sensor that reads its frame one row at a time, and found the rolling readout displacing every still point by its streak times its row’s time over the exposure. Two things were left exactly where a global shutter would put them: the bend’s centre, which turns with the camera, and every point at eye height, which lands on the middle row and is read at the global shutter’s moment. A vertical straight toward the centre therefore leans in the rolling frame by an amount proportional to one over its range less one over the radius, and a vertical at the centre does not lean at all.

That essay ended by turning the law round. If the lean vanishes at the bend’s radius, then verticals at several known ranges ahead, read for their lean, should say where the lean vanishes — and a camera with a rolling shutter would carry a curvature gauge in every frame it takes on a bend, the distortion that stabilisers are fitted to remove becoming a measurement of the road.

The gauge exists and is exact. Read with the errors a real frame has, it is coarse, and what makes it better is the opposite of what sensor makers work towards.

Posts that lean both ways

The scene is the earlier essay’s: a camera car at ten metres a second on a fifty-metre bend, aimed at the bend’s centre, its frame read from top to bottom over 33 milliseconds with the middle row read at the moment a global shutter would take. Posts three metres tall stand straight toward the centre at several ranges, their feet at eye height.

In a rolling frame on the 50 m bend, posts nearer than the centre lean one way, posts beyond it the other, and the post at 50 m stands straightPosts 3 m tall straight toward the bend's centre, their feet at eye height, at 12, 25, 50, 100, 150 m, as a frame read row by row over 33.3 ms draws them from the camera car at 10 m/s; each is set in its own panel at its height in the frame, its lean shown 20 times actual. Leans, in pixels of sideways displacement per row: 3.90e-2, 1.23e-2, 0.00e+0, -6.17e-3, -8.22e-3. The post at the bend's centre is read upright to 0e+0, because it turns with the camera and has no image speed; the nearer posts slide one way across the frame as the rows are read and the further ones the other.12 m+39.0525 m+12.3350 m+0.00100 m-6.17150 m-8.22readout 33 ms, 10 m/s; leans in thousandths of a px per row, drawn ×20upright at the centre
Fig. 1 Posts 3 m tall toward the centre of the 50 m bend at 12, 25, 50, 100 and 150 m, as a 33 ms rolling frame draws them, leans shown twenty times. Leans in pixels per row: 3.90e-2, 1.23e-2, 0, −6.17e-3 and −8.22e-3. The post at the centre stands straight; nearer posts lean one way and further ones the other.

Each post’s foot, at eye height, sits on the middle row and is undisplaced; its top is read earlier, while the camera was a little further back round the bend, and is displaced sideways by the image’s speed at that column times the time between the two rows. So each post leans by a fixed number of pixels per row. The post twelve metres out leans by 0.039 pixels per row, the one at twenty-five metres by 0.012, the one at fifty metres — the bend’s centre — by nothing, and the posts beyond it lean the other way: −0.0062 at a hundred metres, −0.0082 at a hundred and fifty. The camera turns and travels at once, and at the centre the two carry a still point’s image exactly with the frame; nearer than that the travel wins and beyond it the turn does. Turning and travelling blur different worlds is where the two motions were first set against each other; the rolling frame records their difference as a lean. Drag the bend’s radius and the upright post moves with it: on a 25-metre bend the post at twenty-five metres stands straight and the one at fifty leans back by 0.012 pixels per row, and on a 100-metre bend the straight post is the one at a hundred. Wherever the row stands upright, that is how far away the centre is.

A straight line through the radius

The earlier essay’s law says what these leans should do against range.

Against one over the range the leans lie on a straight line that crosses zero at one over the bend's radius: 30.0 m, 50.0 m, 100.0 m for bends of 30, 50, 100 mEach post's lean in the rolling frame, straight toward the bend's centre, against one over its range, for bends of 30, 50, 100 m driven at 10 m/s and read over 33.3 ms. The lean is the image's sideways speed at that column times one row's time, f·v·(1/Z − 1/R)·readout/rows, so each bend's posts lie on a line through zero at 1/R with one slope for every bend at one speed. Fitted exactly, the lines cross zero at 30.000 m, 50.000 m, 100.001 m. Posts nearer than the centre lean one way and further ones the other; a straight road is the line through the origin.-200204000.0200.0400.0600.080one over the post's range (1/m)lean, thousandths of a pixel per rowR = 30 mR = 50 mR = 100 mreadout 33 ms, 10 m/szero at 1/R
Fig. 2 Each post’s lean against one over its range, for bends of 30, 50 and 100 m at 10 m/s and a 33 ms readout. The leans lie on straight lines, one slope for every bend, crossing zero at one over the radius: fitted exactly, at 30.000, 50.000 and 100.001 m.

Plotted against one over the range — the quantity a stereo pair’s disparity is linear in, as depth is a reciprocal found — the leans lie on a straight line: lean =a (1/Z−1/R)= a\,(1/Z - 1/R), with aa the camera’s focal length times its speed times one row’s time. Every bend at one speed shares the slope; each bend’s line crosses zero at one over its own radius. Fitted exactly, the three lines cross zero at 30.000, 50.000 and 100.001 metres. A straight road is the line through the origin, since a straight road’s radius is infinite and every post leans by travel alone.

So two posts at known ranges give the radius, and more posts give it by least squares. The ranges have to be known — from a map, a second camera, the posts’ own known height in the picture — but the speed and the readout time do not, because they are all in the common slope, which the fit finds.

Off the axis, the sharp circle

Posts are not usually lined up toward the centre of a bend. A post at some bearing off the camera’s axis leans too, and its zero is somewhere else.

Off the axis the leans cross zero at R·cos(bearing) — 50.0, 49.2, 47.0, 43.3 m at 0, 10, 20, 30° — the circle on which a camera on the bend is sharpPosts along lines at 0, 10, 20, 30° from the camera's axis, which points at the bend's centre, fitted exactly for the range at which their leans cross zero: 50.00 m, 49.23 m, 46.96 m, 43.26 m. The range at which a still point on that bearing draws no streak over an exposure — the sharp circle the earlier measurement found — is 50.00 m, 49.27 m, 47.04 m, 43.38 m. Both are R·cos(bearing), the circle whose diameter runs from the eye to the bend's centre (the line): every still point on it turns with the camera, so the rolling readout, which only moves what moves in the image, leaves it standing. Posts on any bearing therefore give the radius, divided by the cosine.354045500102030the posts' bearing from the camera's axis (degrees)range at which the leans cross zero (m)R·cos bR = 50 m; large dots: the leans' zero; small: the sharp circlethe sharp circle
Fig. 3 Posts at 0°, 10°, 20° and 30° from the camera’s axis, which points at the bend’s centre: the range at which their leans cross zero, 50.00, 49.23, 46.96 and 43.26 m; and the range at which a still point on that bearing draws no streak, 50.00, 49.27, 47.04 and 43.38 m. Both follow R·cos(bearing) (the line).

Along a bearing ten degrees off the axis the leans cross zero at 49.23 metres; twenty degrees off, at 46.96; thirty, at 43.26. A camera on a bend is sharp on a circle found the places where a still point draws no streak at all over an exposure, and they lie at 49.27, 47.04 and 43.38 metres on the same bearings. Both are Rcos⁡bR\cos b: the circle whose diameter runs from the eye to the bend’s centre. Every still point on that circle turns with the camera, and a rolling readout, which moves only what moves in the image, leaves it standing.

The gauge therefore works on any bearing. Posts along any line from the camera give the range at which their leans vanish, and that range divided by the cosine of the line’s bearing is the radius. A roadside’s lamp posts, seen at different bearings as the road curves away, are as good as posts lined up toward the centre, provided their ranges and bearings are known.

One frame, read to a pixel

Exact leans are one thing. A real frame’s posts are read with an error, and the lean of a post is the displacement of its top against its foot divided by the rows between them — a small number divided by a number that shrinks with range.

One frame's eight posts read the 50 m radius as 50 m (47–54) with tops placed to 0.1 px, and as 45 m (35–74) to half a pixelPosts 3 m tall at 12, 18, 25, 35, 50, 70, 100, 150 m straight toward the bend's centre in one rolling frame (33.3 ms, 10 m/s), each lean read from its top's displacement against its foot with a stated error, the leans fitted against one over the range with each weighted by the rows it spans, 200 readings a point. The radius read back, median and quartiles: 50.3 m (46.9–54.4) at 0.1 px, 50.7 m (43.0–63.6) at 0.25 px, 44.6 m (35.1–74.4) at 0.5 px, 30.6 m (-11.0–45.8) at 1 px. The zero the fit is looking for lies far out in range, where the posts are short in the picture and their leans are read worst; the intercept that sets the radius is a small number found by extrapolation, and the ratio that turns it into a radius is biased short once it is noisy.0.10.250.510255075100how well each post's top is placed against its foot (px, log scale)the radius read back (m): median and quartilesthe bend, 50 mone frame, eight posts, readout 33 msa coarse gauge
Fig. 4 Posts at 12 to 150 m in one frame, each top placed against its foot with a stated error, the leans fitted with each weighted by the rows it spans; 200 readings a point, median and quartiles. At 0.1 px: 50.3 m (46.9–54.4). At 0.25 px: 50.7 m (43.0–63.6). At 0.5 px: 44.6 m (35.1–74.4). At 1 px: 30.6 m, its lower quartile below zero.

Eight posts from twelve to a hundred and fifty metres, their tops placed to a tenth of a pixel, give the fifty-metre radius as 50.3 metres with quartiles 46.9 and 54.4 — a gauge good to about eight per cent. Placed to a quarter of a pixel, 50.7 metres with quartiles of 43 and 64. To half a pixel, 44.6 metres, 35 to 74, and to a pixel the estimate is 31 metres with its lower quartile below zero: the gauge reads nothing at all.

The reason is where the answer lives. The radius is where the line crosses zero, one over fifty metres, and that is found from the line’s intercept — a small number, −a/R-a/R, that the fit has to extrapolate from posts whose leans are largest near the camera and smallest far away. The far posts, whose leans pin the crossing, are exactly the posts that are short in the picture: three metres of post at a hundred and fifty metres spans fifteen rows, and a pixel of error in its top is a lean error of a tenth of a pixel per row, ten times the lean itself. The ratio that turns slope and intercept into a radius is also biased once the intercept is noisy, and biased towards small radii, which is why the median slides down as the reading worsens.

More frames

A camera on a bend takes many frames, and each one draws the same posts leaning by the same amounts if the car holds its speed and line. Averaging their leans averages their reading errors.

Averaged over 16 frames — about half a second of video — the posts read the radius as 51 m (47–55) at half a pixel; over 64, 49.9 m (48.0–52.0)The same eight posts, their leans averaged over a stated number of frames with independent reading errors before the line is fitted — the posts assumed to keep their ranges, which on a real drive they do not, so this is the best such averaging could do. Tops placed to 0.5 px: 44.6 m (35.1–74.4) over 1, 49.5 m (43.4–61.0) over 4, 50.9 m (46.9–54.7) over 16, 49.9 m (48.0–52.0) over 64. To 1 px: 30.6 m (-11.0–45.8), 44.7 m (35.9–65.7), 51.6 m (44.1–60.3), 49.8 m (46.2–54.3). The spread falls as the square root of the frames once the averaged leans are good enough for the ratio's bias to fade.141664020406080frames whose leans are averaged (log scale)the radius read back (m): median and quartilestops to 0.5 pxtops to 1 pxeight posts, their leans averaged over frames√frames
Fig. 5 The same posts, their leans averaged over a stated number of frames before fitting. Tops placed to 0.5 px: 44.6 m (35.1–74.4) from one frame, 49.5 (43.4–61.0) from 4, 50.9 (46.9–54.7) from 16, 49.9 (48.0–52.0) from 64. To 1 px: 30.6, 44.7, 51.6 and 49.8 m.

With tops placed to half a pixel, four frames give 49.5 metres with quartiles of 43 and 61; sixteen frames — about half a second of video — give 50.9, 47 to 55; sixty-four, 49.9, 48 to 52. With tops placed to a pixel, sixteen frames already do better than one frame read to half a pixel, 51.6 metres with quartiles of 44 and 60; at half a pixel, sixty-four frames make the gauge good to about four per cent. The spread falls as the square root of the frames once the averaged leans are good enough for the ratio’s bias to fade.

That is an optimistic figure, and it says so. On a real drive the posts do not hold their ranges from frame to frame: the car approaches them, and a post’s lean changes as its range falls. The frames’ leans cannot simply be averaged; they have to be fitted together, each frame’s posts at their own ranges, with one radius for all. That uses the same information and more, and it should reach at least this precision; the figure is the averaging’s ceiling, with posts that wait.

A slow sensor measures the road

The last variable is the one sensor makers control, and it runs the wrong way for this purpose.

The slower the readout, the better the gauge: 47 m (35–67) at 4 ms, 50.4 m (48.4–52.2) at 33 msEight posts, their tops placed to a quarter of a pixel, averaged over sixteen frames, for readouts from 4 to 67 ms: 47.0 m (35.3–66.6) at 4.0 ms, 51.6 m (44.1–60.3) at 8.3 ms, 50.9 m (46.9–54.7) at 16.7 ms, 50.4 m (48.4–52.2) at 33.3 ms, 50.2 m (49.2–51.1) at 66.7 ms. Every lean grows in proportion to the readout time, so a sensor built to read fast — the thing its makers work towards, to make the distortion small — is the sensor whose distortion measures the road least well.48.3316.733.366.7020406080how long the frame takes to read (ms, log scale)the radius read back (m): median and quartileseight posts, 0.25 px, sixteen framesslow sensors read roads
Fig. 6 Eight posts, tops placed to 0.25 px, sixteen frames, against the readout time: 47.0 m (35.3–66.6) at 4 ms, 51.6 (44.1–60.3) at 8.3 ms, 50.9 (46.9–54.7) at 16.7 ms, 50.4 (48.4–52.2) at 33 ms, 50.2 (49.2–51.1) at 67 ms.

Every lean is proportional to the readout time: a frame read over sixty-seven milliseconds leans its posts eight times as far as one read over eight. The reading error does not change, so the gauge improves in proportion. With sixteen frames and tops placed to a quarter of a pixel, a 67-millisecond readout reads the fifty-metre bend as 50.2 metres with quartiles of 49.2 and 51.1 — two per cent — while a 4-millisecond readout gives 47.0 with quartiles of 35 and 67, no gauge at all.

Sensor makers work to shorten the readout, because the leaning verticals and the sheared cars are what photographers complain of. A sensor built to make the distortion small is the sensor whose distortion measures the road least well. Every row is a different camera put the underlying fact plainly: a rolling frame is a set of cameras at different moments, and the longer those moments are spread, the more the frame knows about how the camera moved between them.

Where the ranges come from

Every reading above supplies each post’s range, and the gauge is only as good as those ranges. The law makes the dependence exact: the fit finds where the leans cross zero on an axis of one over the range, so a common error of a few per cent in every range scales the radius by the same few per cent, and an error that grows with range — the usual kind — bends the line and moves its crossing.

The natural source of range in a single frame is the posts themselves. A lamp post or a fence post of a standard height spans a number of rows inversely proportional to its range, and the rolling frame already requires that span to turn a displacement into a lean. But a post’s height in pixels is read to the same fraction of a pixel as its top’s displacement, and for the far posts that pin the crossing it is a small number read coarsely: a three-metre post at a hundred and fifty metres spans fifteen rows, so a pixel of error in its height is a range error of about seven per cent — on exactly the posts where the line is decided.

A second camera, a map or a depth sensor gives ranges independently of the frame and does better at range than a post’s own height. A frame’s shear knows travel only over depth is the underlying reason the ranges cannot be avoided: a rolling frame’s distortion couples the camera’s travel to each point’s depth, and anything read from it about the travel — here, where the travel curves — has to be given the depths from somewhere.

What a bend of fifty metres is

The fifty-metre bend used throughout is a tight one: a roundabout’s circle, a sharp corner in a town, an exit ramp. The gauge’s difficulty grows with the radius for a reason that follows from the law. The crossing sits at one over the radius, and a gentle bend puts it close to zero on the one-over-range axis, where the posts that fix it have to be far away — beyond the radius, where the lean changes sign. A five-hundred-metre bend on a main road needs posts past five hundred metres to bracket its crossing, which are a few rows tall and leaned by a hundredth of a pixel over a frame.

So the rolling-shutter gauge is a tool for tight bends and slow sensors, and a poor one for the gentle curves of fast roads. For those, the scroll camera that a scroll can be asked its own radius measured is the better instrument: a scroll accumulates a bend over its whole length rather than over one frame’s readout, and it gave the radius from a single point and its neighbour to a part in a billion with exact readings.

Between the two lies a difference of time scale. A rolling frame’s rows span tens of milliseconds, in which a car at ten metres a second moves a few tenths of a metre and turns by a few tenths of a degree; everything the gauge reads is that small motion, magnified by the posts’ depths. A scroll spans the whole drive. The rolling frame is a curvature gauge that fits in one exposure, and it is coarse in proportion to how little the camera moves in one exposure.

What the gauge is, and is not

The measurement answers the earlier essay’s question with a qualified yes. A rolling frame on a bend carries the bend’s radius exactly in the leans of its verticals, straight toward the centre or off it, and with ranges known it can be read from any two posts. As a practical gauge from one frame it is coarse — eight per cent with tops placed to a tenth of a pixel, nothing at a pixel — because the answer is an intercept extrapolated from short, far posts. Averaged over frames, or read from a slow sensor, it becomes a useful instrument: four to eight per cent from half a second of video at the readout times phone sensors actually have, sixteen to thirty-three milliseconds.

It measures the bend as the camera drives it, which is not quite the road’s centreline radius, and it measures it relative to the ranges supplied: an error of a few per cent in every range scales the radius by the same few per cent. A turning frame can be straightened found the turn alone correctable row by row and the travel not; this is the travel’s revenge — the part a stabiliser cannot remove is the part that says where the road goes.

What was assumed

The car holds its speed and its line. A car that brakes on the bend changes its speed between rows, and the leans’ common slope with it; one that drifts across its lane changes its radius during the frame. Both add errors the fit reads as noise in the lean.

The posts are vertical and their ranges known. A leaning post leans in every frame by its own lean plus the rolling one; a post whose range is read from its height in the picture carries that reading’s error into the one-over-range axis, where it matters most for the far posts.

The readout is linear from top to bottom. Sensors that read in interleaved fields, or whose row time varies across the frame, lean their verticals by a pattern the straight-line law does not describe.

Still open: whether a moving car’s own frames fit one radius better than they average

The frames figure averaged leans as if the posts stood still in range. On a real drive each frame sees each post at a smaller range than the frame before, so the post’s lean moves along the line in one-over-range as the car approaches, sweeping the line itself rather than sitting on one point of it. A single post tracked through many frames samples the line over a range of distances, including the far part where the intercept is decided.

The measurement that settles it drives the car round the bend, tracks a handful of posts through half a second of frames, fits one radius and one slope to every post’s lean in every frame at its own range, and asks how the precision compares with the averaged figure — whether a single post seen at many ranges is worth as much as many posts seen at one, and so whether a camera needs a roadside of posts or only one lamp post it can follow round the bend.

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.

camera trackExposureMotion blurMoving viewpointParallaxPrincipal pointSensor