Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line Segment Detector vs Probabalistic Hough Transform

In OpenCV, there are two methods of detecting lines that give similar results in the form of a vector of endpoints - the Line Segments Detector (LSD) and the Probabilistic Hough Transform. (Discounting the standard Hough transform as the output given is in terms of equations, not line endpoints.)

I haven't been able to find a compare and contrast of these two line detection methods and their pros/cons. Thus - what is the difference between these two functions? Are there any particular benefits to using one method as opposed to the other?

Additionally, are there other lesser-known line detection methods (like LSD) that might be advantageous in some use cases?

like image 421
ELRG Avatar asked Mar 27 '17 15:03

ELRG


1 Answers

Line Segments Detector (LSD)

  • Takes a greyscale image as input
  • Designed to work without any parameter tuning
  • Runs in linear time
  • Gives subpixel accurate results
  • Useful for parameter-free edge detection
  • LSD paper by Grompone Von Gioi et al
  • Example implementation: using LSD to detect data matrices

(Progressive) Probabilistic Hough Transform

  • Takes a binary image as input
  • Has several tuning parameters; distance resolution (rho), angle resolution (theta), an accumulator threshold parameter (only those with enough votes are returned), minimum line length and maximum line gap
  • Time performance depends on parameters (but is improved over standard Hough transform)
  • Several runs may yield different results due to randomised nature
  • Useful for more specific line finding; parameters allow for tuning, and has option to combine segments (via maximum line gap parameter) to return single longer lines
  • The OpenCV implementation is the Progressive Probabilistic Hough Transform (with thanks to Dr. D.'s answer on this question)

Other algorithms

  • EDLines: a linear time line segment detector that utilises an edge detector. No OpenCV implementation as far as I know.

(With thanks to Micka's comment for pointing out the differences in input and potential uses)

like image 195
ELRG Avatar answered Jan 04 '23 08:01

ELRG