Table of Contents

Method HoughLines

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

HoughLines(InputArray, double, double, int, double, double)

Finds lines in a binary image using standard Hough transform.

public static LineSegmentPolar[] HoughLines(InputArray image, double rho, double theta, int threshold, double srn = 0, double stn = 0)

Parameters

image InputArray

The 8-bit, single-channel, binary source image. The image may be modified by the function

rho double

Distance resolution of the accumulator in pixels

theta double

Angle resolution of the accumulator in radians

threshold int

The accumulator threshold parameter. Only those lines are returned that get enough votes ( > threshold )

srn double

For the multi-scale Hough transform it is the divisor for the distance resolution rho. [By default this is 0]

stn double

For the multi-scale Hough transform it is the divisor for the distance resolution theta. [By default this is 0]

Returns

LineSegmentPolar[]

The output vector of lines. Each line is represented by a two-element vector (rho, theta) . rho is the distance from the coordinate origin (0,0) (top-left corner of the image) and theta is the line rotation angle in radians