3
votes

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

1
Thank you. I've updated my question with little more information.2vision2
PhDs are made with this title. You wont find a DIRECT answer here i thinkAnder Biguri
It's worth a shot, but you are unlikely to get an answer saying "this will definitely work." Try it, and if it doesn't work, try another method.Zaphod

1 Answers

5
votes

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.

:)