"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ccmain/control.cpp" between
tesseract-5.0.0-rc2.tar.gz and tesseract-5.0.0-rc3.tar.gz

About: Tesseract is an Optical Character Recognition (OCR) engine. Release candidate.

control.cpp  (tesseract-5.0.0-rc2):control.cpp  (tesseract-5.0.0-rc3)
skipping to change at line 48 skipping to change at line 48
#include "pageres.h" // for WERD_RES, PAGE_RES_IT, PAGE_RES, BLO... #include "pageres.h" // for WERD_RES, PAGE_RES_IT, PAGE_RES, BLO...
#ifndef DISABLED_LEGACY_ENGINE #ifndef DISABLED_LEGACY_ENGINE
# include "reject.h" # include "reject.h"
#endif #endif
#include "sorthelper.h" #include "sorthelper.h"
#include "tesseractclass.h" #include "tesseractclass.h"
#include "tessvars.h" #include "tessvars.h"
#include "werdit.h" #include "werdit.h"
const char *const kBackUpConfigFile = "tempconfigdata.config"; const char *const kBackUpConfigFile = "tempconfigdata.config";
#ifndef DISABLED_LEGACY_ENGINE
// Min believable x-height for any text when refitting as a fraction of // Min believable x-height for any text when refitting as a fraction of
// original x-height // original x-height
const double kMinRefitXHeightFraction = 0.5; const double kMinRefitXHeightFraction = 0.5;
#endif // ! DISABLED_LEGACY_ENGINE
/** /**
* Make a word from the selected blobs and run Tess on them. * Make a word from the selected blobs and run Tess on them.
* *
* @param page_res recognise blobs * @param page_res recognise blobs
* @param selection_box within this box * @param selection_box within this box
*/ */
namespace tesseract { namespace tesseract {
void Tesseract::recog_pseudo_word(PAGE_RES *page_res, TBOX &selection_box) { void Tesseract::recog_pseudo_word(PAGE_RES *page_res, TBOX &selection_box) {
skipping to change at line 1898 skipping to change at line 1900
} else { } else {
return false; return false;
} }
} }
/** /**
* find_modal_font * find_modal_font
* *
* Find the modal font and remove from the stats. * Find the modal font and remove from the stats.
*/ */
#ifndef DISABLED_LEGACY_ENGINE
static void find_modal_font( // good chars in word static void find_modal_font( // good chars in word
STATS *fonts, // font stats STATS *fonts, // font stats
int16_t *font_out, // output font int16_t *font_out, // output font
int8_t *font_count // output count int8_t *font_count // output count
) { ) {
int16_t font; // font index int16_t font; // font index
int32_t count; // pile count int32_t count; // pile count
if (fonts->get_total() > 0) { if (fonts->get_total() > 0) {
font = static_cast<int16_t>(fonts->mode()); font = static_cast<int16_t>(fonts->mode());
*font_out = font; *font_out = font;
count = fonts->pile_count(font); count = fonts->pile_count(font);
*font_count = count < INT8_MAX ? count : INT8_MAX; *font_count = count < INT8_MAX ? count : INT8_MAX;
fonts->add(font, -*font_count); fonts->add(font, -*font_count);
} else { } else {
*font_out = -1; *font_out = -1;
*font_count = 0; *font_count = 0;
} }
} }
#endif // ! DISABLED_LEGACY_ENGINE
/** /**
* set_word_fonts * set_word_fonts
* *
* Get the fonts for the word. * Get the fonts for the word.
*/ */
void Tesseract::set_word_fonts(WERD_RES *word) { void Tesseract::set_word_fonts(WERD_RES *word) {
// Don't try to set the word fonts for an lstm word, as the configs // Don't try to set the word fonts for an lstm word, as the configs
// will be meaningless. // will be meaningless.
if (word->chopped_word == nullptr) { if (word->chopped_word == nullptr) {
 End of changes. 4 change blocks. 
0 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)