John G.
John G.

Reputation: 67

Spectral Python imshow displaying scrambled image

I am learning Spectral Python and using their own documentation and sample image files to display a multispectral image as RGB. However, for some reason, my image appears scrambled up. I have tested the image file by opening it in MultiSpec and it appears as it should, so I do not think the file is damaged. My code is as follows:

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)

Output is as follows:

enter image description here

Upvotes: 0

Views: 1128

Answers (1)

Brian S. Penn
Brian S. Penn

Reputation: 34

I suggest that you try the following command instead of view=imshow(img, (RGB))`. SpectralPython has the smarts, once you identify the image type, i.e., *.lan to display the image in the correct format.

Upvotes: 0

Related Questions