版权声明:本文为博主原创文章,未经博主允许不得转载O(∩_∩)O https://blog.csdn.net/qq_38153833/article/details/86484138
import cv2
capture = cv2.VideoCapture(0)
while(True):
# 获取一帧
ret,frame = capture.read()
# 将这一帧转换为灰度图
# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',frame)
if cv2.waitKey(1) == ord('q'):
break