File size: 225 Bytes
a583b5e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import cv2

# initialize the camera
cap = cv2.VideoCapture(0, cv2.CAP_V4L2)

# capture a frame
ret, frame = cap.read()

# release the camera
cap.release()

# save the captured frame
cv2.imwrite('captured_image.jpg', frame)