I've been working for a while on a pet problem. The task is to identify and segment out the dark lines and possibly the wiggly ones too.

I'm not looking for anyone to solve this problem for me...I'm just at the point where I feel I'm losing my footing and could benefit from some ideas!

I've so far focussed on neural networks with varying degrees of not-super-success. The nns haven't given much more success than some threshholding. I have tried edge detection but the results look messy. A shrink, laplace, expand showed some promise. Hough transforms...it seems they should work but not yet(for me, anyway).

thanks.example of source image from which to extract the dark lines

  • 1
    $\begingroup$ what is that thing? $\endgroup$ – Aaron Mar 7 '14 at 9:15
  • $\begingroup$ @TomHall I reckon an autoencoder could be used to learn features and then one could put a classification layer. I have been following cs.toronto.edu/~vmnih/docs/Mnih_Volodymyr_PhD_Thesis.pdf and some of the techniques they used. The prediction of a small area using a larger context is the way to go. I have had some issues, however...so I'm looking for another strategy to give my brain a break. An autoencoder would use a similar approach to the 'pre-training' that Minh-Hinton did. I've been trying to skip the pretraining by using some dropout. $\endgroup$ – user1269942 Mar 7 '14 at 18:12
  • $\begingroup$ @Aaron it's an image that was created from a lidar point cloud. $\endgroup$ – user1269942 Mar 7 '14 at 18:12
  • 2
    $\begingroup$ You might have better luck over at the signal processing stackexchange. This is basically their bag. dsp.stackexchange.com $\endgroup$ – David Marx Mar 7 '14 at 20:56
  • $\begingroup$ @user1269942 lidar point cloud of what? What is the nature of the scene/object being scanned with lidar? It is not vital piece of info for an answer, I am just curious. $\endgroup$ – visoft Mar 19 '14 at 20:21

Those are nice long and straight lines, so with the right pre-processing I'm confident the Hough transform will find them. I think the key is the pre-processing step - you'll want to enhance line-like structures at a local level.

One option would be to use Gabor filters. At each location, apply a bank of filters at different orientations, and keep the strongest result (this will occur when the filter is aligned with the line). Next, apply a global threshold. The output should have good coverage for line pixels, and noise scattered pretty randomly everywhere else. Now you're ready to apply the Hough transform. Hope that helps.

  • $\begingroup$ That's exactly what I'd do. As for the wiggly lines, just dilate it once or twice with a small structuring element - so the wiggle will roughly become a straight line - and run Hough line detection. $\endgroup$ – felipeduque Nov 27 '15 at 13:47

Autoencoder is a model using Neural Networks to extract features. However it is a unsupervised learning algorithm, we cannot sure what feature could be found. It is possible for it to find a line to be an valuable feature if the line is obvious and clear, or appear in many pictures.

I have no experience in filters, but I think what @NGY mentioned are more important.


In retinal images there is an issue that is detecting vessels. One of the used approaches is the use of a matched filter (basically a filter with a kernel similar to structure that you want to detect). Maybe this filter can be used as preprocessing.

Another idea based on vessel segmentation is the use of a top-hat filtering with a linear structure.

You can look in to both of these ideas in here (the top hat in this case is in a binary image, but can use it in a greyscale image):


  • $\begingroup$ I will add to this answer that one of the major algorithm used to extract vessel from an image in medical image processing is Frangi algorithm. $\endgroup$ – Al_th Mar 10 '14 at 10:04

I ran this through Grompone von Gioi's Line Segment Detector and got this: result of Line Segment Detector

Of course, the segment detector returns the coordinates of the segments, so you could run a simple RANSAC filter on the data, and you should get a decent result. If your feeling lazy, you could run a Hough filter on this output image and get a reasonable result, though that's a bit of a hack. As mentioned, reprocessing will return a much better result. Perhaps with some sort of steerable filter.

ref: http://www.ipol.im/pub/art/2012/gjmr-lsd/


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.