ProbabilisticHoughLine - Maple Help

Home : Support : Online Help : Programming : ImageTools Package : ProbabilisticHoughLine

ImageTools

 ProbabilisticHoughLine
 detect lines segments using Probabilistic Hough Transform

 Calling Sequence ProbabilisticHoughLine(img, rho, theta, threshold, lineLength, lineGap)

Parameters

 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

Description

 • 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: ${\mathrm{lines}}_{i}=\left[{\left({x}_{i}\right)}_{1},{\left({y}_{i}\right)}_{1},{\left({x}_{i}\right)}_{2},{\left({y}_{i}\right)}_{2}\right]$, where $\left[{\left({x}_{i}\right)}_{1},{\left({y}_{i}\right)}_{1}\right]$ and $\left[{\left({x}_{i}\right)}_{2},{\left({y}_{i}\right)}_{2}\right]$ 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.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{img}≔\mathrm{Read}\left(\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/images/Maplesoft.png"\right)\right)$
 > $\mathrm{edge}≔\mathrm{Threshold}\left(\mathrm{EdgeDetect}\left(\mathrm{img}\right),1.5\right)$
 > $\mathrm{Embed}\left(\mathrm{edge}\right)$

 > $\mathrm{line}≔\mathrm{ProbabilisticHoughLine}\left(\mathrm{edge},1,\frac{\mathrm{Pi}}{1800},80,50,10\right)$
 > 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:
 > $\mathrm{DrawLine}\left(\mathrm{img},\mathrm{line}\right)$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Compatibility

 • The ImageTools[ProbabilisticHoughLine] command was introduced in Maple 2020.