This project implements a statistical skin colour detector based on the methodology described in Szeliski (2011). It was developed as part of the CSC4082 - Group Task to explore image formation and chromaticity-based segmentation.
The primary goal is to review image formation concepts by devising a detector that can distinguish skin pixels from background pixels using color distribution modeling in the xy chromaticity space.
The implementation follows the suggested steps from Szeliski Exercise 2.8:
- Data Acquisition: Collected a variety of photographs of people under different lighting conditions.
-
Chromaticity Calculation: For each pixel, we calculate the
$xy$ chromaticity values to decouple luminance from color:$$x = \frac{R}{R+G+B}, \quad y = \frac{G}{R+G+B}$$ - Training (Manual Labeling): Using a painting tool/cropping to isolate skin regions (faces, arms) to build a ground truth dataset.
-
Distribution Modeling: - Calculated the Mean (
$\mu$ ) and Covariance ($\Sigma$ ) of the skin pixels.- (Optional) Modeled non-skin pixels to define a background distribution.
- Segmentation: Applied the computed distribution to find skin regions in test images, masking non-skin pixels in white or black for visualization.
- Python 3.8+
- OpenCV
- NumPy
- Matplotlib
git clone https://github.com/Computer-Vision-Projects-Lab/simple-skin-colour-detectorskin-colour-detector.git
cd skin-colour-detector
pip install -r requirements.txt