不能将SimpleCV与Tkinter一起使用

时间:2015-08-18 20:21:54

标签: python tkinter raspberry-pi simplecv

我正在编写一个程序,其中包括使用Tkinter和SimpleCV从USB网络摄像头显示图像。首先,我尝试在Combine SimpleCV with TKinter GUI运行示例,但没有显示图像。代码是

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)

当我跑步时,我的Raspberry Pi(特别是BrickPi)做了五秒钟的事情,但没有任何可见的事情发生。会发生什么事?我该如何解决这个问题?

0 个答案:

没有答案