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 &&
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_ int pix_channels_
Number of 8-bit channels in pix_.
int yres_
y pixels/inch in source image.
int pix_wpl_
Words per line of pix_.
bool IsColor() const
Return true if the source image is color.
int image_height_
Height of source pix_.
void SetSourceYResolution(int ppi)
bool IsBinary() const
Returns true if the source image is binary.
int GetScaledEstimatedResolution() const
int estimated_res_
Resolution estimate from text size.
int GetScaledYResolution() const
int scale_
Scale factor from original image.
int GetSourceYResolution() const
int GetScaleFactor() const
int image_width_
Width of source pix_.
void SetEstimatedResolution(int ppi)
bool IsFullImage() const
Return true if we are processing the full image.