A desktop application that captures live video and performs colour analysis.
Overview
A computer vision application that detects, marks and classifies colours in camera video in real time. Built with Python and OpenCV.
The Need
Colour-based object detection is a building block for many applications, including quality control, sorting and interactive systems. Colour perception, however, is highly sensitive to lighting: the same object produces entirely different pixel values under different illumination. The goal was a system that delivers consistent results under changing conditions and can be calibrated quickly on site.
The Solution
Every frame passes through a five-stage image processing pipeline:
- Pre-processing — Gaussian blur reduces sensor noise.
- Colour space conversion — The image is converted from RGB to HSV. Separating hue from brightness provides marked robustness to lighting changes.
- Masking — Binary masks are created from defined HSV ranges for each target colour; for colours such as red, which wrap around both ends of the hue circle, ranges are combined.
- Morphological refinement and contour analysis — Opening and closing operations remove noise, contours are extracted and regions below a size threshold are discarded.
- Visualisation — Each detected object is framed with its colour label, and the dominant colour at the centre of the image is reported separately.
On-site Calibration
Anticipating that fixed thresholds would not hold in every environment, a calibration interface was built to adjust HSV bounds live on the camera image. The system can be reconfigured for a new environment within seconds.
Impact
- A lightweight, explainable detection pipeline that is robust to lighting changes.
- Processing steps optimised with frame rate in mind for real-time performance.
- A solid foundation for subsequent machine learning and computer vision work.
More projects
Sardur Engineering
Corporate website, admin panel and client portal
A three-part full-stack web application for an industrial chimney-cleaning company: a public corporate site, an admin panel and a client portal.
Clinical Psychologist Website
Corporate website, content management and search visibility
A corporate website designed and built from scratch, without templates, for a clinical psychologist in Denizli — trustworthy, visible in search and easy to manage.