views:

749

answers:

2

I'm trying to detect line segments in an image.

From what I gather, the Hough algorithm detects lines but not segments.

Does anyone know of how I would go about this, or any libraries suitable for this?

Im my case, I'm trying to detect star trails (which for these purposes are all straight) from a photograph so I can reduce them back to points.

If it's important, I'm trying to implement this in C#

Any ideas?

+1  A: 

The openCV Hough transform cvHoughLines2 has a probabilistic mode that detects line segments:

  • CV_HOUGH_PROBABILISTIC - probabilistic Hough transform (more efficient in case if picture contains a few long linear segments). It returns line segments rather than the whole lines. Every segment is represented by starting and ending points, and the matrix must be (the created sequence will be) of CV_32SC4 type.

I have tested it and it works

HugoRune
+2  A: 
endolith