Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

capture image raspberry pi usb camera

import cv2

cam = cv2.VideoCapture(0)

while True:
	ret, image = cam.read()
	cv2.imshow('Imagetest',image)
	k = cv2.waitKey(1)
	if k != -1:
		break
cv2.imwrite('/home/pi/testimage.jpg', image)
cam.release()
cv2.destroyAllWindows()
Source by raspberrypi-guide.github.io #
 
PREVIOUS NEXT
Tagged: #capture #image #raspberry #pi #usb #camera
ADD COMMENT
Topic
Name
6+4 =