changeset 1020:9fb82fe0156f

added quiet tracking mode
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 05 Jun 2018 14:33:31 -0400
parents 5d2f6afae35b
children 16932cefabc1
files c/Parameters.cpp c/feature-based-tracking.cpp include/Parameters.hpp
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/c/Parameters.cpp	Mon Jun 04 23:35:50 2018 -0400
+++ b/c/Parameters.cpp	Tue Jun 05 14:33:31 2018 -0400
@@ -22,6 +22,7 @@
     ("tf", "tracks features")
     ("gf", "groups features")
     ("loading-time", "report feature and object loading times")
+    ("quiet", "mute printing of frame numbers")
     ("config-file", po::value<string>(&configurationFilename), "configuration file")
     ;
 
@@ -108,6 +109,7 @@
     trackFeatures = vm.count("tf")>0;
     groupFeatures = vm.count("gf")>0;
     loadingTime = vm.count("loading-time")>0;
+    quiet = vm.count("quiet")>0;
 
     if (vm.count("help")) {
       cout << cmdLine << endl;
--- a/c/feature-based-tracking.cpp	Mon Jun 04 23:35:50 2018 -0400
+++ b/c/feature-based-tracking.cpp	Tue Jun 05 14:33:31 2018 -0400
@@ -160,7 +160,7 @@
     if (frame.empty()) {
       cout << "Empty frame " << frameNum << ", breaking (" << frame.empty() << " [" << frame.size().width << "x" << frame.size().height << "])" << endl;
       break;
-    } else if (frameNum%50 ==0)
+    } else if (!params.quiet && (frameNum%50 ==0))
       cout << "frame " << frameNum << endl;
     
     cvtColor(frame, currentFrameBW, CV_RGB2GRAY);
@@ -296,7 +296,7 @@
   for (frameNum = firstFrameNum; frameNum<lastFrameNum; frameNum ++) {
     vector<int> trajectoryIds;
     success  = trajectoryDB->trajectoryIdEndingAt(trajectoryIds, frameNum);
-    if (frameNum%100 ==0)
+    if (!params.quiet && (frameNum%100 ==0))
       cout << "frame " << frameNum << endl;
 #if DEBUG
     cout << trajectoryIds.size() << " trajectories " << endl;
@@ -321,7 +321,7 @@
       }
     }
     
-    if (frameNum%100 ==0)
+    if (!params.quiet && (frameNum%100 ==0))
       cout << featureGraph.informationString() << endl;
   }
 
--- a/include/Parameters.hpp	Mon Jun 04 23:35:50 2018 -0400
+++ b/include/Parameters.hpp	Tue Jun 05 14:33:31 2018 -0400
@@ -17,6 +17,7 @@
   bool trackFeatures;
   bool groupFeatures;
   bool loadingTime;
+  bool quiet;
 
   std::string parentDirname;
   std::string videoFilename;