Hough Transform

Figure: Example of the Hough Transform for detecting lines in polar coordinates: accumulator map (top right) for a single point (top left), and accumulator map (bottom right) for a set of collinear points together with outliers (bottom left).
Image fig_hough

Let $g(\mathbf{x}, \boldsymbol\beta)=0$ be a continuous manifold in $\mathbf {x}$ whose parameters $\boldsymbol\beta \in \mathbb{R}^m$ are to be estimated. To determine these parameters and fully define the function, a set of coordinates $S = \left\{ \mathbf{x}_1, \ldots, \mathbf{x}_n \right\}$ belonging to the function's locus is available; these may be noisy and, in particular, may include outliers.

The Hough Transform is a technique for grouping a “highly probable” set of points that satisfy certain parametric constraints (PIK92).

For each possible point $\boldsymbol\beta^{*}$ in parameter space, a vote $H(\boldsymbol\beta)$ of the form

\begin{displaymath}
H(\boldsymbol\beta^{*}) = \left\vert \left\{ \mathbf{x} : g(...
...oldsymbol\beta^{*}) = 0, \mathbf{x} \in S \right\} \right\vert
\end{displaymath} (4.137)

can be assigned, that is, the number of elements of $S$ that satisfy the constraint expressed by $g$. The parameter $\boldsymbol\beta^{*}$ that maximizes this vote is the statistically most probable solution to the problem.

Now let the function $p(\mathbf{x}, \boldsymbol\beta)$ be a likelihood measure for the pair $(\mathbf{x}, \boldsymbol\beta)$ with respect to the constraint expressed by $g(\mathbf{x}, \boldsymbol\beta)=0$. The function $p$ is usually binary, but it can readily be generalized to represent a probability. The Hough Transform $H(\boldsymbol\beta)$ can be constructed incrementally using the function $p$:

\begin{displaymath}
H(\boldsymbol\beta) = \sum_{i=1}^{n} p(\mathbf{x}_i, \boldsymbol\beta)
\end{displaymath} (4.138)

The Hough Transform is the sum of all these functions.

For certain constraints, this approach can be simplified further to reduce computational cost and memory usage.

Let $\beta_1,\ldots,\beta_m$ be quantizable, bounded parameters to be estimated, and let $f(\mathbf{x},\beta_2,\ldots,\beta_m)$ be a function such that the function $g(\mathbf{x}, \boldsymbol\beta)=0$ can be written as

\begin{displaymath}
\beta_1 = f(\mathbf{x}, \beta_2 \ldots \beta_m)
\end{displaymath} (4.139)

If the function $g$ can be expressed as in Equation (4.139), the discrete Hough Transform can be used to estimate the parameters $\boldsymbol\beta$ representing the most “probable” model among all the points $\mathbf {x}$ provided. For each element $\mathbf {x}$, the parameters $\beta_2 \ldots \beta_m$ can be varied over their ranges, and the values of $\beta_1$ returned by the function (4.139) can be entered into the accumulator image $H(\boldsymbol\beta)$.

In this way, an n-dimensional probability map can be generated from observations $\mathbf {x}$ affected by noise and potentially containing outliers. The Hough method can likewise estimate a model in the presence of a mixture of models with different parameters.

The performance of the Hough method improves as the number of constraints increases; for example, the parameter range associated with the sample $\mathbf {x}$ can be dynamically restricted. The Hough algorithm can be viewed as a degenerate form of template matching.

Hough is generally most useful when the model has only two parameters, since it can then be readily plotted on a two-dimensional map.

A very common example of the Hough Transform is one in which $g$ (the model) is a line, expressed in polar form as in Equation (1.82), where the parameters to be estimated are $\theta $ and $\rho$: it is clear that for each pair of points $(x,y)$ and every possible quantized, bounded angle $\theta $ (since an angle is a bounded parameter), there is exactly one $\rho$ that satisfies Equation (1.82).

It is therefore possible to create a map $H(\theta,\rho)$ in which, for each point $(x,y) \in S$ and each $\theta \in [\theta_{min}, \theta_{max}]$, the accumulator-map entry associated with $(\theta, \cos \theta x + \sin \theta y )$ is incremented; this relation satisfies Equation (1.82) for the line written in polar coordinates.

Paolo medici
2026-10-19