Skip to content

Commit dbb8b62

Browse files
authored
Add files via upload
1 parent 0a4ddd4 commit dbb8b62

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

see-yourself-camera/readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You can read tutorial https://www.roytuts.com/see-yourself-in-webcam-using-python/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
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+
break
24+
25+
# close all windows
26+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)