编程语言
首页 > 编程语言> > Python Spectral.view_cube()卡死

Python Spectral.view_cube()卡死

作者:互联网

今天尝试使用Spectral.view_cube()时,输出的超立方直接卡死

 使用如下代码也无法正常运行

spectral.settings.WX_GL_DEPTH_SIZE=16

 查了资料以后发现wxpython是python中的一个GUI框架,于是利用以前调试tkinter的bug办法进行尝试。

import spectral
import numpy as np
import wx
img = spectral.envi.open('test.hdr', 'test0.dat' )
info=img.metadata
v=img[:,:,:]
vmax=v.max(axis=(0,1))
vmin=v.min(axis=(0,1))
vv=(v-vmin)/(vmax-vmin)*255
vv=vv.astype(np.uint8)
app=wx.App()
spectral.settings.WX_GL_DEPTH_SIZE=16
spectral.view_cube(vv,bands=[29,19,9])
app.MainLoop()
#app.ExitMainLoop()
#wx.Exit()

 

https://zhuanlan.zhihu.com/p/267305478

https://blog.csdn.net/gwj992/article/details/79274511

标签:Spectral,spectral,cube,vmin,img,Python,vv,import
来源: https://blog.csdn.net/weixin_43995293/article/details/119907712