The function cvHoughLines2 implements a few variants of Hough transform for line detection

C# | Visual Basic | Visual C++ |
public static IntPtr cvHoughLines2( IntPtr image, IntPtr lineStorage, HOUGH_TYPE method, double rho, double theta, int threshold, double param1, double param2 )

- image (IntPtr)
- The input 8-bit single-channel binary image. In case of probabilistic method the image is modified by the function
- lineStorage (IntPtr)
- The storage for the lines detected. It can be a memory storage (in this case a sequence of lines is created in the storage and returned by the function) or single row/single column matrix (CvMat*) of a particular type (see below) to which the lines' parameters are written. The matrix header is modified by the function so its cols or rows will contain a number of lines detected. If line_storage is a matrix and the actual number of lines exceeds the matrix size, the maximum possible number of lines is returned (in case of standard hough transform the lines are sorted by the accumulator value).
- method (HOUGH_TYPE)
- The Hough transform variant
- rho (Double)
- Distance resolution in pixel-related units
- theta (Double)
- Angle resolution measured in radians
- threshold (Int32)
- Threshold parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold
- param1 (Double)
- The first method-dependent parameter: For classical Hough transform it is not used (0). For probabilistic Hough transform it is the minimum line length. For multi-scale Hough transform it is divisor for distance resolution rho. (The coarse distance resolution will be rho and the accurate resolution will be (rho / param1))
- param2 (Double)
- The second method-dependent parameter: For classical Hough transform it is not used (0). For probabilistic Hough transform it is the maximum gap between line segments lieing on the same line to treat them as the single line segment (i.e. to join them). For multi-scale Hough transform it is divisor for angle resolution theta. (The coarse angle resolution will be theta and the accurate resolution will be (theta / param2)).

Pointer to the decetected lines