Skip to content

Commit

Permalink
Fix issue #4010 (#4041)
Browse files Browse the repository at this point in the history
Enable some code blocks that were wrongly disabled when the legacy engine is disabled at compile time.
  • Loading branch information
amitdo authored Mar 28, 2023
1 parent bbc2dfc commit fa4d444
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ccmain/pagesegmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<int> osd_scripts;
if (osd_tess != this) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fa4d444

Please sign in to comment.