Undestaning different color spaces is crucial for Computer Vision projects. In this project I explore different examples where switching between color spaces is extremely useful.
You can run the main.py
file for the main application:
uv run src/auto_color_filter/main.py
By clicking and holding the left mouse button you can add pixels from the image to an inclusion list. Based on this list, a color range will be defined and based on that a mask image is generated.
The example provided in segmentation.py
creates a mask image based on a static HSV range defined in the arguments.
uv run src/auto_color_filter/segmentation.py
In this demo we compare two different ways to interpolate between two colors:
- Directly with RGB values interpolated -> changes in brightness and saturation even if start and end color have the same brightness/saturation
- Interpolate in HSV color space -> constant brightness/saturation if start and end values match or linear interpolation in case of difference between start and end color
uv run src/auto_color_filter/segmentation.py
Using pytest you can run the test suite:
uv run pytest