title: How can I dilate a binary image without closing holes with OpenCV
body: <p>How can I apply dilation to the binary image on the left without closing the hole in the loop? I'm also interested in doing it efficiently.</p>
  
  <p><a href="https://i.stack.imgur.com/6JUmq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6JUmq.png" alt="enter image description here"></a></p>
  
  <p><strong>Context</strong>: I need to train a CNN to read handwritten digits. Believe it or not, the image on the left is supposed to be a 9. Since the dataset has a lot of 9s written that way I may have a chance at training a model to recognise it. I do need to apply some dilation though, in order to get the digit thickness to be similar to that of the digits fed into the pre-trained model. I think if I lose the hole in the loop, I'll have no chance.</p>