HoughFeature#
- class HoughFeature(image: _ImageBase, ntheta: int = 180, drho: int = 1)[source]#
Hough line features
- Parameters:
image (
Image) – greyscale imagentheta (int, optional) – number of steps in the
thetadirection, defaults to 180drho (int, optional) – increment size in the
rhodirection, defaults to 1
Create a Hough line feature object. It can be used to detect:
lines using the classical Hough algorithm
linesline segments using the probabilistic Hough algorithm
lines_p
The Hough accumulator is a 2D array that counts votes for lines
\[u \cos \theta + v \sin \theta = \rho\]with quantized parameters \(\theta\) and \(\rho\). The parameter \(\theta\) is quantized into
nthetasteps spanning the interval \([-\pi, \pi)\), while \(\rho\) is quantized into steps ofdrhospanning the vertical dimension of the image.Note
Lines are not detected until
linesorlines_pis called. This instance simply holds parameters.The OpenCV implementation works with
uint8images only, other formats will be converted touint8.
- References:
- Seealso:
lineslines_p
Methods
accumulator([skip])Compute the Hough accumulator
lines(minvotes)Get Hough lines
lines_p(minvotes[, minlinelength, ...])Get probabilistic Hough lines
plot_accumulator(**kwargs)Plot the Hough accumulator array
plot_lines(lines, *args, **kwargs)Plot Hough lines