简体   繁体   English

在Open CV和C ++中分割RGB图像并使用斑点检测来检测红色形状

[英]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.

相关问题 使用Open CV和C ++将彩色图像分成三个通道? - Splitting a color image into three channels using Open CV and C++? 使用开放式Cv和C ++检测并计数图像上的人脸 - detect and count face on image using open cv and c++ 分离.raw图像文件的4个通道(R,G,G,B)并将其保存为c ++中的有效图像 - Seperate 4 channels (R,G,G,B) of .raw image file and save them as valid image in c++ 开放式简历中基于颜色的斑点检测 - colour based blob detection in open cv 用C ++编写blob检测 - blob detection in C++ 如何在Open CV C ++中构图图像 - How to skeletonize an image in open cv c++ 在C ++中将图像数据(R,G和B像素)读取到2D数组中 - Reading image data (R,G, & B pixel) into 2D arrays in C++ 如何访问已加载图像中的各个R / G / B组件(较新的C ++ API) - How to access the individual R/G/B components of a loaded in image (newer C++ API) 使用cvblobslib和opencv(c ++)减少实时二进制黑白网络摄像头订阅源的斑点检测期间的延迟 - Reducing lag during blob detection of real-time, binary b/w webcam feed using cvblobslib and opencv(c++) 如何在开放式C ++ C中翻转带有成角度的矩形或任何其他角度形状的图像的特定部分 - How to flip particluar part of images with angled rectangle or any other angle shapes in open cv c++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM