Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #4010 #4041

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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