OpenCV  2.4.13.2
Open Source Computer Vision
cv::BackgroundSubtractorMOG2 Class Reference

#include <background_segm.hpp>

Inheritance diagram for cv::BackgroundSubtractorMOG2:
cv::BackgroundSubtractor cv::Algorithm

Public Member Functions

 BackgroundSubtractorMOG2 ()
 the default constructor More...
 
 BackgroundSubtractorMOG2 (int history, float varThreshold, bool bShadowDetection=true)
 the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength More...
 
virtual ~BackgroundSubtractorMOG2 ()
 the destructor More...
 
virtual void operator() (InputArray image, OutputArray fgmask, double learningRate=-1)
 the update operator More...
 
virtual void getBackgroundImage (OutputArray backgroundImage) const
 computes a background image which are the mean of all background gaussians More...
 
virtual void initialize (Size frameSize, int frameType)
 re-initiaization method More...
 
virtual AlgorithmInfoinfo () const
 
- Public Member Functions inherited from cv::BackgroundSubtractor
virtual ~BackgroundSubtractor ()
 the virtual destructor More...
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
string name () const
 
template<typename _Tp >
ParamType< _Tp >::member_type get (const string &name) const
 
template<typename _Tp >
ParamType< _Tp >::member_type get (const char *name) const
 
int getInt (const string &name) const
 
double getDouble (const string &name) const
 
bool getBool (const string &name) const
 
string getString (const string &name) const
 
Mat getMat (const string &name) const
 
vector< MatgetMatVector (const string &name) const
 
Ptr< AlgorithmgetAlgorithm (const string &name) const
 
void set (const string &name, int value)
 
void set (const string &name, double value)
 
void set (const string &name, bool value)
 
void set (const string &name, const string &value)
 
void set (const string &name, const Mat &value)
 
void set (const string &name, const vector< Mat > &value)
 
void set (const string &name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void set (const string &name, const Ptr< _Tp > &value)
 
void setInt (const string &name, int value)
 
void setDouble (const string &name, double value)
 
void setBool (const string &name, bool value)
 
void setString (const string &name, const string &value)
 
void setMat (const string &name, const Mat &value)
 
void setMatVector (const string &name, const vector< Mat > &value)
 
void setAlgorithm (const string &name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void setAlgorithm (const string &name, const Ptr< _Tp > &value)
 
void set (const char *name, int value)
 
void set (const char *name, double value)
 
void set (const char *name, bool value)
 
void set (const char *name, const string &value)
 
void set (const char *name, const Mat &value)
 
void set (const char *name, const vector< Mat > &value)
 
void set (const char *name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void set (const char *name, const Ptr< _Tp > &value)
 
void setInt (const char *name, int value)
 
void setDouble (const char *name, double value)
 
void setBool (const char *name, bool value)
 
void setString (const char *name, const string &value)
 
void setMat (const char *name, const Mat &value)
 
void setMatVector (const char *name, const vector< Mat > &value)
 
void setAlgorithm (const char *name, const Ptr< Algorithm > &value)
 
template<typename _Tp >
void setAlgorithm (const char *name, const Ptr< _Tp > &value)
 
string paramHelp (const string &name) const
 
int paramType (const char *name) const
 
int paramType (const string &name) const
 
void getParams (CV_OUT vector< string > &names) const
 
virtual void write (FileStorage &fs) const
 
virtual void read (const FileNode &fn)
 

Protected Attributes

Size frameSize
 
int frameType
 
Mat bgmodel
 
Mat bgmodelUsedModes
 
int nframes
 
int history
 
int nmixtures
 
double varThreshold
 
float backgroundRatio
 
float varThresholdGen
 
float fVarInit
 
float fVarMin
 
float fVarMax
 
float fCT
 
bool bShadowDetection
 
unsigned char nShadowDetection
 
float fTau
 

Additional Inherited Members

- Public Types inherited from cv::Algorithm
typedef Algorithm *(* Constructor) (void)
 
typedef int(Algorithm::* Getter) () const
 
typedef void(Algorithm::* Setter) (int)
 
- Static Public Member Functions inherited from cv::Algorithm
static void getList (CV_OUT vector< string > &algorithms)
 
static Ptr< Algorithm_create (const string &name)
 
template<typename _Tp >
static Ptr< _Tp > create (const string &name)
 

Detailed Description

The class implements the following algorithm: "Improved adaptive Gausian mixture model for background subtraction" Z.Zivkovic International Conference Pattern Recognition, UK, August, 2004. http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf

Constructor & Destructor Documentation

§ BackgroundSubtractorMOG2() [1/2]

cv::BackgroundSubtractorMOG2::BackgroundSubtractorMOG2 ( )

the default constructor

§ BackgroundSubtractorMOG2() [2/2]

cv::BackgroundSubtractorMOG2::BackgroundSubtractorMOG2 ( int  history,
float  varThreshold,
bool  bShadowDetection = true 
)

the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength

§ ~BackgroundSubtractorMOG2()

virtual cv::BackgroundSubtractorMOG2::~BackgroundSubtractorMOG2 ( )
virtual

the destructor

Member Function Documentation

§ getBackgroundImage()

virtual void cv::BackgroundSubtractorMOG2::getBackgroundImage ( OutputArray  backgroundImage) const
virtual

computes a background image which are the mean of all background gaussians

Reimplemented from cv::BackgroundSubtractor.

§ info()

virtual AlgorithmInfo* cv::BackgroundSubtractorMOG2::info ( ) const
virtual

Reimplemented from cv::Algorithm.

§ initialize()

virtual void cv::BackgroundSubtractorMOG2::initialize ( Size  frameSize,
int  frameType 
)
virtual

re-initiaization method

§ operator()()

virtual void cv::BackgroundSubtractorMOG2::operator() ( InputArray  image,
OutputArray  fgmask,
double  learningRate = -1 
)
virtual

the update operator

Reimplemented from cv::BackgroundSubtractor.

Member Data Documentation

§ backgroundRatio

float cv::BackgroundSubtractorMOG2::backgroundRatio
protected

§ bgmodel

Mat cv::BackgroundSubtractorMOG2::bgmodel
protected

§ bgmodelUsedModes

Mat cv::BackgroundSubtractorMOG2::bgmodelUsedModes
protected

§ bShadowDetection

bool cv::BackgroundSubtractorMOG2::bShadowDetection
protected

§ fCT

float cv::BackgroundSubtractorMOG2::fCT
protected

§ frameSize

Size cv::BackgroundSubtractorMOG2::frameSize
protected

§ frameType

int cv::BackgroundSubtractorMOG2::frameType
protected

§ fTau

float cv::BackgroundSubtractorMOG2::fTau
protected

§ fVarInit

float cv::BackgroundSubtractorMOG2::fVarInit
protected

§ fVarMax

float cv::BackgroundSubtractorMOG2::fVarMax
protected

§ fVarMin

float cv::BackgroundSubtractorMOG2::fVarMin
protected

§ history

int cv::BackgroundSubtractorMOG2::history
protected

§ nframes

int cv::BackgroundSubtractorMOG2::nframes
protected

§ nmixtures

int cv::BackgroundSubtractorMOG2::nmixtures
protected

§ nShadowDetection

unsigned char cv::BackgroundSubtractorMOG2::nShadowDetection
protected

§ varThreshold

double cv::BackgroundSubtractorMOG2::varThreshold
protected

here it is the maximum allowed number of mixture components. Actual number is determined dynamically per pixel

§ varThresholdGen

float cv::BackgroundSubtractorMOG2::varThresholdGen
protected

The documentation for this class was generated from the following file: