Skip to content

Commit

Permalink
adjust code to match tesseract-ocr#4070: export orientation.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerHobbelt committed Aug 5, 2023
1 parent f962ec8 commit b9a1070
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/ccmain/pagesegmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ int Tesseract::SegmentPage(const char *input_file, BLOCK_LIST *blocks, Tesseract
}

textord_.TextordPage(pageseg_mode, reskew_, width, height, pix_binary_, pix_thresholds_,
pix_grey_, splitting || cjk_mode, &diacritic_blobs, blocks, &to_blocks, osr->gradient);
pix_grey_, splitting || cjk_mode, &diacritic_blobs, blocks, &to_blocks, gradient_);

tprintf("Page Gradient OSR estimate: {}\n", osr->gradient);
tprintf("Page Gradient TextOrd estimate: {}\n", gradient_);

if ( max_page_gradient_recognize != 100 && abs(osr->gradient) > abs(max_page_gradient_recognize) ) {
tprintf("Returning early due to high page gradient.\n");
tprintf("Page Gradient: {}\n", osr->gradient);
return -1;
}

Expand Down
3 changes: 2 additions & 1 deletion src/textord/textord.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class Textord {
// to the appropriate word(s) in case they are really diacritics.
void TextordPage(PageSegMode pageseg_mode, const FCOORD &reskew, int width, int height,
Image binary_pix, Image thresholds_pix, Image grey_pix, bool use_box_bottoms,
BLOBNBOX_LIST *diacritic_blobs, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks, float &gradient);
BLOBNBOX_LIST *diacritic_blobs, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks,
float &gradient);

// If we were supposed to return only a single textline, and there is more
// than one, clean up and leave only the best.
Expand Down

0 comments on commit b9a1070

Please sign in to comment.