mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-19 23:19:07 +08:00
commit
7a308edcb1
@ -2111,9 +2111,8 @@ bool TessBaseAPI::Threshold(Pix **pix) {
|
||||
auto thresholding_method = static_cast<ThresholdMethod>(static_cast<int>(tesseract_->thresholding_method));
|
||||
|
||||
if (thresholding_method == ThresholdMethod::Otsu) {
|
||||
auto pageseg_mode = static_cast<PageSegMode>(static_cast<int>(tesseract_->tessedit_pageseg_mode));
|
||||
Image pix_binary(*pix);
|
||||
if (!thresholder_->ThresholdToPix(pageseg_mode, &pix_binary)) {
|
||||
if (!thresholder_->ThresholdToPix(&pix_binary)) {
|
||||
return false;
|
||||
}
|
||||
*pix = pix_binary;
|
||||
|
@ -219,7 +219,7 @@ std::tuple<bool, Image, Image, Image> ImageThresholder::Threshold(
|
||||
// Creates a Pix and sets pix to point to the resulting pointer.
|
||||
// Caller must use pixDestroy to free the created Pix.
|
||||
/// Returns false on error.
|
||||
bool ImageThresholder::ThresholdToPix(PageSegMode pageseg_mode, Image *pix) {
|
||||
bool ImageThresholder::ThresholdToPix(Image *pix) {
|
||||
if (image_width_ > INT16_MAX || image_height_ > INT16_MAX) {
|
||||
tprintf("Image too large: (%d, %d)\n", image_width_, image_height_);
|
||||
return false;
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
/// Creates a Pix and sets pix to point to the resulting pointer.
|
||||
/// Caller must use pixDestroy to free the created Pix.
|
||||
/// Returns false on error.
|
||||
virtual bool ThresholdToPix(PageSegMode pageseg_mode, Image *pix);
|
||||
virtual bool ThresholdToPix(Image *pix);
|
||||
|
||||
virtual std::tuple<bool, Image, Image, Image> Threshold(
|
||||
ThresholdMethod method);
|
||||
|
Loading…
Reference in New Issue
Block a user