From 97818fe370913f81e0423830db3adb7c9859b1b1 Mon Sep 17 00:00:00 2001 From: Thomas Boy <thomas-boy@idiv.de> Date: Mon, 27 Aug 2018 12:24:56 +0200 Subject: [PATCH] fix logic bug, max area threshold to small, will eleminate a lot of frames, silent mode again --- Demo.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Demo.cpp b/Demo.cpp index e6a63a9..ab1861d 100644 --- a/Demo.cpp +++ b/Demo.cpp @@ -15,7 +15,7 @@ based on original demo.cpp #define PROCESS_CENTER_VERSION_MAJOR 0 #define PROCESS_CENTER_VERSION_MINOR 9 -#define PROCESS_CENTER_VERSION_MINOR_FIXES 2 +#define PROCESS_CENTER_VERSION_MINOR_FIXES 3 //opencv #include <opencv2/opencv.hpp> @@ -320,10 +320,10 @@ int main(int argc, char * argv[]) fileName = inputDir + TToolBox::getFileName(frameCounter); - //check the string - cout <<"open fileName: "<< fileName<<endl; - if(fileName.empty()) - cerr <<"error: empty string fileName"<<endl; +// //check the string +// cout <<"open fileName: "<< fileName<<endl; +// if(fileName.empty()) +// cerr <<"error: empty string fileName"<<endl; cout <<"\t"<<frameCounter<<"\tof \t"<<amountFiles<<" load file :"<< fileName<<endl; @@ -410,7 +410,7 @@ int main(int argc, char * argv[]) vector<Point2f> recCenterPoints; float areaMinThreshold = 150; - float areaMaxThreshold = 15000; //TODO apply moving filter ??, an more adaptive approach + float areaMaxThreshold = 300000; //old max threshold was to small //TODO apply moving filter ??, an more adaptive approach //iterate all rectangles for( size_t i = 0; i< minRect.size(); i++ ) @@ -529,14 +529,14 @@ int main(int argc, char * argv[]) #endif - cout<<"we try to write file: "<< i <<endl; + //cout<<"we try to write file: "<< i <<endl; //! step 8: we write down all our results in yml file std::string nameOutPutFileData = outputDir + TToolBox::mNzero(frameCounter) + ".yml"; - //check the string - cout <<"write output nameOutPutFileData: "<< nameOutPutFileData<<endl; - if(nameOutPutFileData.empty()) - cerr <<"error: empty string nameOutPutFileData"<<endl; +// //check the string +// cout <<"write output nameOutPutFileData: "<< nameOutPutFileData<<endl; +// if(nameOutPutFileData.empty()) +// cerr <<"error: empty string nameOutPutFileData"<<endl; FileStorage fs(nameOutPutFileData.c_str(), FileStorage::WRITE); @@ -582,10 +582,10 @@ int main(int argc, char * argv[]) //we write the file down std::string nameOutPutFileDBGpic = outputDir + TToolBox::mNzero(frameCounter) + ".jpg"; - //check the string - cout <<"write dbg file: "<< nameOutPutFileDBGpic<<endl; - if(nameOutPutFileDBGpic.empty()) - cerr <<"error: empty string nameOutPutFileDBGpic"<<endl; +// //check the string +// cout <<"write dbg file: "<< nameOutPutFileDBGpic<<endl; +// if(nameOutPutFileDBGpic.empty()) +// cerr <<"error: empty string nameOutPutFileDBGpic"<<endl; imwrite(nameOutPutFileDBGpic.c_str(),imgOverlay2); @@ -615,7 +615,6 @@ int main(int argc, char * argv[]) double elapsed = double(endAll - beginAll) / CLOCKS_PER_SEC; cout <<"process : "<<amountFiles<<" files took:\t"<<(int)(elapsed/60)<<" min -\t"<<(int)(elapsed/60/60)<<" h \n in total"<<endl; - //we write the random file list to a file std::string nameOutRandomFile = outputDir + "randlist.yml"; FileStorage fs(nameOutRandomFile.c_str(), FileStorage::WRITE); -- GitLab