[][src]Function opencv::imgproc::hough_lines

pub fn hough_lines(
    image: &dyn ToInputArray,
    lines: &mut dyn ToOutputArray,
    rho: f64,
    theta: f64,
    threshold: i32,
    srn: f64,
    stn: f64,
    min_theta: f64,
    max_theta: f64
) -> Result<()>

Finds lines in a binary image using the standard Hough transform.

The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm for a good explanation of Hough transform.

Parameters

  • image: 8-bit, single-channel binary source image. The image may be modified by the function.
  • lines: Output vector of lines. Each line is represented by a 2 or 3 element vector inline formula or inline formula . inline formula is the distance from the coordinate origin inline formula (top-left corner of the image). inline formula is the line rotation angle in radians ( inline formula ). inline formula is the value of accumulator.
  • 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 ( inline formula ).
  • srn: 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.
  • stn: For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
  • min_theta: For standard and multi-scale Hough transform, minimum angle to check for lines. Must fall between 0 and max_theta.
  • max_theta: For standard and multi-scale Hough transform, maximum angle to check for lines. Must fall between min_theta and CV_PI.

C++ default parameters

  • srn: 0
  • stn: 0
  • min_theta: 0
  • max_theta: CV_PI