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);
121 virtual bool ThresholdToPix(
PageSegMode pageseg_mode, Pix** pix);
130 virtual Pix* GetPixRectThresholds();
143 virtual Pix* GetPixRectGrey();
154 return rect_left_ == 0 && rect_top_ == 0 &&
155 rect_width_ == image_width_ && rect_height_ == image_height_;
159 void OtsuThresholdRectToPix(Pix* src_pix, Pix** out_pix)
const;
165 void ThresholdRectToPix(Pix* src_pix,
int num_channels,
166 const int* thresholds,
const int* hi_values,
190 #endif // TESSERACT_CCMAIN_THRESHOLDER_H_
int GetScaleFactor() const
bool IsFullImage() const
Return true if we are processing the full image.
int GetScaledYResolution() const
int GetScaledEstimatedResolution() const
void SetSourceYResolution(int ppi)
void SetEstimatedResolution(int ppi)
int GetSourceYResolution() const
bool IsBinary() const
Returns true if the source image is binary.
bool IsColor() const
Return true if the source image is color.