fix: refresh cam

This commit is contained in:
rpi 2023-05-04 07:58:30 +01:00
parent 407f66bcfd
commit f3beb33466

View File

@ -30,7 +30,7 @@ FORMAT = ".jpg"
PROMPT = "> "
filename = None
cam = cv2.VideoCapture(0)
cam = cv2.VideoCapture()
if not DEBUG:
import RPi.GPIO as GPIO
@ -105,8 +105,10 @@ def parse_s3_url_payload(payload):
def take_picture():
cam.open(0)
ret, frame = cam.read()
ret, img = cv2.imencode(FORMAT, frame)
cam.release()
return img.tobytes()