Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- def show_webcam(mirror=False):
- cam = cv2.VideoCapture(0)
- while True:
- ret_val, img = cam.read()
- if mirror:
- img = cv2.flip(img, 1)
- cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
- cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
- cv2.imshow("window", img)
- if cv2.waitKey(1) == 27:
- break # esc to quit
- cv2.destroyAllWindows()
- if __name__ == '__main__':
- show_webcam(mirror=True)
Add Comment
Please, Sign In to add comment