Hough Lines

Block Category: Detection

Input Image Format

Input Image Requirements: None

Description: The Hough Lines block works in conjunction with the Canny’s Edge block to detect straight lines in the specified image based on minimum line intersections, minimum line lengths, and maximum line gaps. While the Hough algorithm only works on gray scale images, the Hough Lines block automatically converts the input image to gray scale, if necessary.

To display the detected lines, wire the Hough Lines block to a Draw Lines block. Similarly, to count detected lines, wire the Hough Lines block to a Count Objects block.

Min. Intersections: Specifies the minimum line intersections to be detected.

Min. Line Length: Specifies the minimum line length to be detected.

Max. Line Gap: Specifies the maximum line gap to be detected.

Example

In this example, Canny’s Edge detects and retains edges that meet the threshold specifications. The Hough Lines block finds straight lines within the detected edges based on intersection, line length, and line gap specifications. The Draw Lines block displays the image with red lines drawn on the detected lines.

HoughLinesExample