Constructing a view

The ramp has its own horizon

Every plane has a vanishing line, and a ramp's is not the ground's. Its uphill edges meet on a line above the horizon, and the angle at the eye between that meeting point and the same direction taken level is the gradient — 22.0000° recovered against 22° built, out of the picture alone, with no scale, no ruler and nothing known about the scene except that the ground is level.

Worth reading first: The horizon is at eye level — if the picture plane is vertical · Where parallel lines meet.

The horizon is the ground plane’s vanishing line: the image of its points at infinity, and the line every horizontal direction’s vanishing point sits on.

A ramp is a different plane, so it has a different vanishing line, and everything the horizon does for the ground its own line does for it. That is the whole of this essay, and the reason it is worth an essay is that the second line is measurable and says what the gradient is.

The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 22.0000° recovered against 22° built, out of the picture alone.horizonlevelcorrect from 22 cm, at 160 mm wideslope recovered 22.0000° against 22° built
Fig. 1 The ground’s horizon is the lower line and the ramp’s vanishing line is the upper one; the ramp’s uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient — 22.0000° recovered against 22° built.

Every plane has one

A plane’s vanishing line is the image of its line at infinity, and it is found the same way the horizon is: two families of parallel lines lying in the plane give two vanishing points, and the line through them is the vanishing line.

For the ground the two families are any two horizontal directions, and the line is the horizon. For a ramp running uphill along some bearing, the two families are

the uphill direction — the ramp’s own edges, its handrails, the join between its treads — and

the across-slope direction, which is horizontal, because a ramp is a plane tilted about a horizontal axis and the direction along that axis stays level.

The second is the useful one. It is horizontal, so its vanishing point is on the ground’s horizon as well — which means a ramp’s vanishing line always meets the horizon, at the vanishing point of the across-slope direction. Two lines in a picture meet; these two meet at a point that is a fact about the ramp’s bearing.

So the ramp’s vanishing line is the horizon rotated about that point, by an amount set by the gradient. A steeper ramp lifts it further; a level one lays it back onto the horizon exactly.

Reading the gradient

The measurement is an angle between two directions, and this site has one way of measuring an angle in a picture: through the vanishing points and the focal length.

Two vanishing points vv and uu correspond to directions (vc,f)(v - \mathbf{c},\, f) and (uc,f)(u - \mathbf{c},\, f) in the camera’s own frame, where c\mathbf{c} is the principal point. The angle between the world directions is the angle between those two vectors — which is a dot product, and needs nothing else.

Take vv = the uphill direction’s vanishing point, on the ramp’s line, and uu = the same compass direction taken level, on the horizon. The angle between them is the gradient, because those two world directions differ by exactly the tilt.

Recovered against built, over a sweep: 0°, 6°, 14°, 22°, 31°, 40°, every one to better than 1e-9 of a degree.

The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 8.0000° recovered against 8° built, out of the picture alone.horizonlevelcorrect from 22 cm, at 160 mm wideslope recovered 8.0000° against 8° built
Fig. 2 A gentler ramp: the vanishing line sits closer to the horizon and the recovery returns 8.0000° against 8° built. The construction does not have a working range — it is an angle between two rays through the eye.
The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 34.0000° recovered against 34° built, out of the picture alone.horizonlevelcorrect from 22 cm, at 160 mm wideslope recovered 34.0000° against 34° built
Fig. 3 And a steep one at 34°, with the vanishing line well clear of the horizon. What changes with the gradient is how far apart the two vanishing points are, which is the conditioning rather than the correctness.

Why the vanishing line is above the horizon and not below

The direction the ramp’s line moves is worth one paragraph, because it is the check a reader can do without any arithmetic.

An uphill direction points up, so the ray from the eye parallel to it points up, so it pierces the picture above the ray that points along the same compass bearing level — which is on the horizon. An uphill vanishing point is therefore above the horizon, and a downhill one below it.

Which means a ramp seen from its foot has its vanishing line above the horizon, and the same ramp seen from its head has it below — because “uphill” now points away from the camera downward. Both are correct, and the sign of the recovered angle says which.

The pivot is fixed either way. The across-slope direction is horizontal whichever end the camera is at, so its vanishing point is on the horizon, and the ramp’s line rotates about that point as the gradient changes sign. A reader who has found both lines has the pivot for free, and its position on the horizon is the ramp’s bearing.

What has to be known

The inputs are worth listing because the list is short and the omissions are the interesting part.

Needed: the focal length and the principal point. The angle formula uses both. On a photograph they come from the file or from three vanishing points in the scene.

Needed: the horizon. Which is found from the ground’s own parallels, as always.

Not needed: any length. No scale bar, no known object, no measured distance. The gradient is an angle, and angles are recoverable from one picture in a way lengths are not — which is the whole content of the metric upgrade: an angle is a cross-ratio against the circular points, and a single view supplies it once the calibration is known.

Not needed: the ramp’s length, width or position. The measurement uses directions only, so where the ramp is and how big it is do not enter.

That combination — angles yes, lengths no — is the signature of everything on this site that works from one picture. A height needs a known eye height; a gradient needs nothing, because a gradient is a ratio of two lengths and the picture supplies ratios.

A family of parallel ground lines at 30°, and where they meetAll five lines pass through one point on the horizon, off the edge of the frame at x = 1464. The point fitted from the drawn lines agrees with the one computed from the direction to 1e-11 px, and the fit's own residual is 2e-12 px.horizon — the image of the line at infinityvanishing point at x = 1464 — off the framecorrect from 26 cm, at 160 mm wide34° across
Fig. 4 The construction underneath: five images of parallel lines meeting at one point off the frame at x = 1464, fitted from the drawn lines to 1e-11 px. A vanishing line is a line of such points, and the ramp has its own.
The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 14.0000° recovered against 14° built, out of the picture alone.horizonlevelcorrect from 22 cm, at 160 mm wideslope recovered 14.0000° against 14° built
Fig. 5 A ramp at 14°, recovered to 14.0000°. Every value in the sweep comes back to better than a billionth of a degree, which is what “the measurement is an angle between two rays” means numerically.
Two ground lines at 90°, and the picture says soThe two lines cross at 80.43° on the paper. Taking the cross-ratio of the pair with the two lines from their crossing point to the imaged circular points, and halving the logarithm's imaginary part, returns 90.000000° — the angle in the world, with no rectification anywhere.horizonv_zthe horizon misses the imaged circle, so the two points are a conjugate pairprotractor on the paper: 80.43° · cross-ratio: 90.000000°correct from 21 cm, at 160 mm wide42° across
Fig. 6 What an angle in a picture is, in the field that settled it. An angle is a cross-ratio against the circular points, so it is recoverable from one view once the calibration is known — which is why a gradient is available and a length is not.

The refusal, and the acceptance one step inside it

A level ramp has its uphill direction on the horizon, so its vanishing line is the horizon and the two vanishing points coincide.

The measurement must return zero there, and it does — 0.0000°, from an angle between two identical rays — rather than a small number from a nearly-singular intersection. A method that cannot report “flat” is not measuring gradient, and the sweep includes zero for exactly that reason.

The interesting boundary is nearby rather than at zero. A ramp at half a degree has its two vanishing points a few pixels apart, and their positions are found by intersecting nearly-parallel image lines — so the recovered angle inherits whatever error those intersections have. The construction stays exact and the measurement’s precision falls off, which is the same shape as a lamp walked out toward infinity and as a stereo pair’s depth.

Exact everywhere, useful over a range, and the range is a conditioning statement rather than a geometric one.

The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 0.0000° recovered against 0° built, out of the picture alone.horizonuphillcorrect from 22 cm, at 160 mm wideslope recovered 0.0000° against 0° built
Fig. 7 The level case: the ramp’s vanishing line lies on the horizon, the two vanishing points coincide, and the recovery returns 0.0000° — the answer rather than a small residual.

The two numbers a plane’s vanishing line carries

A vanishing line is a line, so it has two degrees of freedom, and the two happen to be exactly the two numbers that describe an inclined plane’s orientation.

Where it meets the horizon is the bearing: the compass direction of the ramp’s own axis of tilt. Move the ramp round the compass and this point slides along the horizon.

How far it sits from the horizon is the gradient. Steepen the ramp and the line lifts away from the horizon, rotating about the meeting point.

So a photograph of a ramp gives up its orientation completely — two numbers from one line — and gives up nothing at all about its size, position or extent. That split is the same one every single-view measurement on this site makes, and it is worth carrying as a rule: a vanishing line is a statement about a plane’s direction and never about where the plane is.

Two planes parallel to each other in the world share a vanishing line exactly. A ramp and the identical ramp fifty metres along the road produce the same line, and the picture cannot separate them by it — which is the same absence a parallel projection has everywhere, arriving here as a property of one construction rather than of a whole family.

What else the second line gives

Once a plane’s vanishing line is in hand, everything the horizon does for the ground is available for the ramp, and three of those are worth naming.

Heights on the ramp. The cross-ratio construction that measures a person standing on the ground works on the ramp’s plane with the ramp’s own vanishing line in place of the horizon. A figure standing on a slope is measured against the slope, not against the ground — which is the correction for the commonest error in single-view height estimation.

Parallels and midpoints on the ramp. The diagonal construction that finds the middle of a rectangle works on the ramp’s plane using its own vanishing line, so a flight of steps can be subdivided with a straightedge exactly as a pavement can.

And the ramp’s rectification. The ramp’s vanishing line is two of the four numbers a metric rectification needs, so a photograph of a ramp can be flattened into a plan of the ramp — a plan in the ramp’s own plane, at the ramp’s own scale, up to the one length no picture supplies.

The ground, turned into a planFour corners of a rectangle of known proportions fix the homography. Three lengths it was never given come back to 1e-15 relative — so every measurement on that plane is available, in units of the rectangle's own width.the picturethe same plane, rectifiedacross — 0.6000 widths (true 0.6000)along — 0.7667 widths (true 0.7667)diagonal — 1.2023 widths (true 1.2023)worst error 1e-15 relativethe probes were not used to build the map
Fig. 8 The operation the second vanishing line unlocks for the ramp. Four corners of a rectangle of known proportions fix the map, and lengths it was never given come back to 1e-15 relative — for points on that plane.

Where the classical construction put it

The measuring-point construction and the distance-point construction are both built on the horizon, and both have inclined-plane versions that a nineteenth-century drawing manual would set out at length.

The modern statement is shorter and says why they work: a construction on a plane uses that plane’s vanishing line, and the horizon is only special because the ground is the plane most constructions are about. A staircase, a roof, a ramp, a hillside each has its own line, its own distance points on that line, and its own measuring points.

What the manuals did not have — and what makes this measurable rather than merely constructible — is the focal length. Without it a vanishing point is a place on the paper; with it, a vanishing point is a direction in space, and the angle between two of them is a physical angle. That is the step the round trip makes available, and it is why a gradient can be read off a photograph and could not be read off a drawing.

The measuring point, checked against the depths the camera produces6 equal depths of 0.62 m, laid out by the construction, land on the projected positions to 6e-14 px.246VPcorrect from 26 cm, at 160 mm wide34° across
Fig. 9 The classical construction on the ground plane, for comparison. Everything in it lives on the horizon; the ramp’s version is the same construction on a line rotated by the gradient.
The three vanishing points of one box, drawn to scale with the boxThe picture is the small rectangle. Two of the three vanishing points fall well outside it, which is why they are computed rather than located by eye.the pictureVP₁VP₂VP₃orthocentrefocal length from the triangle — 853.9 pxspread 1e-14% across three routes
Fig. 10 And the three points that make the calibration available. Two of them fall well outside the frame — computed rather than found by eye — which is why the ramp’s angle is arithmetic on measured lines rather than a reading taken off the paper.

Two ramps, and whether they are parallel

A question the second vanishing line answers immediately, and it is the kind of question a photograph is otherwise bad at.

Do two ramps have the same gradient? They do exactly when their vanishing lines are the same line. Not “nearly the same”: a vanishing line is determined by the plane’s direction alone, so two planes with equal gradient and equal bearing share it exactly, however far apart they are.

Do two ramps have the same gradient but different bearings? Then their lines are different, they cross the horizon at different points, and the gradients are compared by taking each one’s angle separately.

And is a roof plane parallel to the ramp? Same test, and it works across the whole picture — a roof at the far end of a street and a ramp in the foreground either share a line or do not.

The reason this is worth pointing at is that the comparison needs no measurement at all in the first case. Two families of lines converging on one line is a straightedge observation, and it settles a question about two planes’ relative orientation without a focal length, a scale, or anything else being known.

A box drawn from a known camera, and the camera recovered from the drawingThree vanishing points found from the twelve drawn edges alone give back the focal length to 4e-15 relative.recovered principal pointused to drawrecoveredgapfocal length853.90853.904e-15principal x345.0345.02e-12angle44.0°44.0°correct from 20 cm, at 160 mm wide44° across
Fig. 11 The input the angle formula needs, taken from the picture itself. Three vanishing points give the focal length, so a photograph with enough structure in it calibrates itself before measuring anything.
Projective, affine, metric — what each stage buysThe photograph fixes the plane only up to a projectivity: the midpoint of a receding side lands 0.3970 of the way along. Supplying the plane's vanishing line buys the midpoint back exactly and nothing else. Supplying the image of one circle buys the last three numbers, at which point the right angle is 90.000° and two equal sides measure 1.000000. The cross-ratio is 1.333333 in all three, because it was never lost.projectiveaffinemetricmidpointtwo equal sidesa right anglecross-ratioprojective1.333333333affine0.5000001.333333333metric0.5000001.00000090.000°1.333333333— means the stage does not determine it at allcross-ratio 1.333333 throughout
Fig. 12 And the chain the measurement sits on: what a picture of a plane determines at each level, and what each upgrade costs. A gradient is an angle, which arrives with the metric level.

What a photograph of a hill says

The practical reading, which is the reason this measurement has a use outside drawing.

A road’s gradient is measurable from a photograph taken from anywhere, with no access to the road. Find the horizon from the level parallels — a fence, the roofline of a terrace, the far bank of a canal. Find the road’s own vanishing point from its two kerbs. Take the angle. The answer is the gradient in degrees, and the road’s width, length and distance never enter.

A staircase is the same measurement, with the tread noses playing the across-slope direction and the stringers playing the uphill one.

A ramp photographed square-on gives nothing. If the camera looks along the across-slope direction, that direction’s vanishing point is at infinity and the ramp’s vanishing line cannot be drawn from it — the construction needs a second family, and the picture has one family and a direction parallel to the picture plane. It is the same degeneracy one-point perspective has, arriving on a different plane.

And a picture with only one family of parallels on the slope cannot do it. A single uphill line has no vanishing point of its own — one line meets nothing — so the construction needs the two kerbs, or the two stringers, or an uphill line and one line across the slope. That is a refusal about the evidence rather than about the geometry, and it is the usual one: a single post does not locate a lamp either.

The ramp's own horizonEvery plane has a vanishing line, and a ramp's is not the ground's. The ground's horizon is the lower line; the ramp's vanishing line is the upper one, and the ramp's uphill edges meet on it. The angle at the eye between that meeting point and the vanishing point of the same direction taken level is the gradient: 28.0000° recovered against 28° built, out of the picture alone.horizonlevelcorrect from 22 cm, at 160 mm wideslope recovered 28.0000° against 28° built
Fig. 13 The same measurement with the ramp on a different bearing. The vanishing line meets the horizon somewhere else — at the across-slope direction’s vanishing point — and the recovered gradient is unaffected, because the bearing and the gradient are separate facts about the plane.

Why this is the same essay as the tilted picture plane

One more connection, because the phase these essays belong to is about exactly this and the two halves are easy to keep apart.

Tilting the picture plane is tilting the surface a picture is cast onto, with the eye fixed. Tilting a ramp is tilting a plane in the world, with the picture unchanged. Two different things, and the same mathematics: a plane’s orientation shows up in a picture as a vanishing line, and the picture’s own plane shows up as where the principal point sits relative to those lines.

The pairing produces a small table worth carrying.

A plane in the world has a vanishing line, and its position says the plane’s direction.

The picture’s plane has no vanishing line of its own — it is where lines are drawn — and its orientation shows in which directions have finite vanishing points at all. Verticals converge exactly when the picture plane is not vertical.

So the ramp and the tilted camera are the same fact seen from the two ends of the projection, and the ramp is the easier one to hold: a plane leaning in the world produces a line leaning in the picture, and the amount of lean is the gradient.

Four figures of the same height, camera level at 1.60 mThe horizon cuts every one of them at 89.9% of its height — the eye height over the figure height — however far away it is.horizon = eye level, 1.60 m89.89%correct from 26 cm, at 160 mm widespread 0
Fig. 14 And the line the whole construction is measured against. The ground’s horizon, cutting every upright at the same fraction of its height — the reference the ramp’s own line is rotated away from.

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.

Angle from vanishing pointsFocal lengthGradientHorizonInclined planePicture planepoint at infinitysingle-view metrologyVanishing lineVanishing point