PythonApplication1.rar

  • PUDN用户
    了解作者
  • Python
    开发工具
  • 4.8MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2015-06-18 07:16
    上传日期
Example for multispectral image processing in python using visual studio. NET
PythonApplication1.rar
  • PythonApplication1
  • PythonApplication1
  • 92AV3GT.GIS
    20.7KB
  • 92AV3C.spc
    10.7KB
  • 92AV3C.lan
    8.8MB
  • PythonApplication1.pyproj
    1.9KB
  • PythonApplication1.py
    3.1KB
  • PythonApplication1.sln
    859B
  • PythonApplication1.v12.suo
    18KB
内容介绍
#import matplotlib.pyplot as plt #import numpy as np #x=np.linspace(0,5,10) #y=x**2 #plt.plot(x,y,'r') #plt.show() #ejemplo 1 #from spectral import * #img = open_image('92AV3C.lan') #view = imshow(img, (29, 19, 9)) #print view #ejemplo2 #gt = open_image('92AV3GT.GIS').read_band(0) #view = imshow(classes=gt) import wx import os from spectral import * from spectral.graphics.hypercube import hypercube import matplotlib import OpenGL import PIL class Frame(wx.Frame): def __init__(self, title): wx.Frame.__init__(self, None, title=title, size=(1000,70),style=wx.MINIMIZE_BOX|wx.CLOSE_BOX|wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.CAPTION|wx.CLIP_CHILDREN) self.Bind(wx.EVT_CLOSE, self.OnClose) panel=wx.Panel(self,-1) self.button=wx.Button(panel,label="Open",pos=(0,0),size=(50,30)) self.button1=wx.Button(panel,label="Save",pos=(51,0),size=(50,30)) self.button2=wx.Button(panel,label="ROI",pos=(102,0),size=(50,30)) self.button3=wx.Button(panel,label="Tone",pos=(153,0),size=(50,30)) self.slider=wx.Slider(panel,pos=(204,0)) self.button4=wx.Button(panel,label="Header",pos=(305,0),size=(50,30)) self.button5=wx.Button(panel,label="Cube",pos=(356,0),size=(50,30)) self.SetBackgroundColour((11, 11, 11)) self.Bind(wx.EVT_BUTTON, self.OnCubeClick,self.button5) self.Bind(wx.EVT_BUTTON, self.OnHeadClick,self.button4) self.Bind(wx.EVT_BUTTON, self.OnSaveClick,self.button1) self.Bind(wx.EVT_BUTTON, self.OnButtonClick,self.button) self.loc=wx.TextCtrl(panel,pos=(700,0), size=(300,-1)) def OnButtonClick(self,event): wild="HSi Files|*.lan*|All Files|*.*" dlg=wx.FileDialog(self,message="Choose a File",wildcard=wild,style=wx.FD_OPEN) if dlg.ShowModal() == wx.ID_OK: self.loc.SetValue(dlg.GetPath()) dlg.Destroy() #self.Onview() def Onview(self): filepath=self.loc.GetValue() img=image(filepath) view(img) def OnHeadClick(self,event): fileo=self.loc.GetValue() img=image(fileo) img.__class__ print img def OnCubeClick(self,event): fileo=self.loc.GetValue() img= image(fileo).load() (m, c) = cluster(img, 20) view_indexed(m) def OnSaveClick(self,event): wild="HSi Files|*.lan*|All Files|*.*" dlg=wx.FileDialog(self,message="Save AS",wildcard=wild,style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) if dlg.ShowModal() == wx.ID_OK: path=dlg.GetPath() self.Save(path) self.file=path dlg.Destroy() def OnClose(self, event): dlg = wx.MessageDialog(self, "Do you really want to close BBvw ?", "Confirm Exit", wx.OK|wx.CANCEL|wx.ICON_QUESTION) result = dlg.ShowModal() dlg.Destroy() if result == wx.ID_OK: self.Destroy() app = wx.App(redirect=True) top = Frame("BBvw") top.Show() app.MainLoop()
评论
    相关推荐