BackgroundSubtractorMOG2的参数 [英] Parameter of BackgroundSubtractorMOG2

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

问题描述

我有问题了解 backgroundsubtractormog2 的所有参数。



我查看了代码(位于 bfgf_gaussmix2.cpp ),但没有看到。例如,Tb = varThreshold,但是纸张中的Tb的名称是什么?



我对脂肪标记的参数特别感兴趣。



让我们从easy参数[my remarks]开始:




  • int nmixtures



    混合物组分的最大允许数量。实际数量是根据每个像素动态确定的。
    [set 0 for GMG]


  • uchar nShadowDetection



    输出前景蒙版中的像素。默认值为127.


  • float fTau



    如果像素是背景的较暗版本,则检测到阴影。 Tau是一个阈值,定义阴影可以有多深。




现在来看一个像素我不明白:




  • float backgroundRatio



    阈值定义组件是否足够显着以包括在背景模型中(对应于从纸张到纸张的TB = 1-cf)。 cf = 0.1 => TB = 0.9是默认值。


  • float varThresholdGen / p>

    Mahalanobis平方距离的阈值,有助于确定样品何时接近现有组分(对应于Tg)。如果它不靠近任何组件,则会生成一个新组件。默认为3 sigma => Tg = 3 * 3 = 9。较小的Tg值产生更多的组分。较高的Tg值可能导致少量的组分,但它们可能生长得太大。 [我不明白这个词]


  • 在构造函数中使用变量 varThreshold 。它和varThresholdGen是一样的吗?



    马哈拉诺比斯距离的平方阈值,以决定是否被背景模型描述得很好(见Cthr ??)。此参数不影响后台更新。典型值可以是4 sigma,即varThreshold = 4 * 4 = 16; (见Tb ??)。


  • float fVarInit



    新生成组件的初始方差。它影响适应的速度。参数值基于您对图像的典型标准偏差的估计。 OpenCV使用15作为合理的值。


  • float fVarMin



    用于进一步控制方差的参数



    float fVarMax

    li>
  • float fCT



    复杂度降低参数。此参数定义接受证明组件存在所需的样本数。 CT = 0.05是所有样本的默认值。通过设置CT = 0,您得到的算法与标准的Stauffer& Grimson算法非常相似。




在OpenCV网站上的同一问题,但没有答案。

解决方案

好吧,我不认为任何人都可以告诉你哪个参数是什么,如果你不知道细节您正在使用的算法。此外,你不应该需要任何人告诉你哪个参数是什么,如果你知道算法的细节。我告诉这个详细的参数(fCT,fVarMax等)不是直接的(nmixtures,nShadowDetection等)。



所以,我想你应该读文件中引用的论文。以下是论文的链接 1 2 3



此外,您还应阅读这篇文章,这是背景估计的开始。



阅读这些文章并签出代码后,我相信您会明白这些参数是什么。



祝你好运!


I have Problem understanding all Parameter of backgroundsubtractormog2.

I looked in the code (located in bfgf_gaussmix2.cpp), but don't see the connection to the mentioned paper. For exmaple is Tb = varThreshold, but what is the name of Tb in the paper?

I am especially interested in the fat marked parameter.

Let's start with the easy parameter [my remarks]:

  • int nmixtures

    Maximum allowed number of mixture components. Actual number is determined dynamically per pixel. [set 0 for GMG]

  • uchar nShadowDetection

    The value for marking shadow pixels in the output foreground mask. Default value is 127.

  • float fTau

    Shadow threshold. The shadow is detected if the pixel is a darker version of the background. Tau is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel is more than twice darker then it is not shadow.

Now to the ones i don't understand:

  • float backgroundRatio

    Threshold defining whether the component is significant enough to be included into the background model ( corresponds to TB=1-cf from the paper??which paper??). cf=0.1 => TB=0.9 is default. For alpha=0.001, it means that the mode should exist for approximately 105 frames before it is considered foreground.

  • float varThresholdGen

    Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the existing components (corresponds to Tg). If it is not close to any component, a new component is generated. 3 sigma => Tg=3*3=9 is default. A smaller Tg value generates more components. A higher Tg value may result in a small number of components but they can grow too large. [i don't understand a word of this]

  • In the Constructor the variable varThreshold is used. Is it the same as varThresholdGen?

    Threshold on the squared Mahalanobis distance to decide whether it is well described by the background model (see Cthr??). This parameter does not affect the background update. A typical value could be 4 sigma, that is, varThreshold=4*4=16; (see Tb??).

  • float fVarInit

    Initial variance for the newly generated components. It affects the speed of adaptation. The parameter value is based on your estimate of the typical standard deviation from the images. OpenCV uses 15 as a reasonable value.

  • float fVarMin

    Parameter used to further control the variance.

  • float fVarMax

    Parameter used to further control the variance.

  • float fCT

    Complexity reduction parameter. This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05 is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the standard Stauffer&Grimson algorithm.

Someone asked pretty much the same question on the OpenCV website, but without an answer.

解决方案

Well, I don't think anyone could tell you which parameter is what if you don't know the details of the algorithm that you are using. Besides, you should not need anyone to tell you which parameter is what if you know the details of the algorithm. I'm telling this for detailed parameters (fCT, fVarMax, etc) not for straight forward ones (nmixtures, nShadowDetection, etc).

So, I think you should read the papers referenced in the documentation. Here are the links for the papers 1, 2, 3.

And also you should read this paper as well, which is the beginning of background estimation.

After reading these papers and checking out the code with, I'm sure you will understand what are those parameters.

Good luck!

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

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