Skip to content
Snippets Groups Projects
Commit 97818fe3 authored by Thomas Boy's avatar Thomas Boy
Browse files

fix logic bug, max area threshold to small, will eleminate a lot of frames, silent mode again

parent 48fbbfa8
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ based on original demo.cpp ...@@ -15,7 +15,7 @@ based on original demo.cpp
#define PROCESS_CENTER_VERSION_MAJOR 0 #define PROCESS_CENTER_VERSION_MAJOR 0
#define PROCESS_CENTER_VERSION_MINOR 9 #define PROCESS_CENTER_VERSION_MINOR 9
#define PROCESS_CENTER_VERSION_MINOR_FIXES 2 #define PROCESS_CENTER_VERSION_MINOR_FIXES 3
//opencv //opencv
#include <opencv2/opencv.hpp> #include <opencv2/opencv.hpp>
...@@ -320,10 +320,10 @@ int main(int argc, char * argv[]) ...@@ -320,10 +320,10 @@ int main(int argc, char * argv[])
fileName = inputDir + TToolBox::getFileName(frameCounter); fileName = inputDir + TToolBox::getFileName(frameCounter);
//check the string // //check the string
cout <<"open fileName: "<< fileName<<endl; // cout <<"open fileName: "<< fileName<<endl;
if(fileName.empty()) // if(fileName.empty())
cerr <<"error: empty string fileName"<<endl; // cerr <<"error: empty string fileName"<<endl;
cout <<"\t"<<frameCounter<<"\tof \t"<<amountFiles<<" load file :"<< fileName<<endl; cout <<"\t"<<frameCounter<<"\tof \t"<<amountFiles<<" load file :"<< fileName<<endl;
...@@ -410,7 +410,7 @@ int main(int argc, char * argv[]) ...@@ -410,7 +410,7 @@ int main(int argc, char * argv[])
vector<Point2f> recCenterPoints; vector<Point2f> recCenterPoints;
float areaMinThreshold = 150; 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 //iterate all rectangles
for( size_t i = 0; i< minRect.size(); i++ ) for( size_t i = 0; i< minRect.size(); i++ )
...@@ -529,14 +529,14 @@ int main(int argc, char * argv[]) ...@@ -529,14 +529,14 @@ int main(int argc, char * argv[])
#endif #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 //! step 8: we write down all our results in yml file
std::string nameOutPutFileData = outputDir + TToolBox::mNzero(frameCounter) + ".yml"; std::string nameOutPutFileData = outputDir + TToolBox::mNzero(frameCounter) + ".yml";
//check the string // //check the string
cout <<"write output nameOutPutFileData: "<< nameOutPutFileData<<endl; // cout <<"write output nameOutPutFileData: "<< nameOutPutFileData<<endl;
if(nameOutPutFileData.empty()) // if(nameOutPutFileData.empty())
cerr <<"error: empty string nameOutPutFileData"<<endl; // cerr <<"error: empty string nameOutPutFileData"<<endl;
FileStorage fs(nameOutPutFileData.c_str(), FileStorage::WRITE); FileStorage fs(nameOutPutFileData.c_str(), FileStorage::WRITE);
...@@ -582,10 +582,10 @@ int main(int argc, char * argv[]) ...@@ -582,10 +582,10 @@ int main(int argc, char * argv[])
//we write the file down //we write the file down
std::string nameOutPutFileDBGpic = outputDir + TToolBox::mNzero(frameCounter) + ".jpg"; std::string nameOutPutFileDBGpic = outputDir + TToolBox::mNzero(frameCounter) + ".jpg";
//check the string // //check the string
cout <<"write dbg file: "<< nameOutPutFileDBGpic<<endl; // cout <<"write dbg file: "<< nameOutPutFileDBGpic<<endl;
if(nameOutPutFileDBGpic.empty()) // if(nameOutPutFileDBGpic.empty())
cerr <<"error: empty string nameOutPutFileDBGpic"<<endl; // cerr <<"error: empty string nameOutPutFileDBGpic"<<endl;
imwrite(nameOutPutFileDBGpic.c_str(),imgOverlay2); imwrite(nameOutPutFileDBGpic.c_str(),imgOverlay2);
...@@ -615,7 +615,6 @@ int main(int argc, char * argv[]) ...@@ -615,7 +615,6 @@ int main(int argc, char * argv[])
double elapsed = double(endAll - beginAll) / CLOCKS_PER_SEC; 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; 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 //we write the random file list to a file
std::string nameOutRandomFile = outputDir + "randlist.yml"; std::string nameOutRandomFile = outputDir + "randlist.yml";
FileStorage fs(nameOutRandomFile.c_str(), FileStorage::WRITE); FileStorage fs(nameOutRandomFile.c_str(), FileStorage::WRITE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment