我正在学习Spectral Python,并使用their own documentation和示例图像文件将多光谱图像显示为RGB。然而,由于某些原因,我的图像似乎被打乱了。我已经通过在MultiSpec中打开图像文件对其进行了测试,它看起来是正常的,所以我认为该文件没有损坏。我的代码如下:
import spectral as s
import matplotlib as mpl
path = '/content/92AV3C.lan'
img = s.open_image(path)
print(img)
#Load and display hyperspectral image
arr = img.load()
view = s.imshow(arr, (29, 19, 9))
print(view)
#Load and display Ground truth image
gt = s.open_image('92AV3GT.GIS').read_band(0)
view = s.imshow(classes=gt)输出如下:

发布于 2021-11-09 04:21:33
我建议您尝试以下命令,而不是view=imshow(img,(RGB))`。一旦您识别出图像类型,即*.lan,SpectralPython就具备了以正确格式显示图像的智慧。
https://stackoverflow.com/questions/66675832
复制相似问题