目录
- 1.python: 3.6.6 [64bit]
-
- 2.python packages:
- 1). opencv-python==3.4.1.15
- 2). opencv-contrib-python==4.4.0.42
-
- 3.python包下载安装出错,可以尝试一下方式:
- pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn <+python包>
- import cv2
-
- cap = cv2.VideoCapture(0)
-
- scaling_factor = 0.7
-
-
- while True:
- ret, frame = cap.read()
-
- frame = cv2.resize(frame, dsize=None, fx=scaling_factor, fy=scaling_factor, interpolation=cv2.INTER_AREA)
-
- cv2.imshow("Face recognition", frame)
-
- c = cv2.waitKey(1)
- if c == 27:
- break
-
-
- cap.release()
- cv2.destroyAllWindows()
