How it works...
The Hough transform is a technique for the detection of any shapes parametrized and represented in a convenient mathematical form. Basically, for every pixel in a source image, the Hough transform finds a set of model parameters that satisfy the observation and stores them in table. Each pixel votes for a subset of possible models. Output detections are obtained via a voting procedure.
The detection of lines is implemented in the function cv2.HoughLineP. In fact, it does not implement the original Hough transform, but its optimized, probabilistic version. The function takes parameters such as the source image, voting space spatial resolution, voting space angular resolution, minimum votes threshold, minimum line length, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access