Whiten skin color in an image
Is there any theory or image filter for whitening the skin color in an image on iPhone ?
I have the RGB data on hand. But whatever I change, it cannot archieve my needs. I alter the RGB as follows:
New value of R/G/B = (int)roundf(Old R/G/B - 128) * contrast_value + 128 + brightness_value);
Where cont开发者_StackOverflow社区rast_value = 1 to 1.3 and brightness_value = 0 to 50
But I found that it comes to pale yellow ...
Convert your image to YUV colorspace first. This gives you two advantages:
- easily detect skin areas using this approach (see my answer to that question)
- easily increase the brightness (just increment the Y value)
One thing I have seen to work is to add a constand value to all the three components of the color, like R + 0x33 G + 0x33 B + 0x33
EDITED: I just found another thread that has additional information: Programmatically Lighten a Color
精彩评论