diff --git a/access_control_python/cam_test_img_post.jpg b/access_control_python/cam_test_img_post.jpg index d071496..3b8fad3 100644 Binary files a/access_control_python/cam_test_img_post.jpg and b/access_control_python/cam_test_img_post.jpg differ diff --git a/access_control_python/cam_test_img_pre.jpg b/access_control_python/cam_test_img_pre.jpg index cdfb113..df0599e 100644 Binary files a/access_control_python/cam_test_img_pre.jpg and b/access_control_python/cam_test_img_pre.jpg differ diff --git a/access_control_python/camera_test.py b/access_control_python/camera_test.py index fef3c87..156c9b2 100644 --- a/access_control_python/camera_test.py +++ b/access_control_python/camera_test.py @@ -3,21 +3,23 @@ import cv2 import base64 import requests -#Capture Image -cam = cv2.VideoCapture(0) -ret, img = cam.read() +# #Capture Image +# cam = cv2.VideoCapture(0) +# ret, img = cam.read() -#Save Image -cv2.imwrite("cam_test_img_pre.jpg",img) +# #Save Image +# cv2.imwrite("cam_test_img_pre.jpg",img) + +img = cv2.imread("cam_test_img_pre.jpg") #Encode Image ret, jpg_buffer = cv2.imencode('.jpg',img) b64_img = base64.b64encode(jpg_buffer) -print(b64_img) #Send Image to Server data = {"image":b64_img.decode("utf-8")} req = requests.post("http://localhost:5000/process_image",json=data) +print(req.content) #Decode Image img_nparr = np.frombuffer(base64.b64decode(b64_img),np.uint8)