No jobs
Foundation 10 min 2 of 4

The pinhole model

Similar triangles, one division, and the reason depth is unrecoverable from one view.

What this repairs

Treating projection as "the camera matrix" rather than as a division by depth that destroys exactly one degree of freedom per pixel.

A pinhole camera is a plane with a hole in it and a sensor behind. Light from a scene point travels in a straight line through the hole and lands somewhere on the sensor. That is the entire physical model, and everything else is bookkeeping about coordinates.

Put the hole at the origin of the camera frame, with +Z+Z pointing into the scene. Put the image plane at Z=fZ = f in front of the hole rather than behind it — the real image is inverted, the virtual one is not, and since flipping twice is tedious, everyone uses the virtual plane and never mentions it again. Similar triangles then give

x=fXZ,y=fYZ.x = f\,\frac{X}{Z}, \qquad y = f\,\frac{Y}{Z}.

Now write it in homogeneous coordinates. With X=(X,Y,Z,1)\mathbf{X} = (X, Y, Z, 1)^\top and the image point x=(u,v,1)\mathbf{x} = (u, v, 1)^\top known only up to scale:

λ(uv1)=[f0000f000010](XYZ1).\lambda \begin{pmatrix} u \\ v \\ 1 \end{pmatrix} = \begin{bmatrix} f & 0 & 0 & 0 \\ 0 & f & 0 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{pmatrix} X \\ Y \\ Z \\ 1 \end{pmatrix}.

The matrix is linear. The division has not vanished — it hides in λ=Z\lambda = Z , and it reappears the moment you insist on a Euclidean answer. That is the trade homogeneous coordinates offer: the algebra becomes linear, and the nonlinearity is quarantined in one normalisation step at the end.

Check yourself

You double the focal length and halve the distance to every object. Do the images differ?

Show answer

In the pinhole model, the projected positions of points at exactly the doubled distance are identical — fX/Zf X / Z is unchanged when both ff and ZZ double. But the images are not the same: relative depths within the scene are not scaled the same way, so perspective changes. Faces photographed with a long lens from far away look flat; the same face at 20 cm with a wide lens does not. This is the "lens compression" effect, and it is a statement about ZZ ratios, not about lenses.

Euler View - ML Experiment Monitor