[英]splitting R G B image and using blob detection to detect red shapes in Open cv and C++
I am using open CV and C++. 我正在使用开放式CV和C ++。 I need to detect some circular red shaped points on a human face.
我需要检测人脸上的一些圆形红色点。 I am using blob detection but it does not seem to work.
我正在使用斑点检测,但似乎无法正常工作。 I have split the image into red,blue and green but I think I am not getting the parameters right.
我将图像分为红色,蓝色和绿色,但是我认为参数设置不正确。 Can anyone help please?
有人可以帮忙吗? Here is my code http://pastebin.com/aGkUz3SG
这是我的代码http://pastebin.com/aGkUz3SG
Thanks 谢谢
There are multiple problems: 存在多个问题:
your blob detector parameters don't fit. 您的斑点检测器参数不合适。
.minArea
is much too big for the sample image you provided in the comment, since the blobs are very small. .minArea
对于您在注释中提供的示例图像太大,因为斑点很小。 .blobColor
is a problem since your red isn't perfect, see the image of the red channel I added at bottom. .blobColor
是一个问题,因为您的红色并不完美,请查看我在底部添加的红色通道的图像。 In addition, yellow is combination of red and green and might have a very high red value too. 另外,黄色是红色和绿色的组合,并且可能也具有很高的红色值。 So
.filterByColor=false
might be better if you don't know the value of your red dots. 因此,如果您不知道红点的值,则
.filterByColor=false
可能会更好。
Here's the red channel, you will see that the red dots have a lower red value than the yellow dots and values are about the same as the values of the blue dots! 这是红色通道,您将看到红点的红色值比黄点的低,并且这些值与蓝点的值大致相同! In the third image, only one of the red dots is clearly visible to me as a human.
在第三张图片中,作为一个人,我只能清楚地看到一个红点。 On the fourth image, the dot next to the eye isn't really visible.
在第四个图像上,眼睛旁边的点并不真正可见。 All in all it looks like red channel isn't distinct enough to locate the red dots on human skin.
总而言之,看起来红色通道还不够明显,无法在人体皮肤上定位红点。
red channel: 红色通道:
I've tried HSV color space, but the hue value isn't really better, but in saturation channel at least all the dots are a bit visible: 我已经尝试过HSV色彩空间,但是色相值并不是真的更好,但是在饱和度通道中至少所有点都是可见的:
hue: 色调:
saturation: 饱和:
value: 值:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.