herd

python opencv 读取摄像头数据

import os
import cv2

cap = cv2.VideoCapture(2)  

while True:
    res, img0 = cap.read()  # BGR
    cv2.imshow("win1",cv2.resize(img0,(640,480)))

    if cv2.waitKey(5) & 0xFF==ord(\'q\'):
        cv2.destroyAllWindows()
        break
cap.release()

 

 

分类:

技术点:

相关文章: