Skip to content

Instantly share code, notes, and snippets.

View Guohao91's full-sized avatar
🏠
Working from home

Guohao Guohao91

🏠
Working from home
View GitHub Profile
@Guohao91
Guohao91 / webcam-cv2.py
Created April 1, 2020 17:49 — forked from tedmiston/webcam-cv2.py
Display the webcam in Python using OpenCV (cv2)
"""
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
"""
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)