I am trying to use scipy to do erosion and dilation of an image. It seems pretty straightforward using scipy -> binary_erosion / dialation. However, the output is n
You have two problems: as noted in the comment by @theta, binary ops expect input consisting only of 0 and 1. The second issue is the nd in ndimage --- you supply in an array of shape (nx, ny, 3). The last length-3 axis is considered to be a third spatial dimension, not the three color channels.