The source code has been modified to read images from a connected cam. Once the space
key is pressed, the captured frame is processed and the involved steps to detect human skin are shown, by pressing any key. Esc
key will quit the application. Obviously, a connected cam is required.
- Usage of the test app:
python3 app.py
A quick research on the internet shows that the color segmentation is widely used for skin detection (specifically using HSV and YCbCr colorspaces), mostly by its simplicity and performance. However, the skin tones, illumination, and quality is something that could drastically vary between images. For instance, Kolkur et. al (2016), and Sha et. al (2009) studied that kind of skin segmentation and discovered completely different optimal thresholds values.
I then decided to search for other methods and found this paper written by Saxen and Al-Hamadi (2014) which shows that region based gives a better output for skin detection tasks.
Here, a region growing algorithm (Watershed) and a combination of HSV and YCbCr color segmentations work together to produce the output.
This project was implemented using Python (3.7) and OpenCV (3.4.3). The class skinDetector
, available inside jeanCV.py
, must be imported into your project and be used as follows:
from jeanCV import skinDetector
detector = skinDetector("ImageName")
detector.find_skin()
-
sudo apt-get install python3 python3-pip
-
pip3 install opencv-python
-
Usage of the test app:
python3 app.py imageName
-
On
cmd
/Powershell
:
-
python -m pip install --upgrade pip
-
pip install opencv-python
- Usage of the test app:
python app.py imageName