diff --git a/include/tesseract/publictypes.h b/include/tesseract/publictypes.h index a81220ff80..99d0d8f660 100644 --- a/include/tesseract/publictypes.h +++ b/include/tesseract/publictypes.h @@ -283,10 +283,10 @@ enum OcrEngineMode { * Leptonica is used for thresholding */ enum ThreshMethod { - OTSU_TRESH, // Legacy Tesseract's Otsu thresholding - ADAPTIVE_OTSU_TRESH, - SAUVOLA_TILED_TRESH, - TRESH_METHODS_COUNT, // Number of Thresholding methods + OTSU_THRESH, // Legacy Tesseract's Otsu thresholding + ADAPTIVE_OTSU_THRESH, + SAUVOLA_TILED_THRESH, + THRESH_METHODS_COUNT, // Number of Thresholding methods }; } // namespace tesseract. diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 4b376ee55e..f4c1f813b2 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -2115,7 +2115,7 @@ bool TessBaseAPI::Threshold(Pix **pix) { auto thresholding_method = static_cast(static_cast(tesseract_->thresholding_method)); - if (thresholding_method == OTSU_TRESH) { + if (thresholding_method == OTSU_THRESH) { if (!thresholder_->ThresholdToPix(pageseg_mode, &pix_binary)) { return false; } diff --git a/src/ccmain/tesseractclass.cpp b/src/ccmain/tesseractclass.cpp index 50a7789103..c41092b6a4 100644 --- a/src/ccmain/tesseractclass.cpp +++ b/src/ccmain/tesseractclass.cpp @@ -74,7 +74,7 @@ Tesseract::Tesseract() "11=sparse_text, 12=sparse_text+osd, 13=raw_line" " (Values from PageSegMode enum in tesseract/publictypes.h)", this->params()) - , INT_MEMBER(thresholding_method, OTSU_TRESH, + , INT_MEMBER(thresholding_method, OTSU_THRESH, "Thresholding method: 0 = Otsu, 1 = Adaptive Otsu, 2 = Sauvola", this->params()) , INT_INIT_MEMBER(tessedit_ocr_engine_mode, tesseract::OEM_DEFAULT, diff --git a/src/ccmain/tesseractclass.h b/src/ccmain/tesseractclass.h index ad9011ec2a..958c02b2c9 100644 --- a/src/ccmain/tesseractclass.h +++ b/src/ccmain/tesseractclass.h @@ -762,7 +762,7 @@ class TESS_API Tesseract : public Wordrec { "Page seg mode: 0=osd only, 1=auto+osd, 2=auto, 3=col, 4=block," " 5=line, 6=word, 7=char" " (Values from PageSegMode enum in tesseract/publictypes.h)"); - INT_VAR_H(thresholding_method, OTSU_TRESH, + INT_VAR_H(thresholding_method, OTSU_THRESH, "Thresholding method: 0 = Otsu, 1 = Adaptive Otsu, 2 = Sauvola"); INT_VAR_H(tessedit_ocr_engine_mode, tesseract::OEM_DEFAULT, "Which OCR engine(s) to run (Tesseract, LSTM, both). Defaults" diff --git a/src/ccmain/thresholder.cpp b/src/ccmain/thresholder.cpp index ba17fc8f37..12f5cf8336 100644 --- a/src/ccmain/thresholder.cpp +++ b/src/ccmain/thresholder.cpp @@ -207,15 +207,15 @@ std::tuple ImageThresholder::Threshold( pix_grey = GetPixRectGrey(); - if (method == OTSU_TRESH || method >= TRESH_METHODS_COUNT) { - method = ADAPTIVE_OTSU_TRESH; + if (method == OTSU_THRESH || method >= THRESH_METHODS_COUNT) { + method = ADAPTIVE_OTSU_THRESH; } int r; - if (method == ADAPTIVE_OTSU_TRESH) { + if (method == ADAPTIVE_OTSU_THRESH) { r = pixOtsuAdaptiveThreshold(pix_grey, 300, 300, 0, 0, 0.1, pix_thresholds.a(), pix_binary.a()); - } else if (method == SAUVOLA_TILED_TRESH) { + } else if (method == SAUVOLA_TILED_THRESH) { r = pixSauvolaBinarizeTiled(pix_grey, 25, 0.40, 300, 300, pix_thresholds.a(), pix_binary.a()); } diff --git a/src/ccstruct/image.h b/src/ccstruct/image.h index ca7030fc00..b448fa83cb 100644 --- a/src/ccstruct/image.h +++ b/src/ccstruct/image.h @@ -35,7 +35,6 @@ class TESS_API Image { Pix *operator->() const { return pix_; } Pix **a() { return &pix_; } - // api Image clone() const; // increases refcount Image copy() const; // does full copy