LearningPythonOpenCV/Class001/pcvc001.py

19 lines
334 B
Python
Executable File

#!/usr/bin/python3
# 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()