问题
Does anybody know an example combining SimpleCV with TKinter such as placing some widget on the Display? Thanks in advance.
回答1:
I answered this on our help forum at: http://help.simplecv.org
But to relay the message I put up an example here: https://github.com/ingenuitas/SimpleCV/blob/develop/SimpleCV/examples/display/tkinter-example.py
Here is the code:
import SimpleCV
import ImageTk #This has to be installed from the system repos
import Tkinter
import time
Tkinter.Tk()
image = SimpleCV.Image('http://i.imgur.com/FTKqh.jpg') #load the simplecv logo from the web
photo = ImageTk.PhotoImage(image.getPIL())
label = Tkinter.Label(image=photo)
label.image = photo # keep a reference!
label.pack() #show the image
time.sleep(5)
来源:https://stackoverflow.com/questions/12685984/combine-simplecv-with-tkinter-gui