opencv调用摄像头摄像并进行处理时有卡顿

应当将摄像做为一个线程来进行采集数据,例程(python):python

import cv2
import threading
...
cap = cv2.VideoCapture(0)
...
def captureFrame():
    ret, frame = cap.read()
    


thread1 = threading.Thread(target=captureFrame, args=())