Triangulation

Given camera poses and corresponding image points in two or more views, triangulation recovers the 3D point that generated them. It is the step that turns matched 2D observations into map geometry.

DLT Method

For camera ii with projection matrix PiP_i and observed homogeneous point pi=[ui,vi,1]T\mathbf{p}_i = [u_i, v_i, 1]^T, projection gives λipi=PiX\lambda_i \mathbf{p}_i = P_i\mathbf{X}. Cross-multiplying eliminates the unknown scale λi\lambda_i:

pi×(PiX)=0\mathbf{p}_i \times (P_i\mathbf{X}) = \mathbf{0}

Writing PiP_i‘s rows as r1T,r2T,r3T\mathbf{r}_1^T, \mathbf{r}_2^T, \mathbf{r}_3^T, the two independent equations per view are

(uir3Tr1T)X=0,(vir3Tr2T)X=0\big(u_i\,\mathbf{r}_3^T - \mathbf{r}_1^T\big)\mathbf{X} = 0, \qquad \big(v_i\,\mathbf{r}_3^T - \mathbf{r}_2^T\big)\mathbf{X} = 0

Stacking the equations from NN views gives a homogeneous system:

AX=0,AR2N×4A\mathbf{X} = \mathbf{0}, \qquad A \in \mathbb{R}^{2N \times 4}

The least-squares solution is the right singular vector of AA corresponding to the smallest singular value — a direct application of SVD. This is the Direct Linear Transform (DLT) method. Divide the homogeneous solution by its fourth component to obtain the Euclidean point.

Mid-point Method

The mid-point method finds the 3D point that minimizes the sum of squared distances to the projection rays:

X=argminXid2(X, rayi)\mathbf{X}^* = \arg\min_{\mathbf{X}} \sum_i d^2(\mathbf{X},\ \mathrm{ray}_i)

This has a closed-form solution and is preferred when the rays are nearly parallel (e.g., near-forward motion, where DLT becomes poorly conditioned). For two views it reduces to finding the shortest segment between the two rays and taking its midpoint.

The stereo special case

For a rectified stereo pair with baseline bb and focal length fxf_x, triangulation collapses to a one-line formula. A point at depth ZZ appears with horizontal disparity dd between the two images, and

Z=bfxdZ = \frac{b\, f_x}{d}

Because depth is inversely proportional to disparity, a fixed matching error of a fraction of a pixel translates into a depth error that grows rapidly with distance — the reason stereo (and triangulation generally) degrades for far-away points and small baselines.

Quality checks used in real systems

Common pitfalls

Why it matters for SLAM

Triangulation is how a SLAM map grows: after epipolar geometry (or PnP) provides camera poses, every new feature match becomes a candidate 3D landmark via triangulation. It is also half of the classic monocular bootstrapping recipe — recover relative pose from the essential matrix, then triangulate the initial map — and the quality checks around it (parallax, reprojection error, positive depth) are what separate robust systems from fragile ones.

Hands-on