diff --git a/src/ccmain/pagesegmain.cpp b/src/ccmain/pagesegmain.cpp index 0af4460709..ea7af538c8 100644 --- a/src/ccmain/pagesegmain.cpp +++ b/src/ccmain/pagesegmain.cpp @@ -332,11 +332,11 @@ ColumnFinder *Tesseract::SetupPageSegAndDetectOrientation(PageSegMode pageseg_mo finder->SetupAndFilterNoise(pageseg_mode, *photo_mask_pix, to_block); -#ifndef DISABLED_LEGACY_ENGINE - + #ifndef DISABLED_LEGACY_ENGINE if (equ_detect_) { equ_detect_->LabelSpecialText(to_block); } + #endif BLOBNBOX_CLIST osd_blobs; // osd_orientation is the number of 90 degree rotations to make the @@ -350,6 +350,8 @@ ColumnFinder *Tesseract::SetupPageSegAndDetectOrientation(PageSegMode pageseg_mo vertical_text = finder->IsVerticallyAlignedText(textord_tabfind_vertical_text_ratio, to_block, &osd_blobs); } + + #ifndef DISABLED_LEGACY_ENGINE if (PSM_OSD_ENABLED(pageseg_mode) && osd_tess != nullptr && osr != nullptr) { std::vector osd_scripts; if (osd_tess != this) { @@ -400,10 +402,10 @@ ColumnFinder *Tesseract::SetupPageSegAndDetectOrientation(PageSegMode pageseg_mo } } } + #endif // ndef DISABLED_LEGACY_ENGINE + osd_blobs.shallow_clear(); finder->CorrectOrientation(to_block, vertical_text, osd_orientation); - -#endif // ndef DISABLED_LEGACY_ENGINE } return finder;