Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Am I correct that what you want is a few dozen line segments connecting the nearby dots?

Assuming I am correct, you should try the Line Segment detector and the Probabilistic Hough Transform. It's possible that the skeletonization method could help, if what it's connecting is the parts of the line. If not, you can try connecting them yourself by doing a Morphology Closing operation with an appropriately sized and shaped kernel.

A suggested set of functions is this:

  • Threshold the image to binary values (OTSU should pick a good threshold on this image)
  • Morphology Close (You'll need to experiment to find a kernel that works reasonably well, possible a circle that's 5x5?)
  • OR Run the skeletonizing method here, if it's working.
  • Line Segment Detector or Probabilistic Hough Transform outputs a set of line segments.

Of course, you'll want to play around with the settings to try and get a good set of line candidates. I would start by forgoing the middle steps and seeing if the LSD or Hough can give you good results. The LSD seems to produce far more than the Probablistic Hough, but of course, that can mean more false hits.