Class 1 摄像头操作

This commit is contained in:
Lion Chan 2018-01-22 00:20:06 +08:00
parent a72a7a6ab8
commit 2b4f3458c4
1 changed files with 17 additions and 0 deletions

17
Class001/pcvc001.py Normal file
View File

@ -0,0 +1,17 @@
# coding=utf-8
"""
Python OpenCV Class 001
"""
import cv2
CAP = cv2.VideoCapture(0)
while 1:
# 获取摄像头中的一帧画面
RET, FRAME = CAP.read()
# 显示一帧画面
cv2.imshow("capture", FRAME)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
CAP.release()
cv2.destroyAllWindows()