1 parent 0a4ddd4 commit dbb8b62Copy full SHA for dbb8b62
2 files changed
see-yourself-camera/readme.rst
@@ -0,0 +1 @@
1
+You can read tutorial https://www.roytuts.com/see-yourself-in-webcam-using-python/
see-yourself-camera/see_yourself_camera.py
@@ -0,0 +1,26 @@
+from imutils.video import VideoStream
2
+import cv2
3
+
4
+# grab the reference to the webcam
5
+vs = VideoStream(src=0).start()
6
7
+# keep looping
8
+while True:
9
+ # grab the current frame
10
+ frame = vs.read()
11
12
+ # if we are viewing a video and we did not grab a frame,
13
+ # then we have reached the end of the video
14
+ if frame is None:
15
+ break
16
17
+ # show the frame to our screen
18
+ cv2.imshow("Frame", frame)
19
+ key = cv2.waitKey(1) & 0xFF
20
21
+ # if the 'q' key is pressed, stop the loop
22
+ if key == ord("q"):
23
24
25
+# close all windows
26
+cv2.destroyAllWindows()
0 commit comments