title: OpenCV erode what kernel to choose?
body: <p>I'm trying to erode my image:<br />
  <a href="https://i.stack.imgur.com/XfUpd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XfUpd.png" alt="enter image description here" /></a></p>
  <p>in order to get something close to this (my goal):<br />
  <a href="https://i.stack.imgur.com/JfTpn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JfTpn.png" alt="enter image description here" /></a></p>
  <p>I use this basic kernel of OpenCV</p>
  <pre><code>kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3))
  image_1 = cv2.erode(gray_overlay, kernel, iterations=1)
  </code></pre>
  <p>I know there are custom kernels, I have tried kernels with different weights, different sizes, but I can't get a satisfactory result (separation of squares without losing too much white surface)</p>
  <p>Could someone advise me on a kernel?</p>
  <p>Thanks you! :)</p>