HoughFeature.lines_p#

HoughFeature.lines_p(minvotes: int, minlinelength: int = 30, maxlinegap: int = 10, seed: int | None = None) ndarray[source]#

Get probabilistic Hough lines

Parameters:
  • minvotes (int) – only return lines with at least this many votes

  • minlinelength (int) – minimum line length. Line segments shorter than that are rejected.

  • maxlinegap (int) – maximum allowed gap between points on the same line to link them.

Returns:

Hough lines, one per row as \((u_1, v_1, u_2, v_2)\)

Return type:

ndarray(n,4)

Return a set of line segments that have at least minvotes of support. Each line segment is described by its end points \((u_1, v_1)\) and \((u_2, v_2)\).

Important

Uses OpenCV function cv2.HoughLinesP which accepts single-channel, CV_8U images (images are pre-converted to uint8 when the Hough object is created).

Seealso:

plot_lines lines opencv.HoughLinesP