Contains two CV applications built with Python and OpenCV. The project demonstrates fundamental image processing concepts including Colour Space Conversion (RGB to HSV), Masking, Morphological Operations, and Real-time Video Processing.
Along with python, install the required dependencies using pip:
pip install opencv-python numpy
A utility tool to determine the precise HSV (Hue, Saturation, Value) ranges for any object in real-time. Brainstromed while realising that real time lighting issues can mess up ideal HSV colours.
Real-time sliders for Lower and Upper H, S, and V values.
How to isolate the colour:
-
Reset: Set all "Lower" sliders to 0 and all "Upper" sliders to Max (179 or 255). The mask should be white.
-
1 (Hue): Adjust L-H and U-H until the background disappears but your object remains.
-
2 (Saturation): Increase L-S to remove white/grey noise (walls, reflections).
-
3 (Value): Increase L-V to remove dark shadows.
Plug data in invis.py.
A basic real-time AR that creates an "invisibility" effect. Captures a background image and replaces pixels matching a specific color with that stored background.
Key Algorithms:
-
HSV Color Detection: Resists lighting changes better than RGB.
-
Morphological Opening: Using Erosion and Dilation to remove noise and smooth mask edges.
-
Bitwise Operations: Using bitwise_and and masking to blend the background and foreground layers.
How to run:
-
Hardcode HSV values of the object you want to make invisible from
colour_tuner.py. -
Run script
python invis.py; move out of the frame immediately. The camera captures the empty background. -
Wait until the terminal prints start, after which hold up the object to your camera.
-
Fine-tune values to get desired results, best in diffused comfortable lighting.


