cypher
cypher

Reputation: 13

Hyperspectral Image Processing with Python

How do you read into memory a hyperspectral image (3d) using python's enthought canopy distribution?

Upvotes: 0

Views: 3301

Answers (2)

fruitspunchsamurai
fruitspunchsamurai

Reputation: 21

install Spy package. use ipython terminal.

ipython --pylab

to read to memory and view 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

Upvotes: 0

Tonechas
Tonechas

Reputation: 13733

Installing Spectral Python (Spy) is the best way to go:

C:\Users\Me> pip install spectral

Once you get the module installed, reading a hyperspectral image into memory can be readily accomplished by:

>>> import spectral
>>> img = spectral.open_image(<HSI_filename>)

Upvotes: 3

Related Questions