https://github.com/pn-projects/skintone_detection_using_matlab
Simple MATLAB app to Extract Skintone of the human subject from the given images ( Without using ML )
https://github.com/pn-projects/skintone_detection_using_matlab
digital-image-processing image-processing image-segmentation matlab
Last synced: about 1 month ago
JSON representation
Simple MATLAB app to Extract Skintone of the human subject from the given images ( Without using ML )
- Host: GitHub
- URL: https://github.com/pn-projects/skintone_detection_using_matlab
- Owner: PN-Projects
- License: other
- Created: 2024-12-19T08:48:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-12T17:22:50.000Z (about 1 year ago)
- Last Synced: 2025-02-20T00:43:22.332Z (about 1 year ago)
- Topics: digital-image-processing, image-processing, image-segmentation, matlab
- Language: MATLAB
- Homepage:
- Size: 151 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Skintone Detection Using HSV & YCbCr mask in MATLAB
## Introduction
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.
## Flow chart
- Caution, copying it without permission may lead to legal consequences, kindly go through [this](https://github.com/PN-Projects/Skintone_detection_using_MATLAB/tree/main?tab=License-1-ov-file#readme)
## Steps to Set Up and Run
### System Requirements
- 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.
### Dependencies
Before running the project, ensure the following MATLAB toolboxes are installed:
- [Image Processing Toolbox](https://in.mathworks.com/products/image-processing.html): Used for image manipulation and processing.
- [Statistics and Machine Learning Toolbox](https://in.mathworks.com/products/statistics.html): Required for k-means clustering.
### Running the Application
Setting Up Environment
Deal with this step by yourself
clone the contents of this repo as per your convenience and deal with setting up path etc...
Launch MATLAB
Open MATLAB and navigate to the folder containing the application files.
Run the Application
Execute the main file (ipprojekt_exported.mlapp) by typing the following command in MATLAB’s Command Window:
ipprojekt_exported
Upload an Image
- Click the "Upload" button and select an image (supported formats: JPG, PNG, BMP).
- The selected image will be displayed for reference.
Select Skin Region
- 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.
Process the Image
- 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.
### Features
-
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.
### Additional Notes
- 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.
### Future Improvements
- 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.
# LICENSE
Skintone Detection using HSV & YCbCr mask by Parthiv Katapara is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International