类带参数构造函数,重载函数 …

来源:互联网 发布:义乌摄影美工培训学校 编辑:程序博客网 时间:2024/06/11 09:01

class CV_EXPORTS_W BackgroundSubtractorMOG : publicBackgroundSubtractor
{
public:

//不带参数的构造函数
     CV_WRAP BackgroundSubtractorMOG();


//带参数构造函数

      CV_WRAPBackgroundSubtractorMOG(int history, int nmixtures, doublebackgroundRatio, double noiseSigma=0);


   virtual ~BackgroundSubtractorMOG();

 

//重载函数
   virtual void operator()(InputArray image, OutputArray fgmask,double learningRate=0);

 

    virtualvoid initialize(Size frameSize, int frameType);

    virtualAlgorithmInfo* info() const;

protected:
    SizeframeSize;
    intframeType;
    Matbgmodel;
    intnframes;
    inthistory;
    intnmixtures;
    doublevarThreshold;
    doublebackgroundRatio;
    doublenoiseSigma;
};

 

//定义类的对象

BackgroundSubtractorMOGbgsubtractor;

bgsubtractor(NULL,NULL,0.9,10);

bgsubtractor(tmp_frame, bgmask,0.00001);

 

原创粉丝点击