imgmanipbs.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef IMGMANIPBS_H
  2. #define IMGMANIPBS_H
  3. #define cimg_use_jpeg
  4. #include "CImg.h"
  5. using namespace cimg_library;
  6. class ImgManipBS
  7. {
  8. public:
  9. ImgManipBS();
  10. ImgManipBS(const char* fileName);
  11. CImg<unsigned char> mainImage;
  12. CImg<unsigned char> outImages[2]; // One for white(0) and one for black(1)
  13. int width;
  14. int height;
  15. int **whiteMeanValues;
  16. int **blackMeanValues;
  17. void EvaluateImage();
  18. double GetBrightness(unsigned int x,unsigned int y);
  19. void findNearValues(int x,int y, double &meanWhite, double &meanBlack);
  20. void MarkPixelInOutImage(int imageNo,int x,int y);
  21. void DrawGradRect(int imageNo,int x,int y, unsigned char p1, unsigned char p2, unsigned char p3, unsigned char p4);
  22. void DrawTopGradRect(int imageNo,int x,int y, unsigned char p1, unsigned char p2);
  23. void CreateGradiantImage();
  24. int noOfWSquares;
  25. int noOfHSquares;
  26. // Constants that affect the sizes of differents measurements in the image process
  27. const int squareSize = 150;
  28. const int measureSquareSize = 70;
  29. const int squareMargin = measureSquareSize / 2;
  30. const int noOfMeanValues = 10;
  31. };
  32. #endif // IMGMANIPBS_H