This file contains hidden or 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
from cv2 import cv2 | |
video = cv2.VideoCapture(0) | |
if not video.isOpened(): | |
print("Cannot open camera") | |
exit() | |
while True: | |
ret, frame = video.read() | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) |