Parcourir la source

check nfiles with param

Jérôme BUISINE il y a 4 ans
Parent
commit
8b5e7270dc
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      main/extract_stats_images_all.cpp

+ 7 - 0
main/extract_stats_images_all.cpp

@@ -182,6 +182,7 @@ int main(int argc, char *argv[]){
     std::vector<std::string> estimators = {"median", "var", "std", "skewness", "kurtosis", "mode"};
     std::vector<std::string> estimators = {"median", "var", "std", "skewness", "kurtosis", "mode"};
     unsigned blockHeight;
     unsigned blockHeight;
     unsigned blockWidth;
     unsigned blockWidth;
+    unsigned nfiles = 10000;
     std::string outputFolder;
     std::string outputFolder;
 
 
     for (int i = 1; i < argc; ++i) {
     for (int i = 1; i < argc; ++i) {
@@ -193,6 +194,8 @@ int main(int argc, char *argv[]){
             blockWidth = atoi(argv[++i]);
             blockWidth = atoi(argv[++i]);
         } else if (!strcmp(argv[i], "--output") || !strcmp(argv[i], "-output")) {
         } else if (!strcmp(argv[i], "--output") || !strcmp(argv[i], "-output")) {
             outputFolder = argv[++i];
             outputFolder = argv[++i];
+        } else if (!strcmp(argv[i], "--nfiles") || !strcmp(argv[i], "-nfiles")) {
+            nfiles = atoi(argv[++i]);
         }
         }
     }
     }
 
 
@@ -205,6 +208,10 @@ int main(int argc, char *argv[]){
         }
         }
     }
     }
 
 
+    if (imagesPath.size() != nfiles) {
+        return 0;
+    }
+
     std::sort(imagesPath.begin(), imagesPath.end());
     std::sort(imagesPath.begin(), imagesPath.end());
 
 
     std::tuple<unsigned, unsigned, unsigned> data = rawls::getDimensionsRAWLS(imagesPath.at(0));
     std::tuple<unsigned, unsigned, unsigned> data = rawls::getDimensionsRAWLS(imagesPath.at(0));