Find line segments in a binary image using the probabilistic Hough transform.
Returns a vector (list) of line segments. Each line is represented by a 4-element vector (x1, y1, x2, y2), where (x1, y1) and (x2, y2) are the ending points of each detected line segment.
Note: ◼Pixel format of input image must be ie8g ◼You can draw the lines to a canvas using DrawLines ◼For a standard Hough transform, use houghLines
Parameter
Description
rho
Distance resolution of the accumulator in pixels
theta
Angle resolution of the accumulator in radians
threshold
Accumulator threshold parameter. Only those lines are returned that get enough votes
minLineLength
Minimum line length. Line segments shorter than that are rejected
maxLineGap
Maximum allowed gap between points on the same line to link them
Comparison of Line Detection Methods
// HOUGH TRANSFORM ImageEnView1.IEBitmap.PixelFormat := ie8g; ImageEnView1.IEBitmap.GetIEVisionImage().blur( IEVisionSize(3, 3), IEVisionPoint(-1, -1) ); ImageEnView1.IEBitmap.GetIEVisionImage().canny( 50, 200, 3 ); lines := ImageEnView1.IEBitmap.GetIEVisionImage().houghLinesP( 1, PI / 180, 200, 100, 10 ); for i := 0 to lines.size() - 1 do begin sc := lines.getScalarInt32(i);
// BINARY DESCRIPTOR lines := ImageEnView1.IEBitmap.GetIEVisionImage().detectLines( ievBinaryDescriptor ); for i := 0 to lines.size() - 1 do begin sc := lines.getScalarInt32(i);
// LSD DETECTOR lines := ImageEnView1.IEBitmap.GetIEVisionImage().detectLines( ievLSDDetector ); for i := 0 to lines.size() - 1 do begin sc := lines.getScalarInt32(i);