Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashicks1 committed Oct 25, 2023
1 parent 44c8643 commit da71bfb
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 55 deletions.
1 change: 0 additions & 1 deletion db-handler/app/routers/figures_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def get_available() -> Annotated[dict, Body(examples=[FIGURINES_EXAMPLE])]:
# users: dict = {}
time: tuple = utils.current_to_timeslot()
timeslot_time: str = time[0]
timeslot_time = "15:30"
day: str = time[1]
_LOGGER.info("Getting availability for %s, %s", day, timeslot_time)
# Finds the timeslot in the database at the current time
Expand Down
1 change: 0 additions & 1 deletion db-handler/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def current_to_timeslot() -> tuple[str, str]:
time_change = 0

now += timedelta(seconds=time_change)
print(now)
# Gets current time with minutes rounded down to the closest 15 minute timeslot
return f'{now.hour:02}:{now.minute // constants.TIMESLOT_LEN * constants.TIMESLOT_LEN:02}', str(DAYS[now.weekday()])

Expand Down
10 changes: 5 additions & 5 deletions vision/camera_constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rotation_angle = 270.0
left = 20
top = 4
time_slot_width = 142.0
time_slot_height = 47.5
rotation_angle = 90
left = 72
top = 499
time_slot_width = 120.0
time_slot_height = 40.0
60 changes: 15 additions & 45 deletions vision/coloured_time_slots.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,38 @@
[
{
"day": "monday",
"time_slot": 14,
"data": "",
"colour": "black"
},
{
"day": "wednesday",
"time_slot": 9,
"data": "TEST",
"colour": "black"
},
{
"day": "wednesday",
"time_slot": 10,
"data": "TEST",
"colour": "black"
},
{
"day": "wednesday",
"time_slot": 12,
"time_slot": 23,
"data": "",
"colour": "red"
"colour": "red,black"
},
{
"day": "wednesday",
"time_slot": 13,
"data": "",
"colour": "red"
},
{
"day": "friday",
"time_slot": 12,
"time_slot": 24,
"data": "",
"colour": "black"
"colour": "red,black"
},
{
"day": "friday",
"time_slot": 17,
"data": "",
"day": "wednesday",
"time_slot": 25,
"data": "NAY\nth\n",
"colour": "black"
},
{
"day": "sunday",
"time_slot": 12,
"data": "",
"colour": "red"
},
{
"day": "sunday",
"time_slot": 13,
"data": "",
"colour": "red"
"day": "wednesday",
"time_slot": 26,
"data": "BRU\n",
"colour": "red,black"
},
{
"day": "sunday",
"time_slot": 14,
"day": "saturday",
"time_slot": 34,
"data": "",
"colour": "red"
},
{
"day": "sunday",
"time_slot": 15,
"time_slot": 34,
"data": "",
"colour": "red"
}
]
]
3 changes: 1 addition & 2 deletions vision/constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import numpy as np

# After activating your python environment. Please replace with result of which python
python_path = '/Users/alexviller/miniconda3/envs/lambda-env/bin/python'

python_path = '/opt/homebrew/Caskroom/miniconda/base/envs/lambda-env/bin/python3'
# The maximum and minimum RGB values to be considered each colour for thresholding
colour_thresholds = {
'red_min': np.array([100, 0, 0]),
Expand Down
Binary file modified vision/images/calibrate.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vision/images/capture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vision/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_info(time_slot_array: np.ndarray) -> (bool, [str], str):
# threshold this for how many pixels need to be coloured to think important
is_blue = pcent_blue >= 2
is_red = pcent_red >= 2
is_black = pcent_black >= 20
is_black = pcent_black >= 22

is_coloured = is_blue or is_red or is_black
colour = []
Expand Down

0 comments on commit da71bfb

Please sign in to comment.