One-Dimensional Minima and Maxima

Figure 1.9: Fitting a parabolic model and locating the maximum with subpixel accuracy.
Image fig_subpixel1

If the point of interest is the maximum or minimum of a one-dimensional sequence, its immediate neighborhood can be approximated by a quadratic function of the form $a x^2 + b x + c = y$. A quadratic is the lowest-degree function that can represent local minima or maxima.

Let $y_{-1}$, $y_0$, and $y_{+1}$ be the function values at offsets $-1$, $0$, and $+1$ from the pixel-precision minimum or maximum. The quadratic passing through these three points has the useful form

\begin{displaymath}
a = \frac{y_{+1} - 2 y_0 + y_{-1}}{2} \quad b = \frac{y_{+1} - y_{-1}}{2} \quad c = y_0
\end{displaymath} (1.131)

This curve has a maximum or minimum at
\begin{displaymath}
\hat{\delta}_x = -\frac{b}{2 a} = - \frac{y_{+1} - y_{-1}}{2 (y_{+1} - 2 y_0 + y_{-1} ) }
\end{displaymath} (1.132)

$\hat{\delta}_x$ is the offset from the previously identified maximum or minimum; that is, it represents only its subpixel component.

This equation also yields another useful result: if $y_0$ is a local maximum or minimum, then by definition its value is always less than or greater than both $y_{+1}$ and $y_{-1}$. From this observation, it is easy to show that $\hat{\delta}_x$ always lies between $-1/2$ and $1/2$.

An alternative formulation is obtained by denoting $\delta_{+}=y_{+1}-y_{0}$ and $\delta_{-}=y_{-1}-y_{0}$; the equation of the parabola then becomes

\begin{displaymath}
a = \frac{\delta_{+} + \delta_{-}}{2} \quad b = \frac{\delta_{+} - \delta_{-}}{2}
\end{displaymath} (1.133)

and the minimum occurs at
\begin{displaymath}
\hat{\delta}_x = - \frac{\delta_{+} - \delta_{-}}{2 (\delta_{+} + \delta_{-}) }
\end{displaymath} (1.134)

This makes clear that the location of the minimum is independent of $y_0$ and depends only on the deltas.

Paolo medici
2026-10-19