20 #ifndef TESSERACT_CCMAIN_THRESHOLDER_H__ 21 #define TESSERACT_CCMAIN_THRESHOLDER_H__ 55 void SetImage(
const unsigned char* imagedata,
int width,
int height,
56 int bytes_per_pixel,
int bytes_per_line);
60 void SetRectangle(
int left,
int top,
int width,
int height);
66 virtual void GetImageSizes(
int* left,
int* top,
int* width,
int* height,
67 int* imagewidth,
int* imageheight);
71 return pix_channels_ >= 3;
76 return pix_channels_ == 0;
94 return scale_ * yres_;
102 estimated_res_ = ppi;
107 return scale_ * estimated_res_;
115 void SetImage(
const Pix* pix);
120 virtual void ThresholdToPix(
PageSegMode pageseg_mode, Pix** pix);
129 virtual Pix* GetPixRectThresholds();
142 virtual Pix* GetPixRectGrey();
153 return rect_left_ == 0 && rect_top_ == 0 &&
154 rect_width_ == image_width_ && rect_height_ == image_height_;
158 void OtsuThresholdRectToPix(Pix* src_pix, Pix** out_pix)
const;
164 void ThresholdRectToPix(Pix* src_pix,
int num_channels,
165 const int* thresholds,
const int* hi_values,
189 #endif // TESSERACT_CCMAIN_THRESHOLDER_H__ bool IsColor() const
Return true if the source image is color.
bool IsFullImage() const
Return true if we are processing the full image.
int GetScaledYResolution() const
void SetSourceYResolution(int ppi)
int GetSourceYResolution() const
void SetEstimatedResolution(int ppi)
int GetScaleFactor() const
int GetScaledEstimatedResolution() const
bool IsBinary() const
Returns true if the source image is binary.