Эх сурвалжийг харах

minor changes on color weijer test program

Alexander Freytag 12 жил өмнө
parent
commit
5a722d2172

+ 37 - 4
features/localfeatures/progs/testColorWeijer.cpp

@@ -10,19 +10,52 @@ using namespace std;
 using namespace NICE;
 using namespace OBJREC;
 
-int main(int argc, char **argv)
+
+/**
+ * @brief Printing main menu.
+ * @author Alexander Freytag
+ * @date 13-02-2013
+ * 
+ * @return void
+ **/
+void print_main_menu()
+{
+  std::cerr << "=====================================================================================" << std::endl;
+  std::cerr << "||This is a small programm demonstrating the computation of 11-dim color features.  ||" << std::endl;
+  std::cerr << "=====================================================================================" << std::endl;  
+  
+  std::cout << std::endl << "Input options:" << std::endl;
+  std::cout << "   -i <filename>  the name of the image which shall be transformed"<< std::endl;
+  return;
+}
+
+
+//post-process active learning segmentation results, such that the given images are normalized to be visualized in the same range
+int main( int argc, char* argv[] )
 {
-  if (argc < 1)
+  
+  int rc;
+  if (argc<2)
   {
-    cerr << "Bitte Bild angeben" << endl;
+    print_main_menu();
     return -1;
   }
+  
+  std::string filename("");
+  while ((rc=getopt(argc,argv,"i:h"))>=0)
+  {
+    switch(rc)
+    {
+      case 'i': filename = optarg; break;
+      default: print_main_menu();
+    }
+  }   
 
   Config *conf = new Config();
   LFColorWeijer lfc(conf);
 
   //! testen
-  ColorImage cimg(argv[1]);
+  ColorImage cimg(filename);
   ColorImage out;
   lfc.visualizeFeatures (cimg, out);