spectralpython / spectral

Python module for hyperspectral image processing
MIT License
563 stars 138 forks source link

Display is not clear #128

Open qiangchi opened 2 years ago

qiangchi commented 2 years ago

image image

tboggs commented 2 years ago

What happens if you set the interpolation to "nearest"?

view2 = spy.imshow(classes=gt, title='gt', interpolation='nearest')
qiangchi commented 2 years ago

如果将插值设置为“最近”会发生什么?

view2 = spy.imshow(classes=gt, title='gt', interpolation='nearest')

Thank you, the problem is solved as well.I would also like to ask how the legend of the image is displayed? I tried to add the lable property but it doesn't seem to work.

tboggs commented 2 years ago

The module does not currently have a way to display a color legend. If that is something you need, you could call spy.get_rgb instead, which accepts the same parameters, then render the returned image with matplotlib, and create your own legend using the colors indexed in spy.spy_colors. The color at position i in spy_colors corresponds to value i in gt.