Combine SimpleCV with TKinter GUI

我只是一个虾纸丫 提交于 2020-01-06 03:59:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!