fix: refresh cam
This commit is contained in:
parent
407f66bcfd
commit
f3beb33466
@ -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()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user