what are the perfect skin colors values?
13 views (last 30 days)
Show older comments
Can anyone tell me what are the perfect threshold values to detect skin colors in images and what is the color type(RGB,HSV,LAB)? What I need to tell me: for example, R channel is between 70,255 and so one thanks in advance
0 Comments
Accepted Answer
Walter Roberson
on 15 Mar 2020
There is no perfect threshold in any of those color spaces -- not unless you make the range wide enough that it generates a lot of false matches.
0 Comments
More Answers (3)
DGM
on 20 Jun 2023
Edited: DGM
on 20 Jun 2023
After directing other similar threads to this one, I saw the FEX links in the sidebar and decided to see what's available. In order to save the curious the disappointment, here is a brief review of a handful of related FEX submissions.
Uses clustering and GA. The input prompts and the few comments are unreadable (character encoding issue?) Other documentation is in russian. Requires Fuzzy Logic Toolbox, Stats Toolbox.
Uses box selection based on mean and scaled std deviation of reference image set (RGB/HSV/YCbCr/YIQ/CbCr/IQ). Requires some fixes to work in some environments
Uses simple color correction and fixed box selection in YCbCr
Does fixed box selection in HSV to eliminate "non-skin" pixels, then does fixed box selection in YCbCr to select "skin"
This is a lazy verbatim copy of Image Analyst's demo above. At least they wrote a detailed and meaningful description.
This script uses graythresh()/im2bw() on AB alone, so what it selects is entirely dependent on the color distribution in the image, not any approximate locus of skin tones.
Uncommented scripts with fixed box selections in RGB/YCbCr and traditional unnecessary loops
0 Comments
Image Analyst
on 15 Mar 2020
Actually there was a paper on this at the IS&T Color Imaging Conference in Los Angeles about 5-10 years ago. The answer was that the ideal/preferred skin color depended on the country/culture where the question was asked, as you would expect. Very interesting - try to look it up.
The color gamut of skin colors is like a banana or boomerang shape, and can be found in the attached skin_color.m script from actual skin color measurements we have taken on a wide variety of subjects with our spectrophotometer.

Why do you think the gamut has this shape? Think about it and you may realize why. Because of this shape, skin cannot be perfectly detected in any color space by thresholding along the 3 dimensions of the gamut for any arbitrary skin tone. Why not? Think about it. That said, for one particular skin type, where your colors lie along only a short segment of that boomerang, you can do a decent job by thresholding. In other words, you might not be able to get Indians, Irish, and Arabs all with the same set of thresholds, but you can get them if you have different thresholds for each skin tone.
See my attached skin_segmentation.m demo for how to segment skin regions in an image.
You might want to use the Color Thresholder app on the Apps tab of the tool ribbon.
0 Comments
John D'Errico
on 15 Mar 2020
Edited: John D'Errico
on 15 Mar 2020
As I recall, the set of colors that represent skin tones is a rather strangely shaped set. depending on the color space you would use. You cannot simply use a simple set of bounds however. And of course, the boundaries of that set would be rather fuzzy, as what one person calls a fleshtone might not qualify for another person. It is DEFINITELY not something simple like a box in RGB - remember that there are several groups of people in the world, all of whom have very different skin colors. Worse yet, consider what happens to those fleshtones if someone has a sunburn, or they spent some time tanning on the beach.
You could do what we did long ago of course. We took a large set of images that represented what seemed to be a rather complete set of flesh tones, with agreement among a group of researchers that what we had was a reasonably complete sampling. Then we sampled the set of colors from those images, combining them into a point cloud in whatever color space we were using. (It was most surely L*a*b*.) Finally someone (again, most likely me, probably using an alpha shape) built a triangulation of the resulting non-convex domain in that color space. (I no longer have the data, and it would arguably be proprietary even if I did, to a now essentially defunct organization.)
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!