Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
05e8b9a15d | ||
|
6f7b2c9ec6 |
@ -2,7 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f410c5c2-3ffe-4260-93eb-e3d83256d263" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/example.env" beforeDir="false" afterPath="$PROJECT_DIR$/example.env" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/index.py" beforeDir="false" afterPath="$PROJECT_DIR$/index.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
@ -16,8 +15,8 @@
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/index.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="375">
|
||||
<caret line="25" column="56" selection-start-line="25" selection-start-column="56" selection-end-line="25" selection-end-column="56" />
|
||||
<state relative-caret-position="360">
|
||||
<caret line="36" column="72" selection-start-line="36" selection-start-column="72" selection-end-line="36" selection-end-column="72" />
|
||||
<folding>
|
||||
<element signature="e#0#21#0" expanded="true" />
|
||||
</folding>
|
||||
@ -38,8 +37,8 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/camera.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="105">
|
||||
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
|
||||
<state relative-caret-position="165">
|
||||
<caret line="11" column="14" selection-start-line="11" selection-start-column="14" selection-end-line="11" selection-end-column="14" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
@ -115,10 +114,10 @@
|
||||
<option value="$PROJECT_DIR$/image_diff_color.py" />
|
||||
<option value="$PROJECT_DIR$/.gitignore" />
|
||||
<option value="$PROJECT_DIR$/config.py" />
|
||||
<option value="$PROJECT_DIR$/camera.py" />
|
||||
<option value="$PROJECT_DIR$/image_tools.py" />
|
||||
<option value="$PROJECT_DIR$/example.env" />
|
||||
<option value="$PROJECT_DIR$/.env" />
|
||||
<option value="$PROJECT_DIR$/camera.py" />
|
||||
<option value="$PROJECT_DIR$/index.py" />
|
||||
</list>
|
||||
</option>
|
||||
@ -186,7 +185,7 @@
|
||||
<frame x="0" y="27" width="1920" height="1053" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.18133895" />
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.18133895" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Favorites" order="2" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
@ -197,7 +196,7 @@
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Version Control" order="7" />
|
||||
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32972974" />
|
||||
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.32972974" />
|
||||
<window_info anchor="bottom" id="Python Console" order="9" />
|
||||
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
@ -257,16 +256,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/camera.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="105">
|
||||
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example.env">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="75">
|
||||
@ -281,10 +270,20 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/camera.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="165">
|
||||
<caret line="11" column="14" selection-start-line="11" selection-start-column="14" selection-end-line="11" selection-end-column="14" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/index.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="375">
|
||||
<caret line="25" column="56" selection-start-line="25" selection-start-column="56" selection-end-line="25" selection-end-column="56" />
|
||||
<state relative-caret-position="360">
|
||||
<caret line="36" column="72" selection-start-line="36" selection-start-column="72" selection-end-line="36" selection-end-column="72" />
|
||||
<folding>
|
||||
<element signature="e#0#21#0" expanded="true" />
|
||||
</folding>
|
||||
|
@ -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'
|
||||
|
||||
|
||||
|
2
index.py
2
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, img)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user