Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we have enough image space to handle images that compress weirdly. #85

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions trafficlight/internals/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def video_image_colour(self) -> VideoImage:
# We match the source 255 as "higher than 247" because the video codec reduces the detail on the exact hue.

# These capture the expected values for the RED GREEN and BLUE images
if pixel[0] > 245 and pixel[1] < 10 and pixel[2] < 10 and pixel[3] == 255:
if pixel[0] > 213 and pixel[1] < 25 and pixel[2] < 25 and pixel[3] == 255:
return VideoImage.RED
if pixel[0] < 10 and pixel[1] > 245 and pixel[2] < 10 and pixel[3] == 255:
if pixel[0] < 25 and pixel[1] > 213 and pixel[2] < 25 and pixel[3] == 255:
return VideoImage.GREEN
if pixel[0] < 10 and pixel[1] == 0 and pixel[2] > 245 and pixel[3] == 255:
if pixel[0] < 25 and pixel[1] < 25 and pixel[2] > 213 and pixel[3] == 255:
return VideoImage.BLUE

# This captures video streams that have frozen on the initial state
Expand Down
Loading