1

I have this picture:

picture

As you can see, some lines are not connected. These lines were drawn using semantic segmentation. What I want is to connect these lines, because I cannot improve my model any more. I was looking through cv2 ways to deal with this but couldn't find a way. Any help will be appreciated.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
  • try this link https://stackoverflow.com/questions/43859750/how-to-connect-broken-lines-in-a-binary-image-using-python-opencv i think could be helpfull to you if you haven't.....basically you will have to erode and dilate your image properly to complete the lines..properly – Sachin Rajput Dec 16 '20 at 20:05
  • I have tried this method but the problem is that my image is not horizontally/vertically dependent. – Artūras Drūteika Dec 16 '20 at 20:32
  • To connect broken lines/edges based on contour extremities have a look at this https://stackoverflow.com/questions/71811385/connecting-disjointed-lines-or-edges-in-binary-images/71816288#71816288 – Jeru Luke Apr 23 '22 at 15:42

0 Answers0