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

Finds lines in a binary image using the standard Hough transform.
Returns a vector of lines. Each line is represented by a two-element vector, the distance from the coordinate origin and the distance from the coordinate origin).



Note: Pixel format of input image must be ie8g.

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

ImageEnView.IO.LoadFromFile('input.jpg');
ImageEnView.IEBitmap.PixelFormat := ie8g;
ImageEnView.IEBitmap.GetIEVisionImage().blur(IEVisionSize(3, 3), IEVisionPoint(-1, -1));
ImageEnView.IEBitmap.GetIEVisionImage().canny(50, 200, 3);
lines := ImageEnView.IEBitmap.GetIEVisionImage().houghLines(1, PI / 180, 200);