Holding the windows to display an HSI using spectral in Python

226 Views Asked by At

I am using spectral to view an hyperspectral image for a specific band in python. This is my code.

from spectral import *

img=open_image('flc1.lan')
view = imshow(img)
print(view)
gt=open_image('flc1.lan').read_band(0)
view1= imshow(classes=gt)
print(view1)

The image does pop up, but then closes. Is there any kind of function like waitkey to hold the window?

1

There are 1 best solutions below

1
On

As an alternative you can use :

envi.save_image(give_file_name, image_name, ext='hdr')

to save the image locally and view it later, at your discretion