Ask Your Question

Revision history [back]

In OpenCV 2.4.10 you can use these:

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);

So it should look like:

bg = new BackgroundSubstractorMOG2();
bg->setInt("nmixtures" , 3);

for floats use setDouble(...)

In OpenCV 2.4.10 you can use these:these functions from the Algorithm class:

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);

So it should look like:

bg = new BackgroundSubstractorMOG2();
bg->setInt("nmixtures" , 3);

for floats use setDouble(...)