Start » Filter Reference » OpenCV » Feature Detection » cvHoughLines
Module: | OpenCV |
---|
Finds lines in a binary image using standard Hough transform.
Name | Type | Range | Description | |
---|---|---|---|---|
inImage | Image | UINT8, single-channel input image. | ||
inRho | Real | 0.1 - | Distance resolution of the accumulator in pixels. | |
inTheta | Real | 0.1 - | Angle resolution of the accumulator in degrees. | |
inThreshold | Integer | 1 - | Accumulator threshold parameter. | |
inSrn | Real | 0.0 - | For the multi-scale Hough transform, it is a divisor for the distance resolution rho. The coarse accumulator distance resolution is rho and the accurate accumulator resolution is rho/srn . If both srn=0 and stn=0 , the classical Hough transform is used. Otherwise, both these parameters should be positive. | |
inStn | Real | 0.0 - | For the multi-scale Hough transform, it is a divisor for the distance resolution theta. | |
inMinTheta | Double | For standard and multi-scale Hough transform, minimum angle to check for lines. | ||
inMaxTheta | Double | For standard and multi-scale Hough transform, maximum angle to check for lines. | ||
outLines | Line2DArray | Output array of lines. |
Description
The operation detects straight edges in the inImage using the Hough Transform approach and treats them as infinite lines. Input image is treated as binary image. Therefore all non-zero pixels are assumed to be edges.
Examples
Remarks
Note, that non-zero pixels are treated as edge, which is different approach from the one in cvHoughCircles filter. To obtain edges image, one can use i.e. cvCanny filter.
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Both inSrn and inStn should be positive or both should be zero in cvHoughLines. |
DomainError | Input image must be UINT8 single-channel in cvHoughLines. |
Complexity Level
This filter is available on Basic Complexity Level.
See Also
- cvHoughCircles – Finds circles in a grayscale image using a Hough transform.
- cvHoughLinesP – Finds lines segments in a binary image using probabilistic Hough transform.
- cvCanny – Finds edges in an image using Canny algorithm.