不能对Tkin使用SimpleCV

2024-04-19 17:49:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在编写一个程序,它将使用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)

当我运行这个程序时,我的树莓Pi(特别是BrickPi)做了5秒钟的事情,但什么都没发生。会发生什么事?如何排除故障?你知道吗


Tags: thefrom图像imageimport程序网络time