我正在使用这个 Python 脚本来显示我的网络摄像头:
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
?