diff --git a/modules/bgsegm/src/bgfg_gmg.cpp b/modules/bgsegm/src/bgfg_gmg.cpp index 353b8718c..a4f8f2a47 100644 --- a/modules/bgsegm/src/bgfg_gmg.cpp +++ b/modules/bgsegm/src/bgfg_gmg.cpp @@ -196,8 +196,6 @@ private: Mat_ nfeatures_; Mat_ colors_; Mat_ weights_; - - Mat buf_; }; @@ -459,8 +457,7 @@ void BackgroundSubtractorGMGImpl::apply(InputArray _frame, OutputArray _fgmask, if (smoothingRadius > 0) { - medianBlur(fgmask, buf_, smoothingRadius); - swap(fgmask, buf_); + medianBlur(fgmask, fgmask, smoothingRadius); } // keep track of how many frames we have processed @@ -474,7 +471,6 @@ void BackgroundSubtractorGMGImpl::release() nfeatures_.release(); colors_.release(); weights_.release(); - buf_.release(); }