Skip to content

Commit d328592

Browse files
version 1.0
1 parent e139df1 commit d328592

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.py

+5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22
import cv2
33
import winsound
44

5+
# init camera with python
56
cap = cv2.VideoCapture(0)
67
cap.set(3, 1280)
78
cap.set(4, 720)
89

10+
# For numbering image title
911
counter = 0
1012

1113
while True:
1214
_, img = cap.read()
1315
cv2.imshow("My own Camera",img)
16+
# For capture image
1417
if cv2.waitKey(1) == ord("c"):
1518
counter += 1
1619
cv2.imwrite(f"myimage{counter}.jpg",img)
20+
# Make sound when capture image
1721
winsound.Beep(500, 100)
22+
# For close app
1823
if cv2.waitKey(1) == ord("q"):
1924
break
2025

0 commit comments

Comments
 (0)