The ramp has its own horizon
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.
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 and correspond to directions and in the camera’s own frame, where 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 = the uphill direction’s vanishing point, on the ramp’s line, and = 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.
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.
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 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.
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.
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.
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.
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.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The horizon, and the fraction — both name horizon, picture plane, point at infinity, single-view metrology, vanishing line
- A lens destroys the invariant — both name focal length, horizon, single-view metrology, vanishing point
- A scroll is a camera that moves — both name focal length, picture plane, point at infinity
- How wrong a measurement from one picture can be — both name horizon, single-view metrology, vanishing point
- The cube that is a box — both name focal length, horizon, vanishing point
- The distance point is the viewing distance, drawn — both name focal length, horizon, vanishing point
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