你如何使用python的enthought冠层分布读入内存高光谱图像(3d)?
安装Spectral Python (Spy)是最好的方法:
C:\Users\Me> pip install spectral
一旦安装了模块,就可以通过以下方式轻松地将高光谱图像读入内存:
>>> import spectral
>>> img = spectral.open_image(<HSI_filename>)
安装Spy包。使用ipython终端。
ipython --pylab
读取内存并查看HSI:
from spectral import*
import numpy as np
var=open_image(r"C:\<give_image_file_location>")
img= var.load() #save as ndarray
np.save(outimg, img) #save image to a binary file in .npy format
imshow(var) #view image in some bands