Live cam
Configuration of a live cam.
import cv2
import time
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
def takePicture():
(grabbed, frame) = cap.read()
showimg = frame
# cv2.imshow('img1', showimg) # display the captured image
cv2.waitKey(2000)
#time.sleep(1) # Wait 300 miliseconds
image = 'test-image.png'
cv2.imwrite(image, frame)
cap.release()
return image
print(takePicture())Last updated