Sfoglia il codice sorgente

check nfiles with param

Jérôme BUISINE 4 anni fa
parent
commit
8b5e7270dc
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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"};
     unsigned blockHeight;
     unsigned blockWidth;
+    unsigned nfiles = 10000;
     std::string outputFolder;
 
     for (int i = 1; i < argc; ++i) {
@@ -193,6 +194,8 @@ int main(int argc, char *argv[]){
             blockWidth = atoi(argv[++i]);
         } else if (!strcmp(argv[i], "--output") || !strcmp(argv[i], "-output")) {
             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::tuple<unsigned, unsigned, unsigned> data = rawls::getDimensionsRAWLS(imagesPath.at(0));