testColorWeijer.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include <fstream>
  2. #include "core/vector/VectorT.h"
  3. #include "core/vector/MatrixT.h"
  4. #include "core/image/ImageT.h"
  5. #include "core/imagedisplay/ImageDisplay.h"
  6. #include <iostream>
  7. #include "vislearning/features/localfeatures/LFColorWeijer.h"
  8. using namespace std;
  9. using namespace NICE;
  10. using namespace OBJREC;
  11. /**
  12. * @brief Printing main menu.
  13. * @author Alexander Freytag
  14. * @date 13-02-2013
  15. *
  16. * @return void
  17. **/
  18. void print_main_menu()
  19. {
  20. std::cerr << "=====================================================================================" << std::endl;
  21. std::cerr << "||This is a small programm demonstrating the computation of 11-dim color features. ||" << std::endl;
  22. std::cerr << "=====================================================================================" << std::endl;
  23. std::cout << std::endl << "Input options:" << std::endl;
  24. std::cout << " -i <filename> the name of the image which shall be transformed"<< std::endl;
  25. return;
  26. }
  27. //post-process active learning segmentation results, such that the given images are normalized to be visualized in the same range
  28. int main( int argc, char* argv[] )
  29. {
  30. int rc;
  31. if (argc<2)
  32. {
  33. print_main_menu();
  34. return -1;
  35. }
  36. std::string filename("");
  37. while ((rc=getopt(argc,argv,"i:h"))>=0)
  38. {
  39. switch(rc)
  40. {
  41. case 'i': filename = optarg; break;
  42. default: print_main_menu();
  43. }
  44. }
  45. Config *conf = new Config();
  46. LFColorWeijer lfc(conf);
  47. //! testen
  48. ColorImage cimg(filename);
  49. ColorImage out;
  50. lfc.visualizeFeatures (cimg, out);
  51. cimg.writePPM("org.ppm");
  52. out.writePPM("out.ppm");
  53. return 0;
  54. }