19 #ifndef TESSERACT_CCMAIN_THRESHOLDER_H_
20 #define TESSERACT_CCMAIN_THRESHOLDER_H_
54 void SetImage(
const unsigned char* imagedata,
int width,
int height,
55 int bytes_per_pixel,
int bytes_per_line);
59 void SetRectangle(
int left,
int top,
int width,
int height);
65 virtual void GetImageSizes(
int* left,
int* top,
int* width,
int* height,
66 int* imagewidth,
int* imageheight);
70 return pix_channels_ >= 3;
75 return pix_channels_ == 0;
93 return scale_ * yres_;
101 estimated_res_ = ppi;
106 return scale_ * estimated_res_;
114 void SetImage(
const Pix* pix);
120 virtual bool ThresholdToPix(
PageSegMode pageseg_mode, Pix** pix);
129 virtual Pix* GetPixRectThresholds();
142 virtual Pix* GetPixRectGrey();
153 return rect_left_ == 0 && rect_top_ == 0 && rect_width_ == image_width_ &&
154 rect_height_ == image_height_;
158 void OtsuThresholdRectToPix(Pix* src_pix, Pix** out_pix)
const;
164 void ThresholdRectToPix(Pix* src_pix,
int num_channels,
const int* thresholds,
165 const int* hi_values, Pix** pix)
const;
188 #endif // TESSERACT_CCMAIN_THRESHOLDER_H_