Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo committed May 8, 2021
1 parent 11c73c9 commit 127d799
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions include/tesseract/publictypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ bool TessBaseAPI::Threshold(Pix **pix) {

auto thresholding_method = static_cast<ThreshMethod>(static_cast<int>(tesseract_->thresholding_method));

if (thresholding_method == OTSU_TRESH) {
if (thresholding_method == OTSU_THRESH) {
if (!thresholder_->ThresholdToPix(pageseg_mode, &pix_binary)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ccmain/tesseractclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/ccmain/tesseractclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions src/ccmain/thresholder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ std::tuple<bool, Image, Image, Image> 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());
}
Expand Down
1 change: 0 additions & 1 deletion src/ccstruct/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 127d799

Please sign in to comment.