From 47443d9826964a45e101aeae1baf787fc7c607d0 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 23 May 2011 14:01:12 +0000 Subject: [PATCH] fixed 2 bugs reported by exvan (ticket #799) --- modules/video/src/bgfg_gaussmix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/video/src/bgfg_gaussmix.cpp b/modules/video/src/bgfg_gaussmix.cpp index 14358de..9a5426a 100644 --- a/modules/video/src/bgfg_gaussmix.cpp +++ b/modules/video/src/bgfg_gaussmix.cpp @@ -261,7 +261,7 @@ static void process8uC3( BackgroundSubtractorMOG& obj, const Mat& image, Mat& fg int K = obj.nmixtures; const float w0 = (float)CV_BGFG_MOG_WEIGHT_INIT; - const float sk0 = (float)(w0/CV_BGFG_MOG_SIGMA_INIT*sqrt(3.)); + const float sk0 = (float)(w0/(CV_BGFG_MOG_SIGMA_INIT*sqrt(3.))); const float var0 = (float)(CV_BGFG_MOG_SIGMA_INIT*CV_BGFG_MOG_SIGMA_INIT); const float minVar = (float)(obj.noiseSigma*obj.noiseSigma); MixData* mptr = (MixData*)obj.bgmodel.data; @@ -442,7 +442,7 @@ icvUpdateGaussianBGModel( IplImage* curr_frame, CvGaussBGModel* bg_model, doubl mog.nframes = bg_model->countFrames; mog.history = bg_model->params.win_size; mog.nmixtures = bg_model->params.n_gauss; - mog.varThreshold = bg_model->params.std_threshold; + mog.varThreshold = bg_model->params.std_threshold*bg_model->params.std_threshold; mog.backgroundRatio = bg_model->params.bg_threshold; mog(image, mask, learningRate); -- 2.7.4