How to connect broken lines in a binary image using Python/Opencv
How can I make these lines connect at the target points? The image is a result of a skeletonization process. I'm trying to segment each line as a region using Watershed Transform. MikeE 's answer is quite good: using dilation and erosion morphological operations can help a lot in this context. I want to suggest a little improvement, taking advantage of the specific structure of the image at hand. Instead of using dilation/erosion with a general kernel, I suggest using a horizontal kernel that will connect the endpoints of the horizontal lines, but will not connect adjacent lines to one another