Skip to contents

houghLinesP finds line segments in a binary image using the probabilistic Hough transform.

Usage

houghLinesP(
  image,
  rho,
  theta,
  threshold,
  min_line_length = 0,
  max_line_gap = 0
)

Arguments

image

An 8-bit (8U) single-channel (GRAY) binary Image object.

rho

The distance resolution of the accumulator in pixels.

theta

The angle resolution of the accumulator in radians.

threshold

The accumulator threshold parameter. Only lines that get more votes than that threshold are returned.

min_line_length

The minimum line length. Line segments shorter than that are rejected.

max_line_gap

The maximum allowed gap between points on the same line segment to link them.

Value

A matrix with 4 columns corresponding to the x and y coordinates of the extremities of each detected line.

See also

Author

Simon Garnier, garnier@njit.edu

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_canny <- canny(balloon, 50, 50)
lines <- houghLinesP(balloon_canny, 1, pi / 180, 80, 0, 50)