0

Detect the thick shapes

I am coding a specific edge detection algorithm. The image is black and red as given below. I am trying to extract red points that make a horizontal or vertical line and trying to get rid of anything that doesn't make a line shape. Some odd shapes are the ones that I later circled in yellow. The problem is that I cannot define the shapes exactly. The thing is they are 'thick'. They can be solid as in the upper left yellow circle or in pieces like the one below it. The only thing is they do not help me making a horizontal and vertical line on the image.

I am coding in Matlab, but any idea of algorithms are also welcome.

A Doe
  • 301
  • 2
  • 14
  • 1
    It looks like you have a binary image. If you run [`bwconncomp`](http://uk.mathworks.com/help/images/ref/bwconncomp.html) you will get separate objects. Then you can compute the height to width ratio, and threshold it. If it is close to one (e.g. between 0.5 and 2), remove the object. Just an idea, not sure how good it will perform. – Vahe Tshitoyan Jun 15 '17 at 08:30
  • 1
    have you considered using points that help instead of finding points that don't help? do you have any knowledge about those lines? is their distance always the same? are they always horizontal? ... add more information and present more own efforts. we don't solve problems for you. – Piglet Jun 15 '17 at 09:20
  • They are either horizontal or vertical. Their distance changes, actually the ultimate goal is to unite horizontal and vertical lines that are close to each other and get lines that do not break and then measure their length and the distance among them. – A Doe Jun 15 '17 at 15:20
  • 1
    If that's your goal then there might be an easier way. Have you tried running Hough line detection on the image and just ignoring the blobs? – Tapio Jun 17 '17 at 08:03
  • About nothing in your example makes a line shape. With some bad faith (in your favor), I could circle five or six blobs, not more. I doubt you can do anything reliable based on blob shapes alone and you should look for global structures. –  Jun 18 '17 at 21:33

0 Answers0