I've been thinking of an algorithm for object recognition but it would relies heavily on straight non-noisy lines and as far as I know this is hard to obtain with edge detection algorithms. What's the best edge detection algorithm to obtain lines as straight as possible?
You're probably looking for the Hough transform or one of it's extensions.
The simplest version of this transform is linear and appropriate for detecting straight lines.
In the transformed space (Hough space), angles and distances are found as points where curves intersect.
Libraries for calculating the Hough transform exist in
- C++ - OpenCV (Has Python bindings)
- Matlab -
hough
in the image processing toolbox - Python - Scikits-image
Related Questions and Answers
See this previous answer for more help on understanding the Hough transform.
-
$\begingroup$ Just one addition concerning libs: latest version of OpenCV not just has C++ bindings, but uses C++ classes in its core. Also consider using [new OpenCV website](opencv.org) for references. $\endgroup$ – ffriend Aug 7 '12 at 11:14
-
-
$\begingroup$ The scikit-image link is out of date. Here is the example I think you mean to reference: scikit-image.org/docs/dev/auto_examples/edges/… $\endgroup$ – lanery Feb 23 '18 at 11:26
you can use LSD line detector http://www.ipol.im/pub/algo/gjmr_line_segment_detector/