Skip to content

Commit

Permalink
Deletes misused buffer in BackgroundSubstractorGMG.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutikhin committed Jul 18, 2018
1 parent 17e939f commit f4250ca
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions modules/bgsegm/src/bgfg_gmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ class BackgroundSubtractorGMGImpl CV_FINAL : public BackgroundSubtractorGMG
Mat_<int> nfeatures_;
Mat_<int> colors_;
Mat_<float> weights_;

Mat buf_;
};


Expand Down Expand Up @@ -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
Expand All @@ -474,7 +471,6 @@ void BackgroundSubtractorGMGImpl::release()
nfeatures_.release();
colors_.release();
weights_.release();
buf_.release();
}


Expand Down

0 comments on commit f4250ca

Please sign in to comment.