Image erosion and dilation with Scipy

前端 未结 2 1808
广开言路
广开言路 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:32

    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.

提交回复
热议问题