强大的Blob跟踪 [英] Robust tracking of blobs

查看:408
本文介绍了强大的Blob跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图像特征提取问题。输入图像是二进制(黑色和白色),并且可以包含大约已知面积和纵横比的斑点。

I have an image feature extraction problem. The input images are binary (black and white) and may contain blobs of approximately known area and aspect ratio. These need to be fit with ellipses using some best fit algorithm.

输入示例:

所需的输出:

可能有多个blob(零个或多个),数字不是预先知道的。所有斑点的近似面积和纵横比是已知的(并且是相同的)。在图像中有多少,它们的位置,方向和实际大小是我想要找到的。

There may be multiple blobs (zero or more), the number is not known in advance. The approximate area and aspect ratio of all the blobs is known (and is the same). How many are in the image, their position, orientation and actual size are what I'm trying to find. The output should be a best fit ellipse for each blob based on the actual found size and aspect ratio.

这是一个非常困难的噪音和可能的重叠。

What makes this hard is noise and possible overlaps.

噪音示例:

重叠和噪音的示例:

嘈杂的图片可能孔中的斑点和小的其他斑点散落在周围。小的其他斑点不被计数,因为它们太小,并且不覆盖任何密集地足以被认为是真正匹配的区域。

The noisy image may have holes in the blobs and also small other blobs scattered around. The small other blobs are not counted because they are too small and do not cover any area densely enough to be considered a real match.

重叠的图片应计为两个Blob,因为该区域太大,单个Blob不能很好地覆盖。

The image with overlap should be counted as two blobs because the area is too big for a single blob to cover it well.

可能的度量标准是:

所有椭圆的总和(K1 *与预期大小的偏差百分比+ K2 *纵横比+ K3 *不是黑色的椭圆的百分比+ K4 *与任何其他椭圆重叠的百分比)+ K5 *黑色图像的剩余部分的百分比

sum over all ellipses of (K1 * percent deviation from expected size + K2 * percent deviation from expected aspect ratio + K3 * percent of ellipse which is not black + K4 * percent overlapped with any other ellipse) + K5 * percent of rest of image which is black

适当选择的参数K1..K5。一个完美的匹配得分为0。

for some suitably chosen parameters K1..K5. A perfect match scores 0.

我可以看到如何使用暴力解决这个问题,例如尝试足够多的不同可能的拟合来对搜索空间进行抽样。我不能认为一个方法的速度比蛮力更快。

I can see how to solve this using brute force, for example trying enough different possible fits to sample the search space well. I can't think off-hand of a method much faster than brute force.

我更喜欢python和/或opencv中的示例。我将尝试实现和发布任何建议的解决方案在python。谢谢!

I would prefer examples in python and/or opencv. I will try to implement and post any suggested solutions in python. Thanks!

不能假定blob已连接。可能有足够的噪音将其分成不连续的部分。

P.S. It cannot be assumed that a blob is connected. There may be enough noise to break it up into discontinuous parts.

P.P.S。小的噪声不能通过二元侵蚀去除。在我的一些图像中,有足够的内部孔,侵蚀使整个(真实)斑点消失,如果图像被侵蚀足以使噪声位消失。

P.P.S. The little bits of noise cannot be removed by binary erosion. In some of my images, there are enough interior holes that erosion makes the whole (real) blob disappear if the image is eroded enough to make the noise bits disappear as well.

PPPS我认为这将是非常难解决这个使用任何基于轮廓的方法。我在实践中看到的数据具有太多的边缘噪声,可以存在(并且经常是)位噪声,其连接单独的斑点,或者将单个斑点分离成若干(表观)连接的分量。我想要一个基于区域的方法,因为区域覆盖似乎比边缘形状少得多。

P.P.P.S. I think that it would be very hard to solve this using any approach based on contours. The data I see in practice has too much edge noise, there can be (and often are) bits of noise that connect separate blobs, or that separate a single blob into several (apparent) connected components. I would like an approach based on areas, since area coverage seems to be much less nosy than the edge shapes.

P.P.P.P.S。根据要求,下面是一个由于噪音而导致截图的示例:

P.P.P.P.S. As requested, here is an example with a through cut due to noise:

和一个具有很多噪音的样本,但仍然有一个明显的斑点:

and a sample with lots and lots of noise but nevertheless a distinct blob:

EDIT 没有任何答案可以解决问题,虽然Bharat建议了一个部分解决方案,对于非重叠的Blob很有效。

EDIT None of the answers actually solves the problem, although Bharat has suggested a partial solution which does well for non-overlapping blobs. More please :) I will award additional bounty to any actual solutions.

推荐答案

我会尝试拟合一个高斯混合模型,然后使用平均值和协方差矩阵来拟合数据上的椭圆。这样的模型即使具有重叠和小的噪声斑点也将工作。您拥有的数据将是黑色像素的坐标,您可以在数据上适合GMM。这个方法的一个问题是,你需要知道你需要跟踪的Blob的数量,如果你能提出一个启发式的GMM应该解决这个问题相当有效。

I would try to fit a gaussian mixture model and then use the mean and the covariance matrix to fit ellipses over the data. Such a model would work even with overlap and small noisy blobs. The data which you have would be the the coordinates of the pixels which are black and you could fit a GMM over the data. One issue with this approach is that you need to know the number of blobs you need to track in advance, if you can come up with a heuristic for that, GMM should solve this problem pretty efficiently.

这篇关于强大的Blob跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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