Image erosion and dilation with Scipy

前端 未结 2 1816
广开言路
广开言路 2021-02-19 15:07

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

2条回答
  •  太阳男子
    2021-02-19 15:39

    I was using the binary erosion instead of the grey erosion array. I converted the original image to greyscale by using flatten=true like so:

    im = scipy.misc.imread('flower.png', flatten=True).astype(np.uint8)
    

    then called:

    im1 = ndimage.grey_erosion(im, size=(15,15))
    

    And got a nicely eroded picture, although it is greyscale.

提交回复
热议问题