Created
May 13, 2022 15:31
-
-
Save aimerneige/84e89caa9693c422f27b90578049cfd0 to your computer and use it in GitHub Desktop.
opencv camera
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import cv2 | |
cap = cv2.VideoCapture(0) | |
while True: | |
ret, frame = cap.read() | |
if ret: | |
frame = cv2.resize(frame, (0, 0), fx=0.5, fy=0.5) | |
cv2.imshow('camera', frame) | |
else: | |
break | |
if cv2.waitKey(10) == ord('q'): | |
# press q to exit | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment