Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit736f55c

Browse files
authored
Create python webcam.py
1 parentfaeb10b commit736f55c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎python webcam.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
importcv2
2+
3+
# id of the video capturing device to open. To open default camera using default backend just pass 0.
4+
capture=cv2.VideoCapture(0)
5+
6+
whileTrue:
7+
_,frame=capture.read()
8+
# We give the Window a name of "Capture from Webcam", and we also give it the frame which is an numpy object.
9+
cv2.imshow("Capture from Webcam",frame)
10+
# We know that the ASCII code for the Escape key is 27.
11+
ifcv2.waitKey(1)==27:
12+
break
13+
14+
# Release the capture and destroy all OpenCV Windows.
15+
capture.release()
16+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp