Question

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?

Was it helpful?

Solution

For unsmearing motion blur, you should look at deconvolution. The Hough transform might be helpful in finding the original motion vector (I suspect it would work fine for a bunch of parallel line segments), but deconvolution is what you'd use to get the original stars back out of it, and these guys use a different method for estimating the original motion vector:

before after

OTHER TIPS

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

Look at the LSD line segment detector, published with implementation details and source code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top