Drawn confidently

A street can read its own lens, if its edges are found finely

A copyist who fits a lean table to a photograph's chords draws a 2% barrel street 1.07 px wrong and never names the lens. Reading the lens from the street's own edges, by straightening them, and taking it out first does better while the edges are found finely enough: from the nine verticals alone the lens comes back to ±0.38% of its 2% from edges found to 0.3 px, and the street is then drawn 0.51 px wrong; adding three rooflines halves that to 0.30, under the verticals' own bow. The verticals alone lose to the copyist past about two thirds of a pixel. And the misfit has to be measured where the edges were read, or noise reads as pincushion.

Worth reading first: The cube that is a box · Fitting a lens from straightness alone.

A lens bends a table’s tilt, not its lines photographed a street through a lens with 2% of barrel distortion and found that the lens’s main effect on a draughtsman’s table of leans was not the bending of the verticals. They bow by 0.38 px, too little to see. What the lens moves is where their straight chords meet, so a table fitted to the chords, the table of a table of leans converges on the wrong point, reads the camera’s 20° tilt as 18.87° and copies the photograph to four hundredths of a pixel, while drawing the scene itself more than a pixel wrong. Taking the lens out first made the pinhole table exact. Taking it out needs the lens.

The essay ended by asking whether the street could supply it. The photograph holds nine verticals and whatever rooflines the street has, all straight in the world, and fitting a lens from straightness alone showed that straight edges alone give a lens back, to fifteen digits from exact marks. The question here is practical. How precisely do the street’s own verticals fix the lens when their edges are found to a fraction of a pixel? Is that enough to bring the street, drawn through the lens it read, below the verticals’ own bow? How much do rooflines add? And does reading the lens and taking it out beat the copyist’s shortcut, fitting the table’s constant to the chords and never naming the lens at all?

Reading the lens wins when the edges are found finely, rooflines widen the margin, and one choice in the reading decides whether it works at all.

The edges, and what is read from them

The street and camera are the earlier ones: nine verticals 10 m tall spread across 18 m at 25 m, a camera 1.6 m up tilted 20° up, a 595 px focal length on a 690 by 420 sheet. The lens moves every point along its radius by a factor 1+k1r21 + k_1 r^2, with k1k_1 chosen so that the sheet’s corner moves 2% inward. To the verticals are added three rooflines along the facade at heights of 3, 6.5 and 10 m, long horizontal edges that run across the picture.

The street's straight edges as a lens with 2% barrel photographs them, each one's bow drawn twenty times largerA street's nine verticals and three rooflines along its facade, photographed by a camera tilted up 20° through a lens that moves the sheet's corner 2% towards the centre; the dashed rectangle is the 690 × 420 sheet, and the verticals' feet run below it. Each edge is drawn as its own chord plus its departure from that chord multiplied by 20, so the bow can be seen. At its true size the verticals bow by at most 0.38 px and the rooflines, longer and further from the centre, by up to 1.10 px. The plumb-line method reads the lens from those bows alone: the lens is whatever makes every edge straight once it is taken out.bows drawn twenty times their sizenine verticals, three rooflines
Fig. 1 The street’s nine verticals and three rooflines as the 2% barrel lens photographs them, each edge drawn as its own chord plus its departure from that chord multiplied twenty times.

These are straight lines that are not in the smallest measure. At their true size the verticals bow by at most 0.38 px and the rooflines by up to 1.10 px: the rooflines are longer and run further from the picture’s centre, where a radial lens moves points most. Every edge is found as 41 points along it, each moved across the edge by a reading error.

The lens is read by straightening. For a trial lens, every found point is moved back through it, each edge is given its own best straight line, with its direction and offset free so that nothing is assumed about where any edges meet, and the misfit of the points to their lines is summed. The lens read is the trial lens with the least misfit. That is the method of the straightness essays, applied to the street’s own edges rather than to edges placed for calibration.

The misfit has to be measured where the edges were read

One choice in that recipe looks like a detail and is not: where the misfit is measured.

Measured in the undistorted picture, the misfit pulls the lens read towards pincushion as the edges get noisierThe mean lens read from the nine verticals over 120 photographs, against how well the edge points are found, with the misfit measured in two places. Measured after the trial lens is taken out (dashed), the reading drifts towards pincushion as the noise grows: −1.70% at 0.3 px, −1.19% at 0.5 and 1.65% at 1 px, the wrong sign, for a lens of −2%. A pincushion trial shrinks the picture's outer parts, and with them the readings' own scatter, so it wins by making the noise look smaller. Measured in the photograph's own pixels (solid), where the edges were read, the reading stays at −1.99%, −2.01% and −2.15%.-20200.2000.4000.6000.8001how well each edge point is found (px)mean lens read (% at the corner)true lensmisfit in the photographmisfit after the lensnine verticals, 120 photographs1 px: 1.65% against −2.15%
Fig. 2 The mean lens read from the nine verticals over 120 photographs, against how well each edge point is found, with the misfit measured after the trial lens is taken out and measured in the photograph’s own pixels.

Measured after the trial lens is taken out, which is the natural place since that is where the edges should be straight, the reading drifts as the edges get noisier. At 0.3 px it reads −1.70% for a lens of −2%; at 0.5 px, −1.19%; at a pixel, +1.65%, the wrong sign. The cause is that a trial lens rescales the picture it straightens. A pincushion trial pulls the outer parts of the picture inward, and with them the readings’ own scatter about the edges, so it lowers the misfit by shrinking the noise as well as by straightening the bow, and the noisier the edges, the more that second effect is worth. Measured in the photograph’s own pixels, where the edges were found, by scaling each distance back by the lens’s local magnification, the reading stays on the lens: −1.99%, −2.01% and −2.15% at the same three errors.

This is the estimator’s error, not the method’s, and nothing in a fit’s output flags it. The misfit in the wrong place is a perfectly smooth function with a perfectly clean minimum. Every reading below measures it in the photograph.

How well the street reads its lens

Read to 0.3 px, the street's edges are straightest near the true lens, and a valley with rooflines is narrower than one withoutOne photograph of the street through a 2% barrel lens, every edge found as 41 points each 0.3 px off it at random. For each trial lens the points are moved back through it, each edge is fitted with its own straight line, and the rms misfit is plotted, measured in the photograph's own pixels. The verticals alone (dashed) are straightest at −2.43%; with the three rooflines added (solid), at −1.73%. The valley's floor is the readings' 0.3 px; its width is how well the lens is pinned, and the long rooflines, bowing further, pin it more.0.3000.3500.400-6-4-202trial lens: movement of the sheet's corner (%; negative is barrel)rms misfit of straight lines (px)true lens, −2%with rooflinesverticals aloneone photograph, edges to 0.3 pxread −2.43% and −1.73%
Fig. 3 For one photograph with its edges found to 0.3 px, the rms misfit of straight lines against the trial lens, from the verticals alone and with the rooflines added.

For a single photograph the misfit has a shallow valley whose floor is the readings’ own 0.3 px and whose bottom sits near the true lens: −2.43% from the verticals alone in this photograph and −1.73% with the rooflines. The valley’s width is how well the lens is pinned, and the rooflines make it much narrower, because their bows are larger and a lens that is slightly wrong leaves them visibly curved.

The street reads its own lens to a fifth of the distortion from edges found to 0.3 px, with its rooflinesThe spread of the lens read from the street over 120 photographs, as the movement of the sheet's corner, against how well each edge point is found. From the nine verticals alone (dashed): ±0.13% at 0.1 px, ±0.38% at 0.3 px, ±1.24% at 1 px, against a true lens of 2%. With three rooflines (solid): ±0.07%, ±0.22% and ±0.74%. Both grow in proportion to the reading error, as a reading of a bow through noise must; the rooflines' longer bows pin the lens about 1.7 times as finely.00.500100.2000.4000.6000.8001how well each edge point is found (px)spread of the lens read (% at the corner)with rooflinesverticals alonetrue lens: 2% barrel0.3 px: ±0.22%
Fig. 4 The spread of the lens read over 120 photographs, as the movement of the sheet’s corner, against how well each edge point is found, from the verticals alone and with rooflines.

Over 120 photographs, the nine verticals read the 2% lens to ±0.13% from edges found to 0.1 px, ±0.38% at 0.3 px and ±1.24% at a pixel. With the rooflines, ±0.07%, ±0.22% and ±0.74%, about 1.7 times as finely at every reading error. Both spreads grow in proportion to the reading error, as a reading of a fixed bow through noise must. At a pixel the verticals alone cannot even say reliably whether the lens is barrel, which is the earlier essay’s point about the bow seen from the other side: 0.38 px is too little to see, and it is also too little to measure against a pixel of noise.

The lines that calibrate a lens found that an edge’s worth for this purpose grows with its distance from the centre. The street’s own rooflines are its best edges for exactly that reason. A street photographed with its rooflines cut off by the frame has thrown away most of what it knew about its lens, and a street framed so that its longest edges cross the middle of the picture has hidden it.

Drawn through the lens it read

The question that matters to a draughtsman is not how well the lens is known but how well the street is then drawn. Reading the lens and taking it out makes the pinhole table exact only if the lens is exact, and the lens read carries its spread into the drawing.

Taking out a lens the street read beats the copyist's table while the edges are found to about two thirds of a pixel, or a whole pixel with rooflinesThe street drawn by taking out the lens read from the street and ruling the pinhole table, its worst error at a top against the scene, rms over 120 photographs, against how well the edges were found: from the verticals (dashed) and with rooflines (solid). The copyist's table fitted to the photograph's chords, naming no lens, is 1.07 px out (dotted line); the verticals' bow is 0.38 px. At 0.3 px the read lens leaves 0.51 px from the verticals and 0.30 px with rooflines, the second under the bow. The read lens beats the copyist up to 0.63 px from the verticals and the whole range with rooflines, 1.00 px against 1.07 px at 1 px.00.50011.50200.2000.4000.6000.8001how well each edge point is found (px)worst error of a drawn top, against the scene (px)copyist's fitted tablethe verticals' bowlens from rooflines toolens from verticals2% barrel, tilt 20°0.3 px: 0.30 px with rooflines
Fig. 5 The street drawn by taking out the lens read from the street and ruling the pinhole table, its worst error at a top against the scene, against how well the edges were found, with the copyist’s chord-fitted table and the verticals’ bow for comparison.

The copyist’s table, fitted to the photograph’s chords with no lens named, draws the scene 1.07 px wrong at its worst top, and that is the bar to clear. The lens read from the verticals and taken out does better while their edges are found finely: 0.51 px at 0.3 px of reading, and level with the copyist at about two thirds of a pixel, beyond which the copyist’s shortcut is the better method. With the rooflines the read lens draws the street 0.30 px wrong at 0.3 px of reading, under the verticals’ own 0.38 px bow, and it is still marginally ahead of the copyist at a full pixel, 1.00 px against 1.07.

So the essay’s last question has a conditional answer. With the verticals alone, reading the lens is worth it for a photograph sharp enough to place an edge to better than about two thirds of a pixel and not otherwise. With rooflines it is worth it at any reading error a usable photograph allows. The copyist’s shortcut, which absorbs the lens into the table’s tilt, is never far behind and never needs to know what a lens is. It is what the earlier essay called it: a lens a draughtsman can absorb and never name, as long as nothing better is in the picture.

One photograph is one draw

The comparison above is of averages over 120 photographs, and a draughtsman has one. The two methods fail in different ways, which makes the average the wrong summary for a single picture. The copyist’s error is a bias: the same 1.07 px on every photograph of this street, because it comes from the lens and not from the reading. The read lens’s error is a scatter: some photographs read the lens well and draw the street almost exactly, others read it poorly and draw it worse than the copyist.

Counted photograph by photograph, the read lens from the verticals at 0.3 px draws the street worse than the copyist in 2% of photographs, with a median error of 0.33 px and one photograph in ten above 0.90. At 0.5 px it is worse in 22% of photographs, at 0.75 px in 38%. With rooflines the same counts are none at 0.3 px, 3% at 0.5 and 15% at 0.75, with medians of 0.21, 0.35 and 0.53 px. So the crossover of the averages, two thirds of a pixel for the verticals, already hides a draughtsman who has a one in three chance of doing worse than the shortcut. A cautious reader, wanting the read lens to win on nearly every photograph and not merely on average, needs edges found to about 0.3 px from the verticals or 0.5 px with rooflines.

There is a check available in the picture itself. The misfit at the read lens should be the reading error and no more; a photograph whose edges straighten to their reading error has read its lens consistently, and one whose edges stay visibly curved at the best trial lens has edges that are not straight in the world or a lens the one-term model does not describe. The copyist has no such check, because a table of leans fitted to chords always fits its chords.

More points along an edge do what finer points do

A reading error is set by the photograph’s sharpness, but the number of points found along each edge is the reader’s choice.

Finding more points along each edge buys the same as finding each one better, as the root of their numberThe street drawn through the lens it read, edges found to 0.3 px, against how many points are found along each edge. From the verticals (dashed): 0.91 px with 11 points an edge, 0.51 px with 41 and 0.28 px with 161. With rooflines (solid): 0.54 px, 0.30 px and 0.14 px. Four times the points halves the error, as halving each point's error would, so tracing each edge along its whole length is worth as much as finding each point more finely.00.2500.5000.75050100150points found along each edgeworst error of a drawn top (px)with rooflinesverticals aloneedges found to 0.3 px161 points: 0.14 px
Fig. 6 The street drawn through the lens it read, edges found to 0.3 px, against the number of points found along each edge, from the verticals alone and with rooflines.

With 11 points an edge, the verticals’ read lens draws the street 0.91 px wrong; with 41, 0.51; with 161, 0.28. With rooflines, 0.54, 0.30 and 0.14. Four times the points halves the error, exactly as halving each point’s error would, since the reading averages over the points. Where along an edge they are spent matters less than how many there are, as the response is at the ends and the information is not found. Tracing each edge along its whole length is therefore worth as much as finding each point more finely, and a photograph whose edges are only good to half a pixel can still read its lens well if they are traced densely.

That has a practical edge. An edge found by fitting a line to every pixel of a sharp gradient along its whole length is effectively hundreds of points. The 41 points used throughout are a hand’s worth, marked one at a time; a program that follows an edge does far better than that from the same photograph.

What the draughtsman’s choice comes to

The earlier essays found three things a lens does to a table of leans: it moves the tilt the chords imply, it leaves a bow no straight lean can draw, and it makes the copyist’s fitted table a faithful copy of the photograph but not of the scene. Here is the fourth. The photograph holds what it needs to undo the lens, in the bows of its own edges, and a careful reading recovers it well enough to beat the shortcut. That reading needs three things the shortcut does not: edges found to a fraction of a pixel or traced densely, the long edges far from the centre, and a misfit measured where the edges were found.

None of these is exotic. The last is the only one a careful reader might get wrong, and the bias it produces is the dangerous kind, smooth and confident and growing with exactly the noise a reader cannot see.

Why the rooflines are worth what they are

The rooflines’ advantage has a simple shape that predicts where else to look for edges. A straight edge’s bow under a radial lens grows roughly with its length squared and with its distance from the centre, since the lens’s movement grows as the cube of the radius and the bow is the departure of the middle from the chord through the ends. The verticals here are 10 m tall at 25 m, about 250 px long in the picture, and the outer ones stand about 215 px from the centre. The rooflines are 400 to 450 px long, at rows 15 to 180 px below the centre, so the lowest and longest bows by 1.10 px, nearly three times the largest vertical’s 0.38, and the three of them carry as much about the lens as many more verticals would. The highest roofline, running almost through the centre, bows by only 0.075 px, less than all but the middle vertical: length pays only on an edge that also runs well away from the centre, and an edge through the centre has no bow at all, whatever its length, because the lens moves its points along the edge itself. A street’s kerbs, cornices and window rows are the same kind of edge, and every long one far from the centre is worth having.

A one-term lens, a facade, a fair copyist

One radial term, centred. The lens has a single coefficient about the sheet’s centre. A real lens has more terms and a centre that is not the sheet’s, and no design separates the two coefficients found how poorly straight edges tell the first two terms apart. A two-term lens read from the street would carry that correlation into the drawing, though a lens’s curve is known where its coefficients are not found the curve itself far better pinned than either term.

Rooflines square to the view. The rooflines run along a facade facing the camera, so they are parallel in the picture. On a street seen at an angle they converge, and since each edge’s line is fitted free, the reading does not need to know where they meet; what it loses is that receding rooflines are shorter in the picture and run less far from the centre.

The copyist reads the chords exactly. The copyist’s table is scored without reading error, which flatters it slightly against the read lens. With its feet and tops found to the same error the copyist’s fitted constant would carry its own spread, and the crossover would move a little in the read lens’s favour.

Error is scored at the tops. A drawn vertical is worst at its top, the end furthest from the foot it was ruled from, as in the earlier essays.

Still open: whether one lens read from several photographs fixes the streets one alone cannot

A camera’s lens does not change between photographs. A photographer who shoots a street, then the next street, then a doorway, has several pictures through one lens, each with a few straight edges, some near the centre and some far from it. Pooled, those edges might pin the lens where no single photograph can, and the street with its rooflines cropped could borrow its lens from the doorway.

The measurement that settles it reads one lens from the edges of two, four and eight photographs of different scenes together, each with its own tilt and its own edges, and asks how the lens’s spread falls with the number of pictures, whether a photograph with only weak edges near its centre is drawn as well through the pooled lens as one with strong rooflines through its own, and whether pooling across pictures hides a lens that changed between them, a zoom or a refocus, inside a single smooth misfit.

A lens read from many photographs follows the best one takes that measurement: pooled, the edges read the lens as well as the photographs’ informations added, mostly the best photograph’s, a weak street is drawn through the pool’s lens twelve times better than through its own, and a lens that changed is hidden only when it changed for the photograph that dominates the pool.

A street can read its own lens from the bows of its straight edges and draw itself through it, and that beats the copyist’s chord-fitted table while the edges are found finely: from the verticals alone below about two thirds of a pixel, with rooflines at any usable error, reaching 0.30 px against the copyist’s 1.07 at 0.3 px of reading. More points along an edge buy what finer points do. And the misfit must be measured where the edges were found; measured after the lens is taken out, noise reads as pincushion.

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.

Biasplumb-line calibrationRadial distortionthree-point perspectivevertical vanishing point