首页 > 解决方案 > 如何读取多光谱图像?

问题描述

我有带有.tif扩展名的多光谱图像。如何使用 Python 读取此类多光谱图像?

标签: pythontiff

解决方案


Pillow 模块支持您可能喜欢的“多帧 TIFF 图像”。你能提供一个你想打开的示例文件吗?你期望里面有什么?

https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#reading-multi-frame-tiff-images

这可能会完成这项工作:

from PIL import Image
im = Image.open("image.tif")

print(im.num_frames)
im.seek(im.tell() + 1))

推荐阅读