【问题标题】:Spectral Python imshow displaying scrambled imageSpectral Python imshow 显示乱码图像
【发布时间】:2021-06-14 22:52:31
【问题描述】:

我正在学习 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)

输出如下:

【问题讨论】:

    标签: spectral-python


    【解决方案1】:

    我建议您尝试以下命令,而不是 view=imshow(img, (RGB))`。 SpectralPython 具有智能,一旦您确定图像类型,即 *.lan 以正确格式显示图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-10
      • 1970-01-01
      • 2020-07-07
      • 1970-01-01
      • 1970-01-01
      • 2014-04-21
      相关资源
      最近更新 更多