class CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor
{
public:
//! the default constructor
CV_WRAP BackgroundSubtractorMOG2();
//! the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength
CV_WRAP BackgroundSubtractorMOG2(int history, float varThreshold, bool bShadowDetection=true);
//! the destructor
virtual ~BackgroundSubtractorMOG2();
//! the update operator
virtual void operator()(InputArray image, OutputArray fgmask, double learningRate=-1);
//! computes a background image which are the mean of all background gaussians
virtual void getBackgroundImage(OutputArray backgroundImage) const;
//! re-initiaization method
virtual void initialize(Size frameSize, int frameType);
virtual AlgorithmInfo* info() const;
protected:
Size frameSize;
int frameType;
Mat bgmodel;
Mat bgmodelUsedModes;//keep track of number of modes per pixel
int nframes;
int history;
int nmixtures;
//! here it is the maximum allowed number of mixture components.
//! Actual number is determined dynamically per pixel
double varThreshold;
// threshold on the squared Mahalanobis distance to decide if it is
运动跟踪(七):BackgroundSubtractorMOG2(),背景差
最新推荐文章于 2024-09-29 21:46:51 发布
本文深入探讨BackgroundSubtractorMOG2算法在运动跟踪中的应用,详细解析其工作原理和优势,帮助理解如何通过背景差分实现精准的运动目标检测。
摘要由CSDN通过智能技术生成