精确肤色HSV范围 [英] Exact Skin color HSV range

查看:5041
本文介绍了精确肤色HSV范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到所有关于SO的范围的HSV颜色空间的问题

但是我只能找出这个



代码

  CvScalar hsv_min = cvScalar(0,30,60,0); 
CvScalar hsv_max = cvScalar(20,150,255,0);
// range我使用的是{0,30,60,0& 20,150,255,0}
cvCvtColor(src,hsv_image,CV_BGR2HSV);
cvInRangeS(hsv_image,hsv_min,hsv_max,hsv_mask);
cvDilate(hsv_mask,hsv_mask,0,1);
cvErode(hsv_mask,hsv_mask,0,1);
cvSmooth(hsv_mask,hsv_mask,CV_MEDIAN); )的



< > {0,30,60,0& 20,150,255,0}
它甚至检测到红色,当你把你的手放在红色背景,它不跟踪你的皮肤.. 。

请帮助!!!

解决方案

基本上,很难有一个固定的颜色范围为皮肤,因为即使你想检测只有你自己的皮肤,它的颜色实际上会改变很多取决于照明条件。



您可以使用2011年这篇精彩科学文章的想法:



http://www.robots.ox.ac.uk/~vgg/research/hands/



基本上,他们检测脸(很容易与oepncv)。然后,他们提取面部的皮肤颜色(这是非常特定于图像上的人)。然后他们使用这种颜色检测皮肤。由于颜色是非常特殊的,它们应该比你使用固定颜色范围时的错误检测要少得多。


I have seen all questions on SO for range of HSV color space for skin
But I can only figure out this

Code -

CvScalar  hsv_min = cvScalar(0, 30, 60, 0);
CvScalar  hsv_max = cvScalar(20, 150, 255, 0);
//range I am using is { 0,30,60,0 & 20,150,255,0 }
cvCvtColor(src, hsv_image, CV_BGR2HSV);
cvInRangeS (hsv_image, hsv_min, hsv_max, hsv_mask);
cvDilate(hsv_mask,hsv_mask,0,1);
cvErode(hsv_mask,hsv_mask,0,1);
cvSmooth( hsv_mask, hsv_mask, CV_MEDIAN);

Problem with this range ( { 0,30,60,0 & 20,150,255,0 } ) is it detects even red color and when you place your hand in red background it does not track your skin...
Please Help !!!

解决方案

Basically, it's hard to have one fixed color range for skin, because even if you want to detect only your own skin, its color will actually change a lot depending on lighting conditions.

So, maybe you can use the idea of this nice scientific article from 2011:

http://www.robots.ox.ac.uk/~vgg/research/hands/

Basically, they detect face (it's easy with oepncv). Then they extract the skin color of the face (which is very specific to the persons on the image). Then they detect skin using this color. Since the color is very specific, they should have much less false detection, than what you have with your fixed color range.

这篇关于精确肤色HSV范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆