ImageTools
ProbabilisticHoughLine
detect lines segments using Probabilistic Hough Transform
Calling Sequence
Parameters
Description
Examples
Compatibility
ProbabilisticHoughLine(img, rho, theta, threshold, lineLength, lineGap)
img
-
Image
rho
algebraic , radial increment
theta
algebraic , angular increment in radian
threshold
posint , minimum number of points required to detect a line
lineLength
posint , minimum length of the line
lineGap
posint , maximum length of the gap between lines
The ProbabilisticHoughLine command detects line segments in img, and returns the detected line segments as an m by 4 Array, lines. Each line segment corresponds to a row of lines: linesi=xi1,yi1,xi2,yi2, where xi1,yi1 and xi2,yi2 are the two end points of the ith line segment.
This command is implemented by a call to the Intel Integrated Performance Primitives (IPP) library; in particular, its ippiHoughProbLine_8u32f_C1R command. For more details, see its documentation.
This command interprets integer coordinate values to represent the corners of pixels, like the commands in the ImageTools[Draw] package do. It always returns coordinates for the centers of pixels, so the coordinates returned are always half integers.
img should be a binary image, so calling EdgeDetect and Threshold are usually necessary before calling ProbabilisticHoughLine.
with⁡ImageTools:
img≔Read⁡cat⁡kernelopts⁡datadir,/images/Maplesoft.png
edge≔Threshold⁡EdgeDetect⁡img,1.5
Embed⁡edge
line≔ProbabilisticHoughLine⁡edge,1,π1800,80,50,10
DrawLine := proc(img, line) local i; for i to upperbound(line, 1) do Draw:-Line(img, line[i, 1], line[i, 2], line[i, 3], line[i, 4], [255, 0, 0]); end do; end proc:
DrawLine⁡img,line
Embed⁡img
The ImageTools[ProbabilisticHoughLine] command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
ImageTools[Draw][Line]
ImageTools[HoughLine]
Download Help Document