From 099fffbb6fd82e94eb71c60a20b6af0231906251 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sat, 23 Sep 2023 02:30:19 +0700 Subject: [PATCH] Update camera_test.py --- access_control_python/camera_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/access_control_python/camera_test.py b/access_control_python/camera_test.py index 156c9b2..28b0da3 100644 --- a/access_control_python/camera_test.py +++ b/access_control_python/camera_test.py @@ -3,14 +3,15 @@ import cv2 import base64 import requests -# #Capture Image -# cam = cv2.VideoCapture(0) -# ret, img = cam.read() +#Capture Image +cam = cv2.VideoCapture(1) +ret, img = cam.read() # #Save Image # cv2.imwrite("cam_test_img_pre.jpg",img) -img = cv2.imread("cam_test_img_pre.jpg") +# #Load Image +# img = cv2.imread("cam_test_img_pre.jpg") #Encode Image ret, jpg_buffer = cv2.imencode('.jpg',img) @@ -18,7 +19,7 @@ b64_img = base64.b64encode(jpg_buffer) #Send Image to Server data = {"image":b64_img.decode("utf-8")} -req = requests.post("http://localhost:5000/process_image",json=data) +req = requests.post("https://racist.siwatsystem.com/process_image",json=data) print(req.content) #Decode Image