从图像中检测肤色 [英] Detect skin tone from an image
问题描述
我正在尝试开发一个应用程序,一旦提供图像,该应用程序将检测面部的颜色.我能够从OpenCV中找到人脸检测算法并将其集成.但是,我找不到任何可以检测到脸部颜色的示例或界面.
I am trying to develop an application which will detect the color of the face once an image is provided. I was able to find out the face detection algorithm from OpenCV and integrate it. However I could not find any example or interface by which I can detect the color of the face.
我有我要介绍的逻辑.请让我知道是否有可用的功能,或者是否需要为此编写单独的功能?
I have the logic which I am presenting. Please let me know if there is anything available for this or do I need to write the separate function for this?
逻辑:在给定的图像区域中,找到大部分在给定的颜色细节中重复的颜色细节.我已经检查了直方图,不确定是否会有帮助.
Logic: in the given image area, find the color detail which is repeated mostly in the given. I have gone through the histogram and not sure how it will be of help.
任何帮助将不胜感激.
推荐答案
直方图表示图像中给定颜色的像素数量.
The histogram represents the amount of pixels of a given color which are in the image.
例如,假设您有3x3的图片:
For example, lets say you have this 3x3 image:
3 4 3 1 1 1 2 2 1
3 4 3 1 1 1 2 2 1
直方图将是: 数:4 2 2 1 颜色:1 2 3 4
The histogram would be: count: 4 2 2 1 color: 1 2 3 4
您将因此发现最多的颜色是颜色1.总结出非常相似的颜色可能也很有意义.
from this you would have that the color which is found most is the color 1. It probably also would make sense to sum up very similar color.
例如使用count(2)= sum(hist(1),hist(2),hist(3)); (记录该颜色的像素数)
For example use count(2) = sum(hist(1), hist(2), hist(3)); (being hist the number of pixels in that color)
这篇关于从图像中检测肤色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!