From b9a1070a569ae5826e574e3cb7715b081453ec95 Mon Sep 17 00:00:00 2001 From: Ger Hobbelt Date: Sat, 5 Aug 2023 15:54:25 +0200 Subject: [PATCH] adjust code to match https://github.com/tesseract-ocr/tesseract/pull/4070: export orientation. --- src/ccmain/pagesegmain.cpp | 6 ++++-- src/textord/textord.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ccmain/pagesegmain.cpp b/src/ccmain/pagesegmain.cpp index 56002ce770..144211f2e1 100644 --- a/src/ccmain/pagesegmain.cpp +++ b/src/ccmain/pagesegmain.cpp @@ -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; } diff --git a/src/textord/textord.h b/src/textord/textord.h index 911dc3c20d..20ea364a8f 100644 --- a/src/textord/textord.h +++ b/src/textord/textord.h @@ -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.