https://github.com/trflorian/auto-color-filter
Demo Applications using different Color Spaces
https://github.com/trflorian/auto-color-filter
color-spaces computer-vision opencv-python python
Last synced: 12 months ago
JSON representation
Demo Applications using different Color Spaces
- Host: GitHub
- URL: https://github.com/trflorian/auto-color-filter
- Owner: trflorian
- License: mit
- Created: 2024-12-25T01:09:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-04T16:55:24.000Z (about 1 year ago)
- Last Synced: 2025-06-03T18:28:45.295Z (about 1 year ago)
- Topics: color-spaces, computer-vision, opencv-python, python
- Language: Python
- Homepage: https://towardsdatascience.com/from-rgb-to-hsv-and-back-again/
- Size: 1.65 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Color Spaces


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.

## Prerequisites
- [uv](https://docs.astral.sh/uv/)
## Quickstart
You can run the `main.py` file for the main application:
```bash
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.

## More Demos
### Manual Segmentation
The example provided in `segmentation.py` creates a mask image based on a static HSV range defined in the arguments.
```bash
uv run src/auto_color_filter/segmentation.py
```
### Color Transition
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
```bash
uv run src/auto_color_filter/segmentation.py
```
## Tests
Using pytest you can run the test suite:
```bash
uv run pytest
```