testColorWeijer.cpp 1.6 KB

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