ImageEn, unit ievision

TIEVisionImage.houghLines

TIEVisionImage.houghLines


Declaration

function houghLines(rho: double; theta: double; threshold: int32_t; srn: double = 0; stn: double = 0): TIEVisionVectorFloatPair; safecall;


Description

Find lines in a binary image using the standard Hough transform.
Returns a vector (list) of lines. Each line is represented by a two-element vector, where the first value is the distance from the coordinate origin (p) and the second value is the angle to the center of that perpindicular line (theta).



Note:
Pixel format of input image must be ie8g
You can draw the lines to a canvas using DrawLines
For a probabilistic Hough transform, use houghLinesP

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
srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho
stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta




Demo

Demo  Demos\IEVision\LinesDetect\LinesDetect.dpr


Example

ImageEnView1.IO.LoadFromFile('input.jpg');
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().houghLines(1, PI / 180, 200);