HoughFeature.accumulator#

HoughFeature.accumulator(skip: int = 1) None[source]#

Compute the Hough accumulator

Parameters:

skip (int, optional) – increment for line strength threshold, defaults to 1

It creates two new attributes for the instance:

  • A which is the Hough “accumulator” array, rows represent \(\rho\) and columns represent \(\theta\).

  • votes is a list of the number of lines found versus threshold, it can be used to select an optimal threshold.

  • extent is \([\theta_{\mbox{min}}, \theta_{\mbox{max}}, \rho_{\mbox{min}}, \rho_{\mbox{max}}]\).

Warning

The OpenCV HoughLines function does not expose the accumulator array. This method “reverse engineers” the accumulator array through a costly process of computing the Hough transform for all possible thresholds (increasing in steps of skip). This is helpful for pedagogy but very inefficient in practice.

Seealso:

plot_accumulator