From 2b4f3458c410d2caf58e245c4f4f725a674c750d Mon Sep 17 00:00:00 2001 From: Lion Chan Date: Mon, 22 Jan 2018 00:20:06 +0800 Subject: [PATCH] =?UTF-8?q?Class=201=20=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Class001/pcvc001.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Class001/pcvc001.py diff --git a/Class001/pcvc001.py b/Class001/pcvc001.py new file mode 100644 index 0000000..ad12e14 --- /dev/null +++ b/Class001/pcvc001.py @@ -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()