检测其他 Blob 上的 Blob
我使用 OpenCV 和 cvblob 库来处理 blob。
现在我想检测这种特殊情况下的斑点。
在这种情况下,问题或困难在于一个较大的斑点上方有两个斑点,而另一个斑点则与较大的斑点的一部分重叠。
在 cvblob 库中要检测 blob,您必须有一个二进制图像。
我认为我需要创建两个或更多图像来分割颜色均匀的斑点,然后对它们进行二值化以获得图像中的所有斑点。
我该怎么办呢。
提前致谢
I use OpenCV and cvblob library to play with blob.
Now I want to detect blob in this particular case.
The problem or the difficulty in this case is there are two blobs over a bigger one and other blob that overlap a part of the bigger one.
In cvblob library to detect a blob you must have a binary image.
I think i need to create two or more image to segment color uniform blobs and then binarize them to obtain all the blobs in the image.
How can i do that.
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我是 OpenCV 的初学者,但我想,对于这种特殊情况,您应该使用带有 CV_RETR_EXTERNAL 标志的 cvFindContours (使用 CV_RETR_TREE,您的黄色斑点将位于蓝色斑点中),而不是使用 cvblob。
这取决于您是否想要跟踪它们(cvblob 提供了一种快速有效的方法来跟踪 blob,而不必实现 camshift)。
利用轮廓提供的信息,您可以轻松找到斑点的质心、角度和边界框。
跟踪这些斑点可能会更困难,因为 cvblob 不喜欢重叠的斑点(正如我所看到的)。您可能必须实施自己的跟踪方法。
I'm quite a beginner in OpenCV but I guess that, for that particular case, you should work with cvFindContours with the CV_RETR_EXTERNAL flag (with the CV_RETR_TREE, your yellow blob would be IN the blue one) instead of using cvblob.
It depends if you want to track them or not (cvblob offers a quick and efficient way to track blobs, instead of having to implement camshift).
With the information given by the contour you can find easily the centroid, angle and bounding box of your blob.
Tracking these blob might be more difficult as cvblob doesn't like overlapping blobs (as I can see). You may have to implement your own tracking method.