title: OpenCV dilate() function not closing the gaps in all directions
body: <p>I'm trying to use the Python OpenCV <code>cv2.dilate()</code> function to close some gaps in my image. See the images below.</p>
  
  <p><strong>(1)</strong> Original image with the gaps to be closed.</p>
  
  <p><a href="https://i.stack.imgur.com/A83Ub.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A83Ub.jpg" alt="enter image description here"></a></p>
  
  <p><strong>(2)</strong> Dilated image with <strong>iterations=10</strong></p>
  
  <p><a href="https://i.stack.imgur.com/zstil.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zstil.jpg" alt="enter image description here"></a></p>
  
  <p><strong>(3)</strong> Dilated image with <strong>iterations=100</strong> and the supposed gaps that should be closed.</p>
  
  <p><a href="https://i.stack.imgur.com/8aO20.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8aO20.jpg" alt="enter image description here"></a></p>
  
  <p>Why is <code>dilate()</code> keeping those gaps? Am I missing some configuration?</p>
  
  <pre class="lang-py prettyprint-override"><code>cv2.dilate(thresh, (3,3), iterations=dilate_interations)
  </code></pre>