- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
Latest commit
23 lines (15 loc) · 472 Bytes
/
Copy pathmain.py
File metadata and controls
23 lines (15 loc) · 472 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importcv2
fromtkinterimportmessagebox
messagebox.showinfo(title="INFO", message="Press Q to quit")
cv2.startWindowThread()
cam=cv2.VideoCapture(0)
frame_width=int(cam.get(cv2.CAP_PROP_FRAME_WIDTH))
frame_height=int(cam.get(cv2.CAP_PROP_FRAME_HEIGHT))
fourcc=cv2.VideoWriter_fourcc(*'mp4v')
whileTrue:
ret, frame=cam.read()
cv2.imshow('Camera', frame)
ifcv2.waitKey(1) ==ord('q'):
break
cam.release()
cv2.destroyAllWindows()