Search code examples
opencvimage-processingcomputer-visionface-detection

Skin Color Detection using opencv


How to detect the colour of the skin using OpenCV?

What about using OpenCV Haar face detector to find a face region and then getting the average or most common color in that face region, since it should be the skin color?

Update:

Environment: My frames will have the facial features. (only From hair to shoulders, as attached)

enter image description here


Solution

  • you really don't need HAAR detection. the following will definitely work...

    my answer for this and similar issues involving color based detection: https://stackoverflow.com/a/17375222/1463143

    what it was originally inspired from: https://stackoverflow.com/a/14756351/1463143

    if the codes end up detecting blond or brown hair along with the skin, try changing min_YCrCb to (80,133,77) or play around with that min value

    here is a video showcasing skin detection using above mentioned technique.

    :)