Triangulation

Figure 10.2: Example of triangulation. Given the camera calibration, the world point $\mathbf {x}$ can be recovered from its projections in at least two images ( $\mathbf {p_1}, \mathbf {p_2}, \ldots $). However, because of noise, the resulting lines do not pass through the point $\mathbf {x}$ and may not intersect. The maximum-likelihood solution requires minimizing the sum of squared errors between the observed point $\mathbf {p}_i$ and the predicted point $\hat {\mathbf {p}}_i$.
Image fig_triangulate

As Figure 10.2 illustrates, in the absence of noise the solution to the triangulation problem is the intersection of the optical rays associated with the observations in the different images. This problem can readily be extended to $n$ cameras with known relative poses. If the relative pose is unknown, it can be estimated directly from the images, up to a scale factor, using techniques such as the Essential matrix (Section 10.4).

Because of errors in locating corresponding points (calibration errors are a separate issue), the lines formed by the optical rays are generally skew. In that case, the solution closest under some cost function must be found. A least-squares solution is always possible with $n \geq 2$, using techniques such as Forward Intersections or the Direct Linear Transform (DLT).

Each optical ray subtended by an image pixel $(u_i,v_i)$, where $i=1, \ldots, n$ denotes the ith view, must satisfy equation (10.9). In the absence of noise, the intersection (Forward Intersections) of all these rays is the solution to the following, potentially overdetermined, linear system, with $3+n$ unknowns in $3n$ equations:

\begin{displaymath}
\left\{
\begin{array}{rl}
\mathbf{x}&= \lambda_1 \mathbf{v}_...
...x}&= \lambda_n \mathbf{v}_n + \mathbf{t}_n
\end{array}\right.
\end{displaymath} (10.13)

where $\mathbf{v}_i = \mathbf{R}^{-1}_i \mathbf{K}^{-1}_i \begin{pmatrix}u_i &v_i&1 \end{pmatrix}^{\top}$ denotes the direction vector of the optical ray in world coordinates. The unknowns are the world point to be estimated, $\mathbf {x}$, and the depth parameters $\lambda_i$ along the respective optical rays.

A closed-form solution for the special case of just two lines is given in Section 1.6.8. This technique can be applied to the case of one camera aligned with the axes and a second camera positioned relative to the first according to relationship (10.5).

Using the properties of the cross product, the same expression can be obtained from the perspective projection matrices and image points, expressed below in homogeneous coordinates:

\begin{displaymath}
\left\{
\begin{array}{l}
\left[ \mathbf{p}_{1} \right]_{\tim...
...right]_{\times} \mathbf{P}_n \mathbf{x} = 0
\end{array}\right.
\end{displaymath} (10.14)

where $[\cdot]_{\times}$ is the cross product written in matrix form. Each of these constraints provides three equations, but only two are linearly independent. All the constraints can then be rearranged into a homogeneous system of the form
\begin{displaymath}
\mathbf{A} \mathbf{x} = 0
\end{displaymath} (10.15)

where $\mathbf{A}$ is a matrix $2n \times 4$, with $n$ denoting the number of views in which the point $\mathbf {x}$ is observed. The solution to the homogeneous system (10.15) can be obtained using singular value decomposition. This approach is called the Direct Linear Transform (DLT), by analogy with the calibration technique.

However, minimizing in world coordinates is not optimal for minimizing noise. Without additional information about the structure of the observed scene, the optimal estimate (Maximum Likelihood Estimation) is the one that minimizes the error in image coordinates (reprojection). This requires greater computational cost and nonlinear techniques, since the cost function to be minimized is

\begin{displaymath}
\argmin_\mathbf{x} \sum_{i=1}^{n} \Vert \mathbf{p}_i - \hat{\mathbf{p}}_i \Vert^2
\end{displaymath} (10.16)

where $\hat{\mathbf{p}}_i \equiv \mathbf{P}_i \mathbf{x}$ and $\mathbf{P}_i$ is the projection matrix for the ith image (Figure 10.2).

This is a non-linear, non-convex problem, potentially with several local minima. The linear solution must be used as the starting point for the minimization.

An alternative approach is to estimate the relative pose between two cameras using the Essential matrix. Once the pose is known, the observed three-dimensional points can be reconstructed by triangulation, as shown in Section 10.4.4.

Paolo medici
2026-10-19