'''
import scipy
pip install wxpython
PyOpenGL和Spectral需要本地安裝
可參考鏈接https://blog.csdn.net/qq_43204333/article/details/119837870
參考:https://blog.csdn.net/Tiandailan/article/details/132719745?spm=1001.2014.3001.5506
Mouse Functions:
left-click & drag -> Rotate cube (選擇)
CTRL+left-click & drag -> Zoom in/out(放大/縮?。?SHIFT+left-click & drag -> Pan(平移)
Keybinds:
l -> toggle light(調(diào)整亮度)
t/g -> stretch/compress z-dimension(拉伸)
h -> print help message(幫助信息)
q -> close window(關(guān)閉窗口)
'''
import wx
import scipy.io as sio
from spectral import *
app = wx.App()
path = r'E:\研二\課題\datasets\Harvard dataset\CZ_hsdb\imgb6.mat'
data = sio.loadmat(path)['ref']
spectral.settings.WX_GL_DEPTH_SIZE = 16
view_cube(data, bands = [29, 19, 9],background=[255,255,255])
# 啟動(dòng)GUI事件循環(huán)
app.MainLoop()
文章來源地址http://www.zghlxwxcb.cn/news/detail-724224.html
文章來源:http://www.zghlxwxcb.cn/news/detail-724224.html
到了這里,關(guān)于hypercube背景設(shè)置為白色,繪制高光譜3D立方體的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!