brand banner

Stereo: Range vs Disparity Is Nonlinear

Updated ยท 3 min read

Stereo: Range vs Disparity Is Nonlinear

Goal: show that range ๐‘ depends nonlinearly on disparity ๐‘‘, by differentiating. Linear means a constant first derivative and a zero second derivative. Both proofs below fail that test.

1. Proof 1: Stereo similar triangles

Two cameras with centres ๐‘‚๐ฟ and ๐‘‚๐‘…, baseline ๐ต and focal length ๐‘“, look at a point ๐‘ƒ at range ๐‘. Its images are ๐‘๐ฟ and ๐‘๐‘…, and its disparity is ๐‘‘=๐‘ฅ๐ฟโˆ’๐‘ฅ๐‘…, so the image points are ๐ตโˆ’๐‘‘ apart. The triangle ๐‘ƒ๐‘‚๐ฟ๐‘‚๐‘… (light) is similar to the triangle ๐‘ƒ๐‘๐ฟ๐‘๐‘… (dark):

Two cameras a baseline B apart with image planes at distance f; rays from point P at range Z form two similar triangles
๐ต๐ตโˆ’๐‘‘=๐‘๐‘โˆ’๐‘“โ‡’๐ต๐‘โˆ’๐ต๐‘“=๐ต๐‘โˆ’๐‘๐‘‘โ‡’๐‘=๐ต๐‘“๐‘‘.

๐ต and ๐‘“ are fixed, so differentiate with respect to ๐‘‘:

๐‘‘๐‘๐‘‘๐‘‘=โˆ’๐ต๐‘“๐‘‘2,๐‘‘2๐‘๐‘‘๐‘‘2=2๐ต๐‘“๐‘‘3โ‰ 0.

The slope depends on ๐‘‘, so the relation is nonlinear. In the other direction it is the same: ๐‘‘=๐ต๐‘“๐‘, so ๐‘‘๐‘‘๐‘‘๐‘=โˆ’๐ต๐‘“๐‘2.

Equivalently, ๐‘๐‘‘=๐ต๐‘“ is constant, so the graph is a hyperbola. Consequence: a fixed disparity error ๐›ฟ๐‘‘ gives a range error ๐›ฟ๐‘โ‰ˆ(๐‘2๐ต๐‘“)๐›ฟ๐‘‘. That error grows with the square of the range.

2. Proof 2: One fixed point ๐ถ (pinhole)

Two rays through a fixed point C, from heights o and o minus delta o on a wall, hitting the ground at a and a plus delta a

Set-up: a vertical wall on the left. A ray leaves it at height ๐‘œ, passes through a fixed point ๐ถ, and hits the ground at horizontal distance ๐‘Ž. ๐ถ is at height ๐‘ and at horizontal distance ๐‘” from the vertical line. Every ray passes through ๐ถ, which is exactly what a pinhole does.

The ray makes angle ๐›ฝ with the ground. There are two right triangles along it: the one above ๐ถ and the whole one.

tan๐›ฝ=๐‘œโˆ’๐‘๐‘”=๐‘œ๐‘Ž,tan๐›ฝ=๐‘๐‘Žโˆ’๐‘”.

The second form gives ๐‘”=๐‘Žโˆ’๐‘tan๐›ฝ.

Solve the first relation for ๐‘œ:

๐‘Ž(๐‘œโˆ’๐‘)=๐‘œ๐‘”โ‡’๐‘œ=๐‘Ž๐‘๐‘Žโˆ’๐‘”.

Differentiate with respect to ๐‘Ž, holding ๐‘ and ๐‘” fixed:

๐‘‘๐‘œ๐‘‘๐‘Ž=๐‘(๐‘Žโˆ’๐‘”)โˆ’๐‘Ž๐‘(๐‘Žโˆ’๐‘”)2=โˆ’๐‘๐‘”(๐‘Žโˆ’๐‘”)2,๐‘‘2๐‘œ๐‘‘๐‘Ž2=2๐‘๐‘”(๐‘Žโˆ’๐‘”)3โ‰ 0.

Again the slope depends on ๐‘Ž, so the relation is nonlinear. The minus sign matches the drawing: a lower point (๐‘œโˆ’ฮ”๐‘œ) sends its ray farther out (๐‘Ž+ฮ”๐‘Ž).

2.1. Link to Proof 1

Rearranging ๐‘Ž(๐‘œโˆ’๐‘)=๐‘œ๐‘” gives

(๐‘œโˆ’๐‘)(๐‘Žโˆ’๐‘”)=๐‘๐‘”.

This has the same form as ๐‘๐‘‘=๐ต๐‘“: a product of two measured quantities (each shifted by a constant) equals a constant. That is a hyperbola, so the two proofs say the same thing.

2.2. The ฮ” version

The red ๐›ผ ray in the diagram is the same set-up with ๐‘œโ†’๐‘œโˆ’ฮ”๐‘œ and ๐‘Žโ†’๐‘Ž+ฮ”๐‘Ž:

tan๐›ผ=๐‘œโˆ’ฮ”๐‘œโˆ’๐‘๐‘”=๐‘œโˆ’ฮ”๐‘œ๐‘Ž+ฮ”๐‘Ž.

Subtracting the ๐›ฝ equation shows that ฮ”๐‘œฮ”๐‘Ž depends on ๐‘Ž. That is the finite-difference version of the result above. Letting ฮ”๐‘Žโ†’0 gives ๐‘‘๐‘œ๐‘‘๐‘Ž.



ยฉ 2026 James Yap

Personal Website and Knowledge Base