A synthetic office, end to end
The book works on a photograph of an office (Figure 42.1). Here you build a synthetic stand-in: a small office scene written as a list of 3D line segments. Each segment is one edge of the room, the bookshelf, the desk, or the bottle, and world coordinates are in centimeters. The camera looks into the room from a known position with known intrinsics. All of this is ground truth that the rest of the section recovers using only the projected 2D image.
Linear perspective
A 3D line projects to a 2D line that, as , ends at the vanishing point (equation 42.3). Equation 42.5 generalizes this through the full camera matrix: Two consequences come up again and again:- The vanishing point depends only on the line’s direction, not on where it starts. So all lines that are parallel in 3D meet at the same image point.
- All vanishing points of lines lying in a single plane lie on the plane’s horizon line.


Detecting vanishing points
Algorithm 1. Given a set of 2D line segments believed to be parallel in 3D:- For each pair of segments, compute their intersection in the image plane (the cross product of their homogeneous line vectors).
- Run RANSAC over those candidate intersections: a vanishing point is a location with many votes.
- Repeat for each direction. The office has three orthogonal world directions, so it has three vanishing points.

Measuring heights with the cross-ratio
For any four collinear points the cross-ratio is a projective invariant: it survives perspective projection unchanged (equation 42.6): This one invariant powers single-view metrology. The next cells demonstrate it, then use it (Algorithm 2 in the book) to measure the desk’s height from the projected image alone, given only that the bookshelf is 197 cm tall.
Algorithm 2: measuring the desk’s height
From the chapter, given image points (bookshelf bottom/top), (desk bottom/top), horizon line , and vertical vanishing point : Then the desk height comes out of the cross-ratio identity:
Algorithm 3: height propagation to supported objects
Once you know the desk’s height, the bottle resting on it becomes measurable too. You project the bottle’s height onto the bookshelf with the same construction, but take the desk top as the reference instead of the floor: The true bottle height in the synthetic scene is 25 cm.
Algorithm 4: axis calibration via cross-ratio
Given a vanishing point on a calibrated axis, the origin in the image, and an arbitrary reference point at world-distance from the origin, the cross-ratio determines the image position of every other tick: where is the projected position of . Solving for given gives the recipe.
Algorithm 5: locate a 3D point
Suppose you know a pixel lies on the ground plane, for example at the base of a chair. You can recover its 3D world coordinate by reading off the calibrated world-axis tick that the perpendicular from to the axis would hit. Equivalently, the back-projected ray from the camera through meets the known ground plane at exactly one 3D point, and that point is the recovered world position.

Camera calibration from three vanishing points
Algorithm 6. If the scene contains three mutually orthogonal directions with vanishing points , then orthogonality gives three linear constraints on (equation 42.9): Solve for the four free parameters of by SVD, then Cholesky-factor to recover , normalized so . On synthetic data you can check that the recovered matchesK_true.

Concluding remarks
A single view gives you three kinds of measurement:- Three vanishing points give the camera intrinsics, through the SVD of the orthogonality constraints on and a Cholesky factorization. On the synthetic office, comes back exactly.
- The cross-ratio along a vertical line gives the height of any object standing on the floor (Algorithm 2) or on a supporting plane (Algorithm 3). The desk comes back at 76 cm and the bottle at 25 cm, both matching the synthetic ground truth.
- The horizon line and calibrated world axes give the 3D position of any point on a known plane (Figure 42.20). Without a plane to anchor it, a single view leaves depth ambiguous.

