From 6f7b2c9ec69ee63286b93e610af4e02a01a86501 Mon Sep 17 00:00:00 2001 From: glmdev Date: Sat, 9 Feb 2019 18:31:26 -0600 Subject: [PATCH] ref test --- .idea/workspace.xml | 43 ++++++++++++++++++++++--------------------- camera.py | 1 + index.py | 2 +- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index de975bd..a6a7328 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,8 @@ - + + - + - - + + @@ -35,11 +36,11 @@ - + - - + + @@ -115,11 +116,11 @@ @@ -186,7 +187,7 @@ - + @@ -257,16 +258,6 @@ - - - - - - - - - - @@ -283,13 +274,23 @@ - - + + + + + + + + + + + + \ No newline at end of file diff --git a/camera.py b/camera.py index 2603b4e..38c8d1c 100644 --- a/camera.py +++ b/camera.py @@ -9,6 +9,7 @@ def capture(camera_stream = "/dev/video4"): cam.start() img = cam.get_image() pygame.image.save(img, './capture.jpg') + cam.stop() return './capture.jpg' diff --git a/index.py b/index.py index f93a7e5..d7ca344 100644 --- a/index.py +++ b/index.py @@ -34,7 +34,7 @@ def poll(): for stall in doc_ref_stalls: stall_obj = stall.to_dict() - color_reference = image_tools.average_color(stall_obj['locationX'], stall_obj['locationY'], stall_obj['width'], stall_obj['height'], reference) + color_reference = image_tools.average_color(75, 400, 50, 50, reference) color_compare = image_tools.average_color(stall_obj['locationX'], stall_obj['locationY'], stall_obj['width'], stall_obj['height'], img) stall_occupied = image_tools.threshold(image_tools.differences(color_reference, color_compare), float(os.getenv('E_HAT_TRIGGER_LEVEL'))) stall_obj['open'] = not stall_occupied