Python-转换.tif二进制图像

问题描述 投票:0回答:1

我正在将Google Colab与Jupyter Notebook 3一起使用。

我需要反转一个.tif二进制图像,使其为零,而将零为1。

我该怎么做? (我仍然需要将图像保存为.tif)

python-3.x image-processing google-colaboratory tiff
1个回答
0
投票

使用软件包imageio

使用功能imread读取图像

反转ndarray

使用imwrite保存图像

https://imageio.readthedocs.io/en/stable/userapi.html

© www.soinside.com 2019 - 2024. All rights reserved.