Sampson Error

Figure 4.1: Between a manifold $\mathcal {V}$ and a point $\mathbf {p}$, we can identify the point at the minimum geometric distance $\hat {\mathbf {p}}$ and the point obtained using the Sampson approximation $\mathbf {x}$.
Image fig_sampson

Many data-regression problems require a metric for determining how far an $\mathbf {p}$ is from the true model. To do this, it would be useful to have an estimate $\hat {\mathbf {p}}$ of the observation without its noise component, that is, a data point that lies exactly on the model. Neither quantity can normally be obtained directly without introducing unknown auxiliary variables. However, these values can be estimated by linearizing the model function around the observation.

Let $\mathbf {p}$ be a noisy observation and let $f(\mathbf{x})=\mathbf{0}$ be a multidimensional manifold representing a geometric model. Suppose there is an ideal point $\hat{\mathbf p}$ on the manifold such that

\begin{displaymath}
\mathbf p=\hat{\mathbf p}+\boldsymbol\eta
\end{displaymath} (4.66)

where $\boldsymbol\eta$ represents observation noise.

The residual $f(\mathbf{p})$ is an algebraic measure of the distance between the point and the model and provides no useful information in absolute terms: replacing the function with a nonzero multiple of itself leaves the locus of points unchanged, but changes the function's value accordingly. For isotropic Gaussian noise, the maximum-likelihood metric is the geometric distance between the observed point $\mathbf p$ and the ideal point $\hat{\mathbf p}$ on the model, that is, the norm of the noise vector $\boldsymbol\eta$.

We therefore consider the problem of computing an approximate distance between the point $\mathbf{p} \in \mathbb{R}^m$ and a geometric manifold defined implicitly by the equation $f(\mathbf{x})=\mathbf{0}$, where

\begin{displaymath}f:\mathbb{R}^m \to \mathbb{R}^n \end{displaymath}

is a function differentiable in a neighborhood of $\mathbf {p}$.

By definition, the point $\hat {\mathbf {p}}$ on the manifold that is closest to the point $\mathbf {p}$ is the point that minimizes the geometric error

\begin{displaymath}
\hat{\mathbf{p}} = \argmin_\mathbf{x} \Vert \mathbf{p} - \mathbf{x} \Vert
\end{displaymath} (4.67)

subject to the constraint $f(\mathbf{x})=0$ (or, equivalently, $\min \Vert\boldsymbol\delta_{\mathbf x}\Vert^2$ subject to the constraint $f(\mathbf p+\boldsymbol\delta_{\mathbf x})=\mathbf 0$).

The difference between minimizing a linear algebraic quantity and minimizing a nonlinear geometric quantity has motivated the search for a possible compromise. The Sampson method, originally developed for manifolds such as conics, relies on an assumption that can also be applied to a range of other problems: the implicit function $f$ must be approximable by a linear function in a neighborhood of the point $\mathbf {p}$. The manifold defined by the constraint $f(\mathbf{x})=0$ can be approximated using a Taylor expansion:

\begin{displaymath}
\tilde{f}(\mathbf{x}) \approx f(\mathbf{p}) + \mathbf{J}_f \boldsymbol\delta_{\mathbf{x}} = \mathbf{0}
\end{displaymath} (4.68)

where $\mathbf{J}_f$ is the Jacobian matrix $n \times m$ of the function $f$ evaluated at $\mathbf {p}$ and $\boldsymbol\delta_{\mathbf{x}} = \mathbf{x}-\mathbf{p}$.

This is the equation of an affine subspace in $\mathbf {x}$ and, in the special case $n=1$, of a hyperplane. The distance between the point $\mathbf {p}$ and this linear approximation of the manifold is called the Sampson distance or approximate maximum likelihood (AML). The Sampson error is the geometric distance between the point and the linearized version of the function.

The problem is now to find the point $\mathbf {x}$ closest to $\mathbf {p}$, that is, to minimize $\Vert\boldsymbol\delta_{\mathbf{x}}\Vert$ subject to the linear constraint

\begin{displaymath}
\mathbf{J}_f \boldsymbol\delta_{\mathbf{x}} = -f(\mathbf{p})
\end{displaymath} (4.69)

Since this is a constrained minimization problem, its solution can be derived using Lagrange multipliers. Linearizing the constraint and assuming that $\mathbf{J}_f$ has full row rank gives

\begin{displaymath}
\boldsymbol\delta_{\mathbf{x}} = - \mathbf{J}_f^{\top} \left( \mathbf{J}_f \mathbf{J}_f^{\top} \right)^{-1} f(\mathbf{p})
\end{displaymath} (4.70)

which is the minimum correction, in the Euclidean norm, required to satisfy the linearized constraint. This result is interesting when compared with the Gauss-Newton method, Equation (4.58).

The vector $\boldsymbol\delta_{\mathbf x}$ is the minimum correction required to satisfy the linearized constraint. Its norm estimates the distance from the point $\mathbf p$ to the manifold and can be used, for example, in algorithms such as RANSAC to identify outliers, or as an alternative cost function to the Euclidean norm. The vector $\boldsymbol\delta_{\mathbf x}$ is the correction associated with the Sampson distance. The quantity

\begin{displaymath}
\Vert \boldsymbol\delta_x \Vert^2 = \boldsymbol\delta_x^{\t...
...t( \mathbf{J}_f \mathbf{J}_f^{\top} \right)^{-1} f(\mathbf{p})
\end{displaymath} (4.71)

is called the Sampson error (or distance) and gives the squared distance between the point and a point on the manifold (or, more precisely, its first-order approximation).

In the important special case $n=1$, the Sampson distance reduces to

\begin{displaymath}
\Vert \boldsymbol\delta_x \Vert^2 = \dfrac{\left( f(\mathbf{p}) \right)^{2}}{\left\Vert \nabla f(\mathbf{p}) \right\Vert^2}
\end{displaymath} (4.72)

Practical applications of the Sampson error include computing the distance between a point and a conic (see Section 4.6.7), the distance of a pair of points from a homography, and the distance between a pair of corresponding points with respect to the Fundamental matrix (Section 10.4.2).

The preceding formulation can be extended to the case of anisotropic noise by introducing a Mahalanobis metric:

\begin{displaymath}
\min_{\boldsymbol\delta_{\mathbf x}} \; \boldsymbol\delta_{...
...x}^{\top} \boldsymbol\Sigma^{-1} \boldsymbol\delta_{\mathbf x}
\end{displaymath} (4.73)

subject to the constraint

\begin{displaymath}f(\mathbf p+\boldsymbol\delta_{\mathbf x})=0. \end{displaymath}

The equation above therefore generalizes to
\begin{displaymath}
%\Vert \boldsymbol\delta_x \Vert^2 = \boldsymbol\delta_x^{\...
...oldsymbol\Sigma \mathbf{J}_f^{\top} \right)^{-1} f(\mathbf{p})
\end{displaymath} (4.74)

Paolo medici
2026-10-19