1、代码
# -*- coding:utf8 -*- import cv2 as cv cap = cv.VideoCapture(0) while (True): hx, frame = cap.read() if hx is False: print('read video error') exit(0) cv.imshow('video', frame) if cv.waitKey(1) & 0xFF == ord('q'): break
cap.release() cv.destroyAllWindows()
参考链接:
https://blog.csdn.net/guijianchouxyz/article/details/120719515
标签:python,frame,cap,cv2,read,mac,video,cv From: https://www.cnblogs.com/fireblackman/p/16619385.html