Initial Question:
I thought the following code should lead to the initial white pixel expanding, but this does not happen. How can I make dilate work in all directions?
img = np.zeros((11, 11), dtype='uint8')
img[5][5] = 255
dilated = cv2.dilate(img, (5, 5), iterations=3)
cv2.imshow("img", img)
cv2.imshow("dilated", dilated)
cv2.waitKey()
I tried running the code above and get a vertical line from the centre down. This seems to conflict with the description of dilate here. Why does this happen?
I am using python 3.9.7 and opencv 4.5.2.