diff -Nru bgslibrary-1.3.0/debian/changelog bgslibrary-1.3.0/debian/changelog --- bgslibrary-1.3.0/debian/changelog 2012-11-16 19:21:42.000000000 +0000 +++ bgslibrary-1.3.0/debian/changelog 2012-11-16 21:59:14.000000000 +0000 @@ -1,4 +1,10 @@ -bgslibrary (1.3.0-4quantal2) quantal; urgency=low +bgslibrary (1.3.0-5quantal1) quantal; urgency=low + + * debian/patches/reduceio.patch: Reduce I/O from library in form of cout/reading/writing from config files in most methods. + + -- Yani Ioannou Fri, 16 Nov 2012 16:58:35 -0500 + +bgslibrary (1.3.0-4precise1) precise; urgency=low * Add more build deps. diff -Nru bgslibrary-1.3.0/debian/patches/reduceio.patch bgslibrary-1.3.0/debian/patches/reduceio.patch --- bgslibrary-1.3.0/debian/patches/reduceio.patch 1970-01-01 00:00:00.000000000 +0000 +++ bgslibrary-1.3.0/debian/patches/reduceio.patch 2012-11-13 22:04:53.000000000 +0000 @@ -0,0 +1,1366 @@ +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +Index: bgslibrary-1.3.0/package_bgs/AdaptiveBackgroundLearning.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/AdaptiveBackgroundLearning.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/AdaptiveBackgroundLearning.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,14 +1,16 @@ + #include "AdaptiveBackgroundLearning.h" + +-AdaptiveBackgroundLearning::AdaptiveBackgroundLearning() : firstTime(true), alpha(0.05), limit(-1), counter(0), minVal(0.0), maxVal(1.0), +- enableThreshold(true), threshold(15), showForeground(true), showBackground(true) ++AdaptiveBackgroundLearning::AdaptiveBackgroundLearning(double alphaParam, long limitParam, bool enableThresholdParam, int thresholdParam, ++ bool showForegroundParam, bool showBackgroundParam) ++ : alpha(alphaParam), limit(limitParam), counter(0), minVal(0.0), maxVal(1.0), enableThreshold(enableThresholdParam), ++ threshold(thresholdParam), showForeground(showForegroundParam), showBackground(showBackgroundParam) + { +- std::cout << "AdaptiveBackgroundLearning()" << std::endl; ++ // + } + + AdaptiveBackgroundLearning::~AdaptiveBackgroundLearning() + { +- std::cout << "~AdaptiveBackgroundLearning()" << std::endl; ++ // + } + + void AdaptiveBackgroundLearning::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -16,11 +18,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + if(img_background.empty()) + img_input.copyTo(img_background); + +@@ -58,34 +55,4 @@ + cv::imshow("BG Learning BG Model", img_background); + + img_foreground.copyTo(img_output); +- +- firstTime = false; +-} +- +-void AdaptiveBackgroundLearning::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/AdaptiveBackgroundLearning.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "limit", limit); +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showForeground", showForeground); +- cvWriteInt(fs, "showBackground", showBackground); +- +- cvReleaseFileStorage(&fs); +-} +- +-void AdaptiveBackgroundLearning::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/AdaptiveBackgroundLearning.xml", 0, CV_STORAGE_READ); +- +- alpha = cvReadRealByName(fs, 0, "alpha", 0.05); +- limit = cvReadIntByName(fs, 0, "limit", -1); +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showForeground = cvReadIntByName(fs, 0, "showForeground", true); +- showBackground = cvReadIntByName(fs, 0, "showBackground", true); +- +- cvReleaseFileStorage(&fs); + } +Index: bgslibrary-1.3.0/package_bgs/AdaptiveBackgroundLearning.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/AdaptiveBackgroundLearning.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/AdaptiveBackgroundLearning.h 2012-11-13 17:04:42.262514598 -0500 +@@ -9,7 +9,6 @@ + class AdaptiveBackgroundLearning : public IBGS + { + private: +- bool firstTime; + cv::Mat img_background; + double alpha; + long limit; +@@ -22,13 +21,10 @@ + bool showBackground; + + public: +- AdaptiveBackgroundLearning(); ++ AdaptiveBackgroundLearning(double alphaParam = 0.05, long limitParam = -1, bool enableThresholdParam = true, int thresholdParam = 15, ++ bool showForegroundParam = false, bool showBackgroundParam = false); + ~AdaptiveBackgroundLearning(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/FrameDifferenceBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/FrameDifferenceBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/FrameDifferenceBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "FrameDifferenceBGS.h" + +-FrameDifferenceBGS::FrameDifferenceBGS() : firstTime(true), enableThreshold(true), threshold(15), showOutput(true) ++FrameDifferenceBGS::FrameDifferenceBGS(bool enableThresholdParam, int thresholdParam, bool showOutputParam) ++ : enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam) + { +- std::cout << "FrameDifferenceBGS()" << std::endl; ++ // + } + + FrameDifferenceBGS::~FrameDifferenceBGS() + { +- std::cout << "~FrameDifferenceBGS()" << std::endl; ++ // + } + + void FrameDifferenceBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + if(img_input_prev.empty()) + { + img_input.copyTo(img_input_prev); +@@ -37,28 +33,4 @@ + img_foreground.copyTo(img_output); + + img_input.copyTo(img_input_prev); +- +- firstTime = false; + } +- +-void FrameDifferenceBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/FrameDifferenceBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void FrameDifferenceBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/FrameDifferenceBGS.xml", 0, CV_STORAGE_READ); +- +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/FrameDifferenceBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/FrameDifferenceBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/FrameDifferenceBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -9,7 +9,6 @@ + class FrameDifferenceBGS : public IBGS + { + private: +- bool firstTime; + cv::Mat img_input_prev; + cv::Mat img_foreground; + bool enableThreshold; +@@ -17,12 +16,8 @@ + bool showOutput; + + public: +- FrameDifferenceBGS(); ++ FrameDifferenceBGS(bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = false); + ~FrameDifferenceBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); +-}; +\ No newline at end of file ++}; +Index: bgslibrary-1.3.0/package_bgs/IBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/IBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/IBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -7,8 +7,4 @@ + public: + virtual void process(const cv::Mat &img_input, cv::Mat &img_output) = 0; + virtual ~IBGS(){} +- +-private: +- virtual void saveConfig() = 0; +- virtual void loadConfig() = 0; +-}; +\ No newline at end of file ++}; +Index: bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV1BGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/MixtureOfGaussianV1BGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV1BGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "MixtureOfGaussianV1BGS.h" + +-MixtureOfGaussianV1BGS::MixtureOfGaussianV1BGS() : firstTime(true), alpha(0.05), enableThreshold(true), threshold(15), showOutput(true) ++MixtureOfGaussianV1BGS::MixtureOfGaussianV1BGS(double alphaParam, bool enableThresholdParam, int thresholdParam, bool showOutputParam) ++: alpha(alphaParam), enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam) + { +- std::cout << "MixtureOfGaussianV1BGS()" << std::endl; ++ // + } + + MixtureOfGaussianV1BGS::~MixtureOfGaussianV1BGS() + { +- std::cout << "~MixtureOfGaussianV1BGS()" << std::endl; ++ // + } + + void MixtureOfGaussianV1BGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + //------------------------------------------------------------------ + // BackgroundSubtractorMOG + // http://opencv.itseez.com/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog +@@ -41,30 +37,4 @@ + cv::imshow("Gaussian Mixture Model (KadewTraKuPong&Bowden)", img_foreground); + + img_foreground.copyTo(img_output); +- +- firstTime = false; +-} +- +-void MixtureOfGaussianV1BGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV1BGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void MixtureOfGaussianV1BGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV1BGS.xml", 0, CV_STORAGE_READ); +- +- alpha = cvReadRealByName(fs, 0, "alpha", 0.05); +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); + } +Index: bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV1BGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/MixtureOfGaussianV1BGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV1BGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -10,7 +10,6 @@ + class MixtureOfGaussianV1BGS : public IBGS + { + private: +- bool firstTime; + cv::BackgroundSubtractorMOG mog; + cv::Mat img_foreground; + double alpha; +@@ -19,13 +18,9 @@ + bool showOutput; + + public: +- MixtureOfGaussianV1BGS(); ++ MixtureOfGaussianV1BGS(double alphaParam = 0.05, bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = false); + ~MixtureOfGaussianV1BGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV2BGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/MixtureOfGaussianV2BGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV2BGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "MixtureOfGaussianV2BGS.h" + +-MixtureOfGaussianV2BGS::MixtureOfGaussianV2BGS() : firstTime(true), alpha(0.05), enableThreshold(true), threshold(15), showOutput(true) ++MixtureOfGaussianV2BGS::MixtureOfGaussianV2BGS(double alphaParam, bool enableThresholdParam, int thresholdParam, bool showOutputParam) ++ : alpha(alphaParam), enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam) + { +- std::cout << "MixtureOfGaussianV2BGS()" << std::endl; ++ // + } + + MixtureOfGaussianV2BGS::~MixtureOfGaussianV2BGS() + { +- std::cout << "~MixtureOfGaussianV2BGS()" << std::endl; ++ // + } + + void MixtureOfGaussianV2BGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + //------------------------------------------------------------------ + // BackgroundSubtractorMOG2 + // http://opencv.itseez.com/modules/video/doc/motion_analysis_and_object_tracking.html#backgroundsubtractormog2 +@@ -46,30 +42,4 @@ + cv::imshow("Gaussian Mixture Model (Zivkovic&Heijden)", img_foreground); + + img_foreground.copyTo(img_output); +- +- firstTime = false; +-} +- +-void MixtureOfGaussianV2BGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV2BGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void MixtureOfGaussianV2BGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/MixtureOfGaussianV2BGS.xml", 0, CV_STORAGE_READ); +- +- alpha = cvReadRealByName(fs, 0, "alpha", 0.05); +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); + } +Index: bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV2BGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/MixtureOfGaussianV2BGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/MixtureOfGaussianV2BGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -10,7 +10,6 @@ + class MixtureOfGaussianV2BGS : public IBGS + { + private: +- bool firstTime; + cv::BackgroundSubtractorMOG2 mog; + cv::Mat img_foreground; + double alpha; +@@ -19,13 +18,9 @@ + bool showOutput; + + public: +- MixtureOfGaussianV2BGS(); ++ MixtureOfGaussianV2BGS(double alphaParam = 0.05, bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = false); + ~MixtureOfGaussianV2BGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/StaticFrameDifferenceBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/StaticFrameDifferenceBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/StaticFrameDifferenceBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "StaticFrameDifferenceBGS.h" + +-StaticFrameDifferenceBGS::StaticFrameDifferenceBGS() : firstTime(true), enableThreshold(true), threshold(15), showOutput(true) ++StaticFrameDifferenceBGS::StaticFrameDifferenceBGS(bool enableThresholdParam, int thresholdParam, bool showOutputParam) ++ : enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam) + { +- std::cout << "StaticFrameDifferenceBGS()" << std::endl; ++ // + } + + StaticFrameDifferenceBGS::~StaticFrameDifferenceBGS() + { +- std::cout << "~StaticFrameDifferenceBGS()" << std::endl; ++ // + } + + void StaticFrameDifferenceBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -17,11 +18,6 @@ + + if(img_background.empty()) + img_input.copyTo(img_background); +- +- loadConfig(); +- +- if(firstTime) +- saveConfig(); + + cv::absdiff(img_input, img_background, img_foreground); + +@@ -32,28 +28,4 @@ + cv::imshow("Static Frame Difference", img_foreground); + + img_foreground.copyTo(img_output); +- +- firstTime = false; +-} +- +-void StaticFrameDifferenceBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/StaticFrameDifferenceBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); + } +- +-void StaticFrameDifferenceBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/StaticFrameDifferenceBGS.xml", 0, CV_STORAGE_READ); +- +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/StaticFrameDifferenceBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/StaticFrameDifferenceBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/StaticFrameDifferenceBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -9,7 +9,6 @@ + class StaticFrameDifferenceBGS : public IBGS + { + private: +- bool firstTime; + cv::Mat img_background; + cv::Mat img_foreground; + bool enableThreshold; +@@ -17,13 +16,9 @@ + bool showOutput; + + public: +- StaticFrameDifferenceBGS(); ++ StaticFrameDifferenceBGS(bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = false); + ~StaticFrameDifferenceBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/WeightedMovingMeanBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/WeightedMovingMeanBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/WeightedMovingMeanBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "WeightedMovingMeanBGS.h" + +-WeightedMovingMeanBGS::WeightedMovingMeanBGS() : firstTime(true), enableWeight(true), enableThreshold(true), threshold(15), showOutput(true), showBackground(false) ++WeightedMovingMeanBGS::WeightedMovingMeanBGS(bool enableWeightParam, bool enableThresholdParam, int thresholdParam, bool showOutputParam, bool showBackgroundParam) ++ : enableWeight(enableWeightParam), enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam), showBackground(showBackgroundParam) + { +- std::cout << "WeightedMovingMeanBGS()" << std::endl; ++ // + } + + WeightedMovingMeanBGS::~WeightedMovingMeanBGS() + { +- std::cout << "~WeightedMovingMeanBGS()" << std::endl; ++ // + } + + void WeightedMovingMeanBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + if(img_input_prev_1.empty()) + { + img_input.copyTo(img_input_prev_1); +@@ -71,32 +67,4 @@ + + img_input_prev_1.copyTo(img_input_prev_2); + img_input.copyTo(img_input_prev_1); +- +- firstTime = false; +-} +- +-void WeightedMovingMeanBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingMeanBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "enableWeight", enableWeight); +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- cvWriteInt(fs, "showBackground", showBackground); +- +- cvReleaseFileStorage(&fs); + } +- +-void WeightedMovingMeanBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingMeanBGS.xml", 0, CV_STORAGE_READ); +- +- enableWeight = cvReadIntByName(fs, 0, "enableWeight", true); +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- showBackground = cvReadIntByName(fs, 0, "showBackground", false); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/WeightedMovingMeanBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/WeightedMovingMeanBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/WeightedMovingMeanBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -9,7 +9,6 @@ + class WeightedMovingMeanBGS : public IBGS + { + private: +- bool firstTime; + cv::Mat img_input_prev_1; + cv::Mat img_input_prev_2; + bool enableWeight; +@@ -19,13 +18,8 @@ + bool showBackground; + + public: +- WeightedMovingMeanBGS(); ++ WeightedMovingMeanBGS(bool enableWeightParam = true, bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = true, bool showBackgroundParam = false); + ~WeightedMovingMeanBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; +- +Index: bgslibrary-1.3.0/package_bgs/WeightedMovingVarianceBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/WeightedMovingVarianceBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/WeightedMovingVarianceBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,14 +1,14 @@ + #include "WeightedMovingVarianceBGS.h" + +-WeightedMovingVarianceBGS::WeightedMovingVarianceBGS() : firstTime(true), enableWeight(true), +- enableThreshold(true), threshold(15), showOutput(true) ++WeightedMovingVarianceBGS::WeightedMovingVarianceBGS(bool enableWeightParam, bool enableThresholdParam, int thresholdParam, bool showOutputParam) ++ : enableWeight(enableWeightParam), enableThreshold(enableThresholdParam), threshold(thresholdParam), showOutput(showOutputParam) + { +- std::cout << "WeightedMovingVarianceBGS()" << std::endl; ++ // + } + + WeightedMovingVarianceBGS::~WeightedMovingVarianceBGS() + { +- std::cout << "~WeightedMovingVarianceBGS()" << std::endl; ++ // + } + + void WeightedMovingVarianceBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -16,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + if(img_input_prev_1.empty()) + { + img_input.copyTo(img_input_prev_1); +@@ -93,8 +88,6 @@ + + img_input_prev_1.copyTo(img_input_prev_2); + img_input.copyTo(img_input_prev_1); +- +- firstTime = false; + } + + //unused +@@ -116,27 +109,3 @@ + + return img_f; + } +- +-void WeightedMovingVarianceBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingVarianceBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "enableWeight", enableWeight); +- cvWriteInt(fs, "enableThreshold", enableThreshold); +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void WeightedMovingVarianceBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/WeightedMovingVarianceBGS.xml", 0, CV_STORAGE_READ); +- +- enableWeight = cvReadIntByName(fs, 0, "enableWeight", true); +- enableThreshold = cvReadIntByName(fs, 0, "enableThreshold", true); +- threshold = cvReadIntByName(fs, 0, "threshold", 15); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +Index: bgslibrary-1.3.0/package_bgs/WeightedMovingVarianceBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/WeightedMovingVarianceBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/WeightedMovingVarianceBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -9,7 +9,6 @@ + class WeightedMovingVarianceBGS : public IBGS + { + private: +- bool firstTime; + cv::Mat img_input_prev_1; + cv::Mat img_input_prev_2; + bool enableWeight; +@@ -18,15 +17,11 @@ + bool showOutput; + + public: +- WeightedMovingVarianceBGS(); ++ WeightedMovingVarianceBGS(bool enableWeightParam = true, bool enableThresholdParam = true, int thresholdParam = 15, bool showOutputParam = true); + ~WeightedMovingVarianceBGS(); + + cv::Mat computeWeightedMean(const std::vector &v_img_input_f, const std::vector weights); + cv::Mat computeWeightedVariance(const cv::Mat &img_input_f, const cv::Mat &img_mean_f, const double weight); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; +Index: bgslibrary-1.3.0/package_bgs/dp/DPAdaptiveMedianBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPAdaptiveMedianBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPAdaptiveMedianBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPAdaptiveMedianBGS.h" + +-DPAdaptiveMedianBGS::DPAdaptiveMedianBGS() : firstTime(true), frameNumber(0), showOutput(true), threshold(40), samplingRate(7), learningFrames(30) ++DPAdaptiveMedianBGS::DPAdaptiveMedianBGS(int thresholdParam, int samplingRateParam, int learningFramesParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), showOutput(showOutputParam), threshold(thresholdParam), samplingRate(samplingRateParam), learningFrames(learningFramesParam) + { +- std::cout << "DPAdaptiveMedianBGS()" << std::endl; ++ // + } + + DPAdaptiveMedianBGS::~DPAdaptiveMedianBGS() + { +- std::cout << "~DPAdaptiveMedianBGS()" << std::endl; ++ // + } + + void DPAdaptiveMedianBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -62,27 +58,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPAdaptiveMedianBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPAdaptiveMedianBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "samplingRate", samplingRate); +- cvWriteInt(fs, "learningFrames", learningFrames); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPAdaptiveMedianBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPAdaptiveMedianBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadIntByName(fs, 0, "threshold", 40); +- samplingRate = cvReadIntByName(fs, 0, "samplingRate", 7); +- learningFrames = cvReadIntByName(fs, 0, "learningFrames", 30); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/dp/DPAdaptiveMedianBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPAdaptiveMedianBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPAdaptiveMedianBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -12,7 +12,6 @@ + class DPAdaptiveMedianBGS : public IBGS + { + private: +- bool firstTime; + long frameNumber; + IplImage* frame; + RgbImage frame_data; +@@ -22,19 +21,16 @@ + BwImage lowThresholdMask; + BwImage highThresholdMask; + ++ bool firstTime; + int threshold; + int samplingRate; + int learningFrames; + bool showOutput; + + public: +- DPAdaptiveMedianBGS(); ++ DPAdaptiveMedianBGS(int thresholdParam = 40, int samplingRateParam = 7, int learningFramesParam = 30, bool showOutputParam = false); + ~DPAdaptiveMedianBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPEigenbackgroundBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPEigenbackgroundBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPEigenbackgroundBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPEigenbackgroundBGS.h" + +-DPEigenbackgroundBGS::DPEigenbackgroundBGS() : firstTime(true), frameNumber(0), showOutput(true), threshold(225), historySize(20), embeddedDim(10) ++DPEigenbackgroundBGS::DPEigenbackgroundBGS(int thresholdParam, int historySizeParam, int embeddedDimParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), showOutput(showOutputParam), threshold(thresholdParam), historySize(historySizeParam), embeddedDim(embeddedDimParam) + { +- std::cout << "DPEigenbackgroundBGS()" << std::endl; ++ // + } + + DPEigenbackgroundBGS::~DPEigenbackgroundBGS() + { +- std::cout << "~DPEigenbackgroundBGS()" << std::endl; ++ // + } + + void DPEigenbackgroundBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -64,27 +60,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPEigenbackgroundBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPEigenbackgroundBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "historySize", historySize); +- cvWriteInt(fs, "embeddedDim", embeddedDim); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPEigenbackgroundBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPEigenbackgroundBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadIntByName(fs, 0, "threshold", 225); +- historySize = cvReadIntByName(fs, 0, "historySize", 20); +- embeddedDim = cvReadIntByName(fs, 0, "embeddedDim", 10); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/dp/DPEigenbackgroundBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPEigenbackgroundBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPEigenbackgroundBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -28,13 +28,9 @@ + bool showOutput; + + public: +- DPEigenbackgroundBGS(); ++ DPEigenbackgroundBGS(int thresholdParam = 225, int historySizeParam = 20, int embeddedDimParam = 10, bool showOutputParam = false); + ~DPEigenbackgroundBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPGrimsonGMMBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPGrimsonGMMBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPGrimsonGMMBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,6 +1,7 @@ + #include "DPGrimsonGMMBGS.h" + +-DPGrimsonGMMBGS::DPGrimsonGMMBGS() : firstTime(true), frameNumber(0), showOutput(true), threshold(9.0), alpha(0.01), gaussians(3) ++DPGrimsonGMMBGS::DPGrimsonGMMBGS(double thresholdParam, double alphaParam, int gaussiansParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), showOutput(showOutputParam), threshold(thresholdParam), alpha(alphaParam), gaussians(gaussiansParam) + { + std::cout << "DPGrimsonGMMBGS()" << std::endl; + } +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -63,27 +59,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPGrimsonGMMBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPGrimsonGMMBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "threshold", threshold); +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "gaussians", gaussians); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPGrimsonGMMBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPGrimsonGMMBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadRealByName(fs, 0, "threshold", 9.0); +- alpha = cvReadRealByName(fs, 0, "alpha", 0.01); +- gaussians = cvReadIntByName(fs, 0, "gaussians", 3); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/dp/DPGrimsonGMMBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPGrimsonGMMBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPGrimsonGMMBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -28,13 +28,9 @@ + bool showOutput; + + public: +- DPGrimsonGMMBGS(); ++ DPGrimsonGMMBGS(double thresholdParam = 9.0, double alphaParam = 0.01, int gaussiansParam = 3, bool showOutputParam=false); + ~DPGrimsonGMMBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPMeanBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPMeanBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPMeanBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPMeanBGS.h" + +-DPMeanBGS::DPMeanBGS() : firstTime(true), frameNumber(0), threshold(2700), alpha(1e-6f), learningFrames(30), showOutput(true) ++DPMeanBGS::DPMeanBGS(int thresholdParam, double alphaParam, int learningFramesParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), threshold(thresholdParam), alpha(alphaParam), learningFrames(learningFramesParam), showOutput(showOutputParam) + { +- std::cout << "DPMeanBGS()" << std::endl; ++ // + } + + DPMeanBGS::~DPMeanBGS() + { +- std::cout << "~DPMeanBGS()" << std::endl; ++ // + } + + void DPMeanBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -63,27 +59,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPMeanBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPMeanBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "threshold", threshold); +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "learningFrames", learningFrames); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPMeanBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPMeanBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadIntByName(fs, 0, "threshold", 2700); +- alpha = cvReadRealByName(fs, 0, "alpha", 1e-6f); +- learningFrames = cvReadIntByName(fs, 0, "learningFrames", 30); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +Index: bgslibrary-1.3.0/package_bgs/dp/DPMeanBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPMeanBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPMeanBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -28,13 +28,9 @@ + bool showOutput; + + public: +- DPMeanBGS(); ++ DPMeanBGS(int thresholdParam = 2700, double alphaParam = 1e-6f, int learningFramesParam = 30, bool showOutput = false); + ~DPMeanBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPPratiMediodBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPPratiMediodBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPPratiMediodBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPPratiMediodBGS.h" + +-DPPratiMediodBGS::DPPratiMediodBGS() : firstTime(true), frameNumber(0), threshold(30), samplingRate(5), historySize(16), weight(5), showOutput(true) ++DPPratiMediodBGS::DPPratiMediodBGS(int thresholdParam, int samplingRateParam, int historySizeParam, int weightParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), threshold(thresholdParam), samplingRate(samplingRateParam), historySize(historySizeParam), weight(weightParam), showOutput(showOutputParam) + { +- std::cout << "DPPratiMediodBGS()" << std::endl; ++ // + } + + DPPratiMediodBGS::~DPPratiMediodBGS() + { +- std::cout << "~DPPratiMediodBGS()" << std::endl; ++ // + } + + void DPPratiMediodBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -63,29 +59,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPPratiMediodBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPPratiMediodBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteInt(fs, "threshold", threshold); +- cvWriteInt(fs, "samplingRate", samplingRate); +- cvWriteInt(fs, "historySize", historySize); +- cvWriteInt(fs, "weight", weight); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPPratiMediodBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPPratiMediodBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadIntByName(fs, 0, "threshold", 30); +- samplingRate = cvReadIntByName(fs, 0, "samplingRate", 5); +- historySize = cvReadIntByName(fs, 0, "historySize", 16); +- weight = cvReadIntByName(fs, 0, "weight", 5); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/dp/DPPratiMediodBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPPratiMediodBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPPratiMediodBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -29,13 +29,9 @@ + bool showOutput; + + public: +- DPPratiMediodBGS(); ++ DPPratiMediodBGS(int thresholdParam = 30, int samplingRateParam = 5, int historySizeParam = 16, int weightParam = 5, bool showOutputParam = false); + ~DPPratiMediodBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPWrenGABGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPWrenGABGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPWrenGABGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPWrenGABGS.h" + +-DPWrenGABGS::DPWrenGABGS() : firstTime(true), frameNumber(0), threshold(12.25f), alpha(0.005f), learningFrames(30), showOutput(true) ++DPWrenGABGS::DPWrenGABGS(double thresholdParam, double alphaParam, int learningFramesParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), threshold(thresholdParam), alpha(alphaParam), learningFrames(learningFramesParam), showOutput(showOutputParam) + { +- std::cout << "DPWrenGABGS()" << std::endl; ++ // + } + + DPWrenGABGS::~DPWrenGABGS() + { +- std::cout << "~DPWrenGABGS()" << std::endl; ++ // + } + + void DPWrenGABGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -62,28 +58,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPWrenGABGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPWrenGABGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "threshold", threshold); +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "learningFrames", learningFrames); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPWrenGABGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPWrenGABGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadRealByName(fs, 0, "threshold", 12.25f); +- alpha = cvReadRealByName(fs, 0, "alpha", 0.005f); +- learningFrames = cvReadIntByName(fs, 0, "learningFrames", 30); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +- +Index: bgslibrary-1.3.0/package_bgs/dp/DPWrenGABGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPWrenGABGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPWrenGABGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -28,13 +28,9 @@ + bool showOutput; + + public: +- DPWrenGABGS(); ++ DPWrenGABGS(double thresholdParam = 12.25f, double alphaParam = 0.005f, int learningFramesParam = 30, bool showOutputParam = false); + ~DPWrenGABGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/dp/DPZivkovicAGMMBGS.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPZivkovicAGMMBGS.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPZivkovicAGMMBGS.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -1,13 +1,14 @@ + #include "DPZivkovicAGMMBGS.h" + +-DPZivkovicAGMMBGS::DPZivkovicAGMMBGS() : firstTime(true), frameNumber(0), showOutput(true), threshold(25.0f), alpha(0.001f), gaussians(3) ++DPZivkovicAGMMBGS::DPZivkovicAGMMBGS(double thresholdParam, double alphaParam, int gaussiansParam, bool showOutputParam) ++ : firstTime(true), frameNumber(0), showOutput(true), threshold(thresholdParam), alpha(alphaParam), gaussians(gaussiansParam) + { +- std::cout << "DPZivkovicAGMMBGS()" << std::endl; ++ // + } + + DPZivkovicAGMMBGS::~DPZivkovicAGMMBGS() + { +- std::cout << "~DPZivkovicAGMMBGS()" << std::endl; ++ // + } + + void DPZivkovicAGMMBGS::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -15,11 +16,6 @@ + if(img_input.empty()) + return; + +- loadConfig(); +- +- if(firstTime) +- saveConfig(); +- + frame = new IplImage(img_input); + + if(firstTime) +@@ -62,27 +58,3 @@ + firstTime = false; + frameNumber++; + } +- +-void DPZivkovicAGMMBGS::saveConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPZivkovicAGMMBGS.xml", 0, CV_STORAGE_WRITE); +- +- cvWriteReal(fs, "threshold", threshold); +- cvWriteReal(fs, "alpha", alpha); +- cvWriteInt(fs, "gaussians", gaussians); +- cvWriteInt(fs, "showOutput", showOutput); +- +- cvReleaseFileStorage(&fs); +-} +- +-void DPZivkovicAGMMBGS::loadConfig() +-{ +- CvFileStorage* fs = cvOpenFileStorage("./config/DPZivkovicAGMMBGS.xml", 0, CV_STORAGE_READ); +- +- threshold = cvReadRealByName(fs, 0, "threshold", 25.0f); +- alpha = cvReadRealByName(fs, 0, "alpha", 0.001f); +- gaussians = cvReadIntByName(fs, 0, "gaussians", 3); +- showOutput = cvReadIntByName(fs, 0, "showOutput", true); +- +- cvReleaseFileStorage(&fs); +-} +\ No newline at end of file +Index: bgslibrary-1.3.0/package_bgs/dp/DPZivkovicAGMMBGS.h +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/dp/DPZivkovicAGMMBGS.h 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/dp/DPZivkovicAGMMBGS.h 2012-11-13 17:04:42.262514598 -0500 +@@ -28,13 +28,9 @@ + bool showOutput; + + public: +- DPZivkovicAGMMBGS(); ++ DPZivkovicAGMMBGS(double thresholdParam = 25.0, double alphaParam = 0.001, int gaussiansParam = 3, bool showOutputParam = false); + ~DPZivkovicAGMMBGS(); + + void process(const cv::Mat &img_input, cv::Mat &img_output); +- +-private: +- void saveConfig(); +- void loadConfig(); + }; + +Index: bgslibrary-1.3.0/package_bgs/tb/FuzzyChoquetIntegral.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/tb/FuzzyChoquetIntegral.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/tb/FuzzyChoquetIntegral.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -3,12 +3,12 @@ + FuzzyChoquetIntegral::FuzzyChoquetIntegral() : firstTime(true), frameNumber(0), showOutput(true), + framesToLearn(10), alphaLearn(0.1), alphaUpdate(0.01), colorSpace(1), option(2), smooth(true), threshold(0.67) + { +- std::cout << "FuzzyChoquetIntegral()" << std::endl; ++ // + } + + FuzzyChoquetIntegral::~FuzzyChoquetIntegral() + { +- std::cout << "~FuzzyChoquetIntegral()" << std::endl; ++ // + } + + void FuzzyChoquetIntegral::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -180,4 +180,4 @@ + threshold = cvReadRealByName(fs, 0, "threshold", 0.67); + + cvReleaseFileStorage(&fs); +-} +\ No newline at end of file ++} +Index: bgslibrary-1.3.0/package_bgs/tb/FuzzySugenoIntegral.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/tb/FuzzySugenoIntegral.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/tb/FuzzySugenoIntegral.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -3,12 +3,12 @@ + FuzzySugenoIntegral::FuzzySugenoIntegral() : firstTime(true), frameNumber(0), showOutput(true), + framesToLearn(10), alphaLearn(0.1), alphaUpdate(0.01), colorSpace(1), option(2), smooth(true), threshold(0.67) + { +- std::cout << "FuzzySugenoIntegral()" << std::endl; ++ // + } + + FuzzySugenoIntegral::~FuzzySugenoIntegral() + { +- std::cout << "~FuzzySugenoIntegral()" << std::endl; ++ // + } + + void FuzzySugenoIntegral::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -180,4 +180,4 @@ + threshold = cvReadRealByName(fs, 0, "threshold", 0.67); + + cvReleaseFileStorage(&fs); +-} +\ No newline at end of file ++} +Index: bgslibrary-1.3.0/package_bgs/tb/T2FGMM_UM.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/tb/T2FGMM_UM.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/tb/T2FGMM_UM.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -2,12 +2,12 @@ + + T2FGMM_UM::T2FGMM_UM() : firstTime(true), frameNumber(0), showOutput(true), threshold(9.0), alpha(0.01), gaussians(3), km(1.5), kv(0.6) + { +- std::cout << "T2FGMM_UM()" << std::endl; ++ // + } + + T2FGMM_UM::~T2FGMM_UM() + { +- std::cout << "~T2FGMM_UM()" << std::endl; ++ // + } + + void T2FGMM_UM::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -92,4 +92,4 @@ + showOutput = cvReadIntByName(fs, 0, "showOutput", true); + + cvReleaseFileStorage(&fs); +-} +\ No newline at end of file ++} +Index: bgslibrary-1.3.0/package_bgs/tb/T2FGMM_UV.cpp +=================================================================== +--- bgslibrary-1.3.0.orig/package_bgs/tb/T2FGMM_UV.cpp 2012-10-05 14:22:53.000000000 -0400 ++++ bgslibrary-1.3.0/package_bgs/tb/T2FGMM_UV.cpp 2012-11-13 17:04:42.262514598 -0500 +@@ -2,12 +2,12 @@ + + T2FGMM_UV::T2FGMM_UV() : firstTime(true), frameNumber(0), showOutput(true), threshold(9.0), alpha(0.01), gaussians(3), km(1.5), kv(0.6) + { +- std::cout << "T2FGMM_UV()" << std::endl; ++ // + } + + T2FGMM_UV::~T2FGMM_UV() + { +- std::cout << "~T2FGMM_UV()" << std::endl; ++ // + } + + void T2FGMM_UV::process(const cv::Mat &img_input, cv::Mat &img_output) +@@ -92,4 +92,4 @@ + showOutput = cvReadIntByName(fs, 0, "showOutput", true); + + cvReleaseFileStorage(&fs); +-} +\ No newline at end of file ++} diff -Nru bgslibrary-1.3.0/debian/patches/series bgslibrary-1.3.0/debian/patches/series --- bgslibrary-1.3.0/debian/patches/series 2012-10-09 19:57:19.000000000 +0000 +++ bgslibrary-1.3.0/debian/patches/series 2012-11-13 22:04:22.000000000 +0000 @@ -1 +1,2 @@ cmake-add-install-targets.patch +reduceio.patch