This project presents an innovative MATLAB-based system for detecting skin tone and extracting its representative color in the form of a hex code. The system leverages multi-dimensional color spaces (YCbCr and HSV) combined with k-means clustering for accurate skin tone identification. Designed to be user-friendly yet robust, the extracted hex code enables practical applications such as personalized clothing color recommendations and digital styling.
The methodology integrates manual region selection with algorithmic processes, providing precise results while minimizing errors caused by lighting or background variations. This project is an accessible tool for use in digital fashion, cosmetics, and academic research.
- Caution, copying it without permission may lead to legal consequences, kindly go through this
- MATLAB version: R2023a or later (recommended for optimal compatibility).
- Operating System:
- Minimum: Windows 10 64-bit or macOS Catalina.
- Recommended: Windows 11 64-bit or macOS Ventura.
- Processor: Dual-core 2.0 GHz or higher.
- RAM: Minimum 4 GB; Recommended 8 GB or more.
Before running the project, ensure the following MATLAB toolboxes are installed:
- Image Processing Toolbox: Used for image manipulation and processing.
- Statistics and Machine Learning Toolbox: Required for k-means clustering.
Open MATLAB and navigate to the folder containing the application files.
Execute the main file (ipprojekt_exported.mlapp
) by typing the following command in MATLAB’s Command Window:
ipprojekt_exported
- Click the "Upload" button and select an image (supported formats: JPG, PNG, BMP).
- The selected image will be displayed for reference.
- A manual selection tool will appear. Use it to draw a rectangle around the skin region of the image.
- Ensure the selected area contains only skin for accurate detection.
- Click the "Process" button to start the analysis.
- The system will:
- Generate a skin mask.
- Extract skin pixels.
- Perform k-means clustering to identify the dominant tone.
- Display the hex code and dominant skin tone.
- Dual-Color Space Segmentation:
Uses YCbCr and HSV color spaces to ensure reliable skin tone detection under diverse lighting conditions.
- Manual Skin Region Selection:
Provides flexibility for precise region identification.
- Clustering for Dominance:
k-means clustering isolates the dominant skin tone, reducing noise and errors.
- Hex Code Representation:
Converts RGB values of the dominant tone into a hex code, offering a standardized reference.
- Ensure high-quality images are used for better results. Poor lighting or low resolution may affect accuracy.
- If encountering any issues, verify that all toolboxes are installed and the MATLAB version meets the system requirements.
- Automating skin region detection using deep learning techniques.
- Supporting additional color spaces (e.g., Lab, Luv) for higher precision.
- Expanding recommendations with a machine learning-based algorithm.
Skintone Detection using HSV & YCbCr mask by Parthiv Katapara is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International