diff --git a/db-handler/app/routers/figures_router.py b/db-handler/app/routers/figures_router.py index 17dfb4a..42c7835 100644 --- a/db-handler/app/routers/figures_router.py +++ b/db-handler/app/routers/figures_router.py @@ -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 diff --git a/db-handler/app/utils.py b/db-handler/app/utils.py index 69be6aa..5443cd0 100644 --- a/db-handler/app/utils.py +++ b/db-handler/app/utils.py @@ -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()]) diff --git a/vision/camera_constants.py b/vision/camera_constants.py index f41d684..ee4b4ce 100644 --- a/vision/camera_constants.py +++ b/vision/camera_constants.py @@ -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 diff --git a/vision/coloured_time_slots.json b/vision/coloured_time_slots.json index 333f27c..455e299 100644 --- a/vision/coloured_time_slots.json +++ b/vision/coloured_time_slots.json @@ -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" } -] +] \ No newline at end of file diff --git a/vision/constants.py b/vision/constants.py index 6621630..5643f4f 100644 --- a/vision/constants.py +++ b/vision/constants.py @@ -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]), diff --git a/vision/images/calibrate.jpg b/vision/images/calibrate.jpg index 32343e2..d5fc7cd 100644 Binary files a/vision/images/calibrate.jpg and b/vision/images/calibrate.jpg differ diff --git a/vision/images/capture.jpg b/vision/images/capture.jpg index 808b78d..07883c7 100644 Binary files a/vision/images/capture.jpg and b/vision/images/capture.jpg differ diff --git a/vision/reader.py b/vision/reader.py index af277ed..65b1873 100644 --- a/vision/reader.py +++ b/vision/reader.py @@ -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 = []