Ask Your Question

firat's profile - activity

2014-07-26 00:49:32 -0600 received badge  Taxonomist
2014-03-07 04:15:11 -0600 asked a question MOG2 Background Subtractor Gaussian weights seem to be unsorted

Hi, I'm using OpenCV version 2.4.8. When I look at the weights of the resulting Gaussians after processing my images with MOG2 Background subtractor, I see that they are not necessarily sorted. As far as I know, the weights should be sorted from high to low, so that at some point you can choose the modes that correspond to the background. For example, I think getBackgroundImage function assumes sorted weights.

My guess is that the problem is due to the swap operations happening in MOG2Invoker::operator(const Range& range). If you look at line 381 of "modules\video\src\bgfg_gaussmix2.cpp", you will see the swaps. You will also notice that the weight assignment happens at line 404 after the swaps. I think this might cause the weight to be assigned to the wrong mode which results in unsorted weights.

What do you think? Is this a bug?

Firat