我使用這個Python腳本來顯示我的攝像頭顯示攝像頭流:PyQt4中使用OpenCV的攝像頭採集
from opencv.cv import *
from opencv.highgui import *
import sys
cvNamedWindow("w1", CV_WINDOW_AUTOSIZE)
camera_index = 0
capture = cvCreateCameraCapture(camera_index)
def repeat():
global capture #declare as globals since we are assigning to them now
global camera_index
frame = cvQueryFrame(capture)
cvShowImage("w1", frame)
c = cvWaitKey(10)
if c == "q":
sys.exit(0)
if __name__ == "__main__":
while True:
repeat()
這是合作得非常好,但我想設置我的Qt應用程序中此顯示。 如何將IplImage
OpenCV圖像用於Qt VideoWidget
?
http://code.google.com/p/opencv-extension-library/wiki/QtOpenCV看起來不錯,但如何與Python做呢? – Natim 2010-06-08 22:48:50