How to invert black and white with scikit-image?

后端 未结 5 1262
梦毁少年i
梦毁少年i 2021-01-01 23:30

I read an image with ndimage, which results in a binary image like this:

\"enter

5条回答
  •  半阙折子戏
    2021-01-02 00:07

    I like Pamungkas Jayuda's anwer, but it works only on the assumption that your data is an integer. In my case, I just used simple inversion with a small value on the denominator to avoid division by zero:

    1 / (2e5 + img)
    

提交回复
热议问题