# Gap Filling Contours / Lines

I have the following image:

and I would like to fill in its contours (i.e. I would like to gap fill the lines in this image).

I have tried a morphological closing, but using a rectangular kernel of size 3x3 with 10 iterations does not fill in the entire border.

Try a 5x5 or 7x7 kernel

I tried an 11x11 rectangular kernel and that also did not work.

I am sorry, but this is doesnt seem impossible with erosion and dilation. Can you explain why this doesnt work?