Answers for "capture image raspberry pi usb camera"

0

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()
Posted by: Guest on February-05-2022

Python Answers by Framework

Browse Popular Code Answers by Language