1import cv2
2
3vid = cv2.VideoCapture(0)
4
5while True:
6
7 ret, frame = vid.read()
8
9 cv2.imshow('Controlling my computer camera', frame)
10
11 if cv2.waitKey(4) & 0xFF == ord('q'):
12 break
13
14
15vid.release()
16cv2.destroyAllWindows()