main.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <iostream>
  2. #include "CImg.h"
  3. using namespace cimg_library;
  4. #include "pagenormalizer.h"
  5. using namespace std;
  6. // Should be compiled with (in Linux)
  7. // g++ -o hello_word.exe hello_world.cpp -O2 -L/usr/X11R6/lib -lm -lpthread -lX11
  8. int getBrightness(const CImg<unsigned int>& image,unsigned int x,unsigned int y);
  9. int main(int argc, char *argv[])
  10. {
  11. std::string file_i( cimg_option("-i","./input_example.jpg","Input image") );
  12. std::string file_white_ref( cimg_option("-wref","./ref_white.jpg","White ref image") );
  13. std::string file_black_ref( cimg_option("-bref","./ref_black.jpg","Black ref image") );
  14. std::string file_settings( cimg_option("-s","./settings.txt","Settings file") );
  15. std::string file_o( cimg_option("-o","./output.jpg","Output file") );
  16. const bool quiet = cimg_option("-q",false,0); // This is a hidden option
  17. const int rotate = cimg_option("-r",0,0);
  18. printf("Rot: %d\n ",rotate);
  19. PageNormalizer pn = PageNormalizer(file_i, file_o, file_white_ref, file_black_ref, file_settings, quiet, rotate);
  20. return 0;
  21. }