tesseract  4.1.1
tesseractclass.h
Go to the documentation of this file.
1 // File: tesseractclass.h
3 // Description: The Tesseract class. It holds/owns everything needed
4 // to run Tesseract on a single language, and also a set of
5 // sub-Tesseracts to run sub-languages. For thread safety, *every*
6 // global variable goes in here, directly, or indirectly.
7 // This makes it safe to run multiple Tesseracts in different
8 // threads in parallel, and keeps the different language
9 // instances separate.
10 // Author: Ray Smith
11 //
12 // (C) Copyright 2008, Google Inc.
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 // http://www.apache.org/licenses/LICENSE-2.0
17 // Unless required by applicable law or agreed to in writing, software
18 // distributed under the License is distributed on an "AS IS" BASIS,
19 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 // See the License for the specific language governing permissions and
21 // limitations under the License.
22 //
24 
25 #ifndef TESSERACT_CCMAIN_TESSERACTCLASS_H_
26 #define TESSERACT_CCMAIN_TESSERACTCLASS_H_
27 
28 #include <cstdint> // for int16_t, int32_t, uint16_t
29 #include <cstdio> // for FILE
30 #include "allheaders.h" // for pixDestroy, pixGetWidth, pixGetHe...
31 #include "control.h" // for ACCEPTABLE_WERD_TYPE
32 #include "debugpixa.h" // for DebugPixa
33 #include "devanagari_processing.h" // for ShiroRekhaSplitter
34 #ifndef DISABLED_LEGACY_ENGINE
35 #include "docqual.h" // for GARBAGE_LEVEL
36 #endif
37 #include "genericvector.h" // for GenericVector, PointerVector
38 #include "pageres.h" // for WERD_RES (ptr only), PAGE_RES (pt...
39 #include "params.h" // for BOOL_VAR_H, BoolParam, DoubleParam
40 #include "points.h" // for FCOORD
41 #include "publictypes.h" // for OcrEngineMode, PageSegMode, OEM_L...
42 #include "ratngs.h" // for ScriptPos, WERD_CHOICE (ptr only)
43 #include "strngs.h" // for STRING
44 #include "tessdatamanager.h" // for TessdataManager
45 #include "textord.h" // for Textord
46 #include "unichar.h" // for UNICHAR_ID
47 #include "wordrec.h" // for Wordrec
48 
49 class BLOCK_LIST;
50 class ETEXT_DESC;
51 struct OSResults;
52 class PAGE_RES;
53 class PAGE_RES_IT;
54 struct Pix;
55 class ROW;
56 class SVMenuNode;
57 class TBOX;
58 class TO_BLOCK_LIST;
59 class WERD;
60 class WERD_CHOICE;
61 class WERD_RES;
62 
63 // Top-level class for all tesseract global instance data.
64 // This class either holds or points to all data used by an instance
65 // of Tesseract, including the memory allocator. When this is
66 // complete, Tesseract will be thread-safe. UNTIL THEN, IT IS NOT!
67 //
68 // NOTE to developers: Do not create cyclic dependencies through this class!
69 // The directory dependency tree must remain a tree! The keep this clean,
70 // lower-level code (eg in ccutil, the bottom level) must never need to
71 // know about the content of a higher-level directory.
72 // The following scheme will grant the easiest access to lower-level
73 // global members without creating a cyclic dependency:
74 //
75 // Class Hierarchy (^ = inheritance):
76 //
77 // CCUtil (ccutil/ccutil.h)
78 // ^ Members include: UNICHARSET
79 // CUtil (cutil/cutil_class.h)
80 // ^ Members include: TBLOB*, TEXTBLOCK*
81 // CCStruct (ccstruct/ccstruct.h)
82 // ^ Members include: Image
83 // Classify (classify/classify.h)
84 // ^ Members include: Dict
85 // WordRec (wordrec/wordrec.h)
86 // ^ Members include: WERD*, DENORM*
87 // Tesseract (ccmain/tesseractclass.h)
88 // Members include: Pix*
89 //
90 // Other important classes:
91 //
92 // TessBaseAPI (api/baseapi.h)
93 // Members include: BLOCK_LIST*, PAGE_RES*,
94 // Tesseract*, ImageThresholder*
95 // Dict (dict/dict.h)
96 // Members include: Image* (private)
97 //
98 // NOTE: that each level contains members that correspond to global
99 // data that is defined (and used) at that level, not necessarily where
100 // the type is defined so for instance:
101 // BOOL_VAR_H(textord_show_blobs, false, "Display unsorted blobs");
102 // goes inside the Textord class, not the cc_util class.
103 
104 namespace tesseract {
105 
106 class ColumnFinder;
107 class DocumentData;
108 class EquationDetect;
109 class ImageData;
110 class LSTMRecognizer;
111 class Tesseract;
112 
113 // A collection of various variables for statistics and debugging.
117  doc_blob_quality(0),
118  doc_outline_errs(0),
119  doc_char_quality(0),
120  good_char_count(0),
122  word_count(0),
123  dict_words(0),
124  tilde_crunch_written(false),
125  last_char_was_newline(true),
126  last_char_was_tilde(false),
128 
135  int32_t word_count; // count of word in the document
136  int32_t dict_words; // number of dicitionary words in the document
137  STRING dump_words_str; // accumulator used by dump_words()
138  // Flags used by write_results()
143 };
144 
145 // Struct to hold all the pointers to relevant data for processing a word.
146 struct WordData {
148  : word(nullptr), row(nullptr), block(nullptr), prev_word(nullptr) {}
149  explicit WordData(const PAGE_RES_IT& page_res_it)
150  : word(page_res_it.word()),
151  row(page_res_it.row()->row),
152  block(page_res_it.block()->block),
153  prev_word(nullptr) {}
154  WordData(BLOCK* block_in, ROW* row_in, WERD_RES* word_res)
155  : word(word_res), row(row_in), block(block_in), prev_word(nullptr) {}
156 
162 };
163 
164 // Definition of a Tesseract WordRecognizer. The WordData provides the context
165 // of row/block, in_word holds an initialized, possibly pre-classified word,
166 // that the recognizer may or may not consume (but if so it sets
167 // *in_word=nullptr) and produces one or more output words in out_words, which
168 // may be the consumed in_word, or may be generated independently. This api
169 // allows both a conventional tesseract classifier to work, or a line-level
170 // classifier that generates multiple words from a merged input.
171 using WordRecognizer = void (Tesseract::*)(const WordData&, WERD_RES**,
173 
174 class Tesseract : public Wordrec {
175  public:
176  Tesseract();
177  ~Tesseract() override;
178 
179  // Return appropriate dictionary
180  Dict& getDict() override;
181 
182  // Clear as much used memory as possible without resetting the adaptive
183  // classifier or losing any other classifier data.
184  void Clear();
185  // Clear all memory of adaption for this and all subclassifiers.
187  // Clear the document dictionary for this and all subclassifiers.
189 
190  // Set the equation detector.
191  void SetEquationDetect(EquationDetect* detector);
192 
193  // Simple accessors.
194  const FCOORD& reskew() const {
195  return reskew_;
196  }
197  // Destroy any existing pix and return a pointer to the pointer.
199  pixDestroy(&pix_binary_);
200  return &pix_binary_;
201  }
202  Pix* pix_binary() const {
203  return pix_binary_;
204  }
205  Pix* pix_grey() const {
206  return pix_grey_;
207  }
208  void set_pix_grey(Pix* grey_pix) {
209  pixDestroy(&pix_grey_);
210  pix_grey_ = grey_pix;
211  }
212  Pix* pix_original() const {
213  return pix_original_;
214  }
215  // Takes ownership of the given original_pix.
216  void set_pix_original(Pix* original_pix) {
217  pixDestroy(&pix_original_);
218  pix_original_ = original_pix;
219  // Clone to sublangs as well.
220  for (int i = 0; i < sub_langs_.size(); ++i) {
221  sub_langs_[i]->set_pix_original(original_pix ? pixClone(original_pix)
222  : nullptr);
223  }
224  }
225  // Returns a pointer to a Pix representing the best available resolution image
226  // of the page, with best available bit depth as second priority. Result can
227  // be of any bit depth, but never color-mapped, as that has always been
228  // removed. Note that in grey and color, 0 is black and 255 is
229  // white. If the input was binary, then black is 1 and white is 0.
230  // To tell the difference pixGetDepth() will return 32, 8 or 1.
231  // In any case, the return value is a borrowed Pix, and should not be
232  // deleted or pixDestroyed.
233  Pix* BestPix() const {
234  if (pixGetWidth(pix_original_) == ImageWidth()) {
235  return pix_original_;
236  } else if (pix_grey_ != nullptr) {
237  return pix_grey_;
238  } else {
239  return pix_binary_;
240  }
241  }
242  void set_pix_thresholds(Pix* thresholds) {
243  pixDestroy(&pix_thresholds_);
244  pix_thresholds_ = thresholds;
245  }
246  int source_resolution() const {
247  return source_resolution_;
248  }
249  void set_source_resolution(int ppi) {
250  source_resolution_ = ppi;
251  }
252  int ImageWidth() const {
253  return pixGetWidth(pix_binary_);
254  }
255  int ImageHeight() const {
256  return pixGetHeight(pix_binary_);
257  }
258  Pix* scaled_color() const {
259  return scaled_color_;
260  }
261  int scaled_factor() const {
262  return scaled_factor_;
263  }
264  void SetScaledColor(int factor, Pix* color) {
265  scaled_factor_ = factor;
266  scaled_color_ = color;
267  }
268  const Textord& textord() const {
269  return textord_;
270  }
272  return &textord_;
273  }
274 
275  bool right_to_left() const {
276  return right_to_left_;
277  }
278  int num_sub_langs() const {
279  return sub_langs_.size();
280  }
281  Tesseract* get_sub_lang(int index) const {
282  return sub_langs_[index];
283  }
284  // Returns true if any language uses Tesseract (as opposed to LSTM).
285  bool AnyTessLang() const {
287  return true;
288  for (int i = 0; i < sub_langs_.size(); ++i) {
289  if (sub_langs_[i]->tessedit_ocr_engine_mode != OEM_LSTM_ONLY)
290  return true;
291  }
292  return false;
293  }
294  // Returns true if any language uses the LSTM.
295  bool AnyLSTMLang() const {
297  return true;
298  for (int i = 0; i < sub_langs_.size(); ++i) {
299  if (sub_langs_[i]->tessedit_ocr_engine_mode != OEM_TESSERACT_ONLY) {
300  return true;
301  }
302  }
303  return false;
304  }
305 
306  void SetBlackAndWhitelist();
307 
308  // Perform steps to prepare underlying binary image/other data structures for
309  // page segmentation. Uses the strategy specified in the global variable
310  // pageseg_devanagari_split_strategy for perform splitting while preparing for
311  // page segmentation.
312  void PrepareForPageseg();
313 
314  // Perform steps to prepare underlying binary image/other data structures for
315  // Tesseract OCR. The current segmentation is required by this method.
316  // Uses the strategy specified in the global variable
317  // ocr_devanagari_split_strategy for performing splitting while preparing for
318  // Tesseract ocr.
319  void PrepareForTessOCR(BLOCK_LIST* block_list, Tesseract* osd_tess,
320  OSResults* osr);
321 
322  int SegmentPage(const STRING* input_file, BLOCK_LIST* blocks,
323  Tesseract* osd_tess, OSResults* osr);
324  void SetupWordScripts(BLOCK_LIST* blocks);
325  int AutoPageSeg(PageSegMode pageseg_mode, BLOCK_LIST* blocks,
326  TO_BLOCK_LIST* to_blocks, BLOBNBOX_LIST* diacritic_blobs,
327  Tesseract* osd_tess, OSResults* osr);
329  PageSegMode pageseg_mode, BLOCK_LIST* blocks, Tesseract* osd_tess,
330  OSResults* osr, TO_BLOCK_LIST* to_blocks, Pix** photo_mask_pix,
331  Pix** music_mask_pix);
332  // par_control.cpp
333  void PrerecAllWordsPar(const GenericVector<WordData>& words);
334 
336  // Generates training data for training a line recognizer, eg LSTM.
337  // Breaks the page into lines, according to the boxes, and writes them to a
338  // serialized DocumentData based on output_basename.
339  // Return true if successful, false if an error occurred.
340  bool TrainLineRecognizer(const STRING& input_imagename,
341  const STRING& output_basename,
342  BLOCK_LIST* block_list);
343  // Generates training data for training a line recognizer, eg LSTM.
344  // Breaks the boxes into lines, normalizes them, converts to ImageData and
345  // appends them to the given training_data.
346  void TrainFromBoxes(const GenericVector<TBOX>& boxes,
347  const GenericVector<STRING>& texts,
348  BLOCK_LIST* block_list, DocumentData* training_data);
349 
350  // Returns an Imagedata containing the image of the given textline,
351  // and ground truth boxes/truth text if available in the input.
352  // The image is not normalized in any way.
353  ImageData* GetLineData(const TBOX& line_box, const GenericVector<TBOX>& boxes,
354  const GenericVector<STRING>& texts, int start_box,
355  int end_box, const BLOCK& block);
356  // Helper gets the image of a rectangle, using the block.re_rotation() if
357  // needed to get to the image, and rotating the result back to horizontal
358  // layout. (CJK characters will be on their left sides) The vertical text flag
359  // is set in the returned ImageData if the text was originally vertical, which
360  // can be used to invoke a different CJK recognition engine. The revised_box
361  // is also returned to enable calculation of output bounding boxes.
362  ImageData* GetRectImage(const TBOX& box, const BLOCK& block, int padding,
363  TBOX* revised_box) const;
364  // Recognizes a word or group of words, converting to WERD_RES in *words.
365  // Analogous to classify_word_pass1, but can handle a group of words as well.
366  void LSTMRecognizeWord(const BLOCK& block, ROW* row, WERD_RES* word,
367  PointerVector<WERD_RES>* words);
368  // Apply segmentation search to the given set of words, within the constraints
369  // of the existing ratings matrix. If there is already a best_choice on a word
370  // leaves it untouched and just sets the done/accepted etc flags.
372 
374  bool ProcessTargetWord(const TBOX& word_box, const TBOX& target_word_box,
375  const char* word_config, int pass);
376  // Sets up the words ready for whichever engine is to be run
377  void SetupAllWordsPassN(int pass_n, const TBOX* target_word_box,
378  const char* word_config, PAGE_RES* page_res,
379  GenericVector<WordData>* words);
380  // Sets up the single word ready for whichever engine is to be run.
381  void SetupWordPassN(int pass_n, WordData* word);
382  // Runs word recognition on all the words.
383  bool RecogAllWordsPassN(int pass_n, ETEXT_DESC* monitor, PAGE_RES_IT* pr_it,
384  GenericVector<WordData>* words);
385  bool recog_all_words(PAGE_RES* page_res, ETEXT_DESC* monitor,
386  const TBOX* target_word_box, const char* word_config,
387  int dopasses);
388  void rejection_passes(PAGE_RES* page_res, ETEXT_DESC* monitor,
389  const TBOX* target_word_box, const char* word_config);
390  void bigram_correction_pass(PAGE_RES* page_res);
391  void blamer_pass(PAGE_RES* page_res);
392  // Sets script positions and detects smallcaps on all output words.
393  void script_pos_pass(PAGE_RES* page_res);
394  // Helper to recognize the word using the given (language-specific) tesseract.
395  // Returns positive if this recognizer found more new best words than the
396  // number kept from best_words.
397  int RetryWithLanguage(const WordData& word_data, WordRecognizer recognizer,
398  bool debug, WERD_RES** in_word,
399  PointerVector<WERD_RES>* best_words);
400  // Moves good-looking "noise"/diacritics from the reject list to the main
401  // blob list on the current word. Returns true if anything was done, and
402  // sets make_next_word_fuzzy if blob(s) were added to the end of the word.
403  bool ReassignDiacritics(int pass, PAGE_RES_IT* pr_it,
404  bool* make_next_word_fuzzy);
405  // Attempts to put noise/diacritic outlines into the blobs that they overlap.
406  // Input: a set of noisy outlines that probably belong to the real_word.
407  // Output: outlines that overlapped blobs are set to nullptr and put back into
408  // the word, either in the blobs or in the reject list.
410  const GenericVector<C_OUTLINE*>& outlines, int pass, WERD* real_word,
411  PAGE_RES_IT* pr_it, GenericVector<bool>* word_wanted,
412  GenericVector<bool>* overlapped_any_blob,
413  GenericVector<C_BLOB*>* target_blobs);
414  // Attempts to assign non-overlapping outlines to their nearest blobs or
415  // make new blobs out of them.
417  int pass, WERD* real_word, PAGE_RES_IT* pr_it,
418  GenericVector<bool>* word_wanted,
419  GenericVector<C_BLOB*>* target_blobs);
420  // Starting with ok_outlines set to indicate which outlines overlap the blob,
421  // chooses the optimal set (approximately) and returns true if any outlines
422  // are desired, in which case ok_outlines indicates which ones.
423  bool SelectGoodDiacriticOutlines(int pass, float certainty_threshold,
424  PAGE_RES_IT* pr_it, C_BLOB* blob,
425  const GenericVector<C_OUTLINE*>& outlines,
426  int num_outlines,
427  GenericVector<bool>* ok_outlines);
428  // Classifies the given blob plus the outlines flagged by ok_outlines, undoes
429  // the inclusion of the outlines, and returns the certainty of the raw choice.
430  float ClassifyBlobPlusOutlines(const GenericVector<bool>& ok_outlines,
431  const GenericVector<C_OUTLINE*>& outlines,
432  int pass_n, PAGE_RES_IT* pr_it, C_BLOB* blob,
433  STRING* best_str);
434  // Classifies the given blob (part of word_data->word->word) as an individual
435  // word, using languages, chopper etc, returning only the certainty of the
436  // best raw choice, and undoing all the work done to fake out the word.
437  float ClassifyBlobAsWord(int pass_n, PAGE_RES_IT* pr_it, C_BLOB* blob,
438  STRING* best_str, float* c2);
439  void classify_word_and_language(int pass_n, PAGE_RES_IT* pr_it,
440  WordData* word_data);
441  void classify_word_pass1(const WordData& word_data, WERD_RES** in_word,
442  PointerVector<WERD_RES>* out_words);
443  void recog_pseudo_word(PAGE_RES* page_res, // blocks to check
444  TBOX& selection_box);
445 
446  void fix_rep_char(PAGE_RES_IT* page_res_it);
447 
449  const char* s,
450  const char* lengths);
451  void match_word_pass_n(int pass_n, WERD_RES* word, ROW* row, BLOCK* block);
452  void classify_word_pass2(const WordData& word_data, WERD_RES** in_word,
453  PointerVector<WERD_RES>* out_words);
454  void ReportXhtFixResult(bool accept_new_word, float new_x_ht, WERD_RES* word,
455  WERD_RES* new_word);
456  bool RunOldFixXht(WERD_RES* word, BLOCK* block, ROW* row);
457  bool TrainedXheightFix(WERD_RES* word, BLOCK* block, ROW* row);
458  // Runs recognition with the test baseline shift and x-height and returns true
459  // if there was an improvement in recognition result.
460  bool TestNewNormalization(int original_misfits, float baseline_shift,
461  float new_x_ht, WERD_RES* word, BLOCK* block,
462  ROW* row);
463  bool recog_interactive(PAGE_RES_IT* pr_it);
464 
465  // Set fonts of this word.
466  void set_word_fonts(WERD_RES* word);
467  void font_recognition_pass(PAGE_RES* page_res);
468  void dictionary_correction_pass(PAGE_RES* page_res);
469  bool check_debug_pt(WERD_RES* word, int location);
470 
472  bool SubAndSuperscriptFix(WERD_RES* word_res);
474  const WERD_RES* word, int* num_rebuilt_leading, ScriptPos* leading_pos,
475  float* leading_certainty, int* num_rebuilt_trailing,
476  ScriptPos* trailing_pos, float* trailing_certainty, float* avg_certainty,
477  float* unlikely_threshold);
478  WERD_RES* TrySuperscriptSplits(int num_chopped_leading,
479  float leading_certainty, ScriptPos leading_pos,
480  int num_chopped_trailing,
481  float trailing_certainty,
482  ScriptPos trailing_pos, WERD_RES* word,
483  bool* is_good, int* retry_leading,
484  int* retry_trailing);
485  bool BelievableSuperscript(bool debug, const WERD_RES& word,
486  float certainty_threshold, int* left_ok,
487  int* right_ok) const;
488 
490 
491  void output_pass(PAGE_RES_IT& page_res_it, const TBOX* target_word_box);
492  void write_results(PAGE_RES_IT& page_res_it, // full info
493  char newline_type, // type of newline
494  bool force_eol // override tilde crunch?
495  );
496  void set_unlv_suspects(WERD_RES* word);
497  UNICHAR_ID get_rep_char(WERD_RES* word); // what char is repeated?
498  bool acceptable_number_string(const char* s, const char* lengths);
499  int16_t count_alphanums(const WERD_CHOICE& word);
500  int16_t count_alphas(const WERD_CHOICE& word);
501 
502  void read_config_file(const char* filename, SetParamConstraint constraint);
503  // Initialize for potentially a set of languages defined by the language
504  // string and recursively any additional languages required by any language
505  // traineddata file (via tessedit_load_sublangs in its config) that is loaded.
506  // See init_tesseract_internal for args.
507  int init_tesseract(const char* arg0, const char* textbase,
508  const char* language, OcrEngineMode oem, char** configs,
509  int configs_size, const GenericVector<STRING>* vars_vec,
510  const GenericVector<STRING>* vars_values,
511  bool set_only_init_params, TessdataManager* mgr);
512  int init_tesseract(const char* datapath, const char* language,
513  OcrEngineMode oem) {
514  TessdataManager mgr;
515  return init_tesseract(datapath, nullptr, language, oem, nullptr, 0, nullptr,
516  nullptr, false, &mgr);
517  }
518  // Common initialization for a single language.
519  // arg0 is the datapath for the tessdata directory, which could be the
520  // path of the tessdata directory with no trailing /, or (if tessdata
521  // lives in the same directory as the executable, the path of the executable,
522  // hence the name arg0.
523  // textbase is an optional output file basename (used only for training)
524  // language is the language code to load.
525  // oem controls which engine(s) will operate on the image
526  // configs (argv) is an array of config filenames to load variables from.
527  // May be nullptr.
528  // configs_size (argc) is the number of elements in configs.
529  // vars_vec is an optional vector of variables to set.
530  // vars_values is an optional corresponding vector of values for the variables
531  // in vars_vec.
532  // If set_only_init_params is true, then only the initialization variables
533  // will be set.
534  int init_tesseract_internal(const char* arg0, const char* textbase,
535  const char* language, OcrEngineMode oem,
536  char** configs, int configs_size,
537  const GenericVector<STRING>* vars_vec,
538  const GenericVector<STRING>* vars_values,
539  bool set_only_init_params, TessdataManager* mgr);
540 
541  // Set the universal_id member of each font to be unique among all
542  // instances of the same font loaded.
543  void SetupUniversalFontIds();
544 
545  int init_tesseract_lm(const char* arg0, const char* textbase,
546  const char* language, TessdataManager* mgr);
547 
548  void recognize_page(STRING& image_name);
549  void end_tesseract();
550 
551  bool init_tesseract_lang_data(const char* arg0, const char* textbase,
552  const char* language, OcrEngineMode oem,
553  char** configs, int configs_size,
554  const GenericVector<STRING>* vars_vec,
555  const GenericVector<STRING>* vars_values,
556  bool set_only_init_params,
557  TessdataManager* mgr);
558 
559  void ParseLanguageString(const char* lang_str, GenericVector<STRING>* to_load,
560  GenericVector<STRING>* not_to_load);
561 
564 #ifndef GRAPHICS_DISABLED
565  void pgeditor_main(int width, int height, PAGE_RES* page_res);
566 #endif // GRAPHICS_DISABLED
567  void process_image_event( // action in image win
568  const SVEvent& event);
569  bool process_cmd_win_event( // UI command semantics
570  int32_t cmd_event, // which menu item?
571  char* new_value // any prompt data
572  );
573  void debug_word(PAGE_RES* page_res, const TBOX& selection_box);
574  void do_re_display(
575  bool (tesseract::Tesseract::*word_painter)(PAGE_RES_IT* pr_it));
576  bool word_display(PAGE_RES_IT* pr_it);
577  bool word_bln_display(PAGE_RES_IT* pr_it);
579  bool word_set_display(PAGE_RES_IT* pr_it);
580  // #ifndef GRAPHICS_DISABLED
581  bool word_dumper(PAGE_RES_IT* pr_it);
582  // #endif // GRAPHICS_DISABLED
583  void blob_feature_display(PAGE_RES* page_res, const TBOX& selection_box);
585  // make rej map for word
586  void make_reject_map(WERD_RES* word, ROW* row, int16_t pass);
587  bool one_ell_conflict(WERD_RES* word_res, bool update_map);
588  int16_t first_alphanum_index(const char* word, const char* word_lengths);
589  int16_t first_alphanum_offset(const char* word, const char* word_lengths);
590  int16_t alpha_count(const char* word, const char* word_lengths);
591  bool word_contains_non_1_digit(const char* word, const char* word_lengths);
592  void dont_allow_1Il(WERD_RES* word);
593  int16_t count_alphanums( // how many alphanums
594  WERD_RES* word);
595  void flip_0O(WERD_RES* word);
596  bool non_0_digit(const UNICHARSET& ch_set, UNICHAR_ID unichar_id);
597  bool non_O_upper(const UNICHARSET& ch_set, UNICHAR_ID unichar_id);
598  bool repeated_nonalphanum_wd(WERD_RES* word, ROW* row);
599  void nn_match_word( // Match a word
600  WERD_RES* word, ROW* row);
601  void nn_recover_rejects(WERD_RES* word, ROW* row);
602  void set_done( // set done flag
603  WERD_RES* word, int16_t pass);
604  int16_t safe_dict_word(const WERD_RES* werd_res); // is best_choice in dict?
605  void flip_hyphens(WERD_RES* word);
606  void reject_I_1_L(WERD_RES* word);
607  void reject_edge_blobs(WERD_RES* word);
608  void reject_mostly_rejects(WERD_RES* word);
610  bool word_adaptable( // should we adapt?
611  WERD_RES* word, uint16_t mode);
612 
614  void recog_word_recursive(WERD_RES* word);
615  void recog_word(WERD_RES* word);
616  void split_and_recog_word(WERD_RES* word);
617  void split_word(WERD_RES* word, int split_pt, WERD_RES** right_piece,
618  BlamerBundle** orig_blamer_bundle) const;
619  void join_words(WERD_RES* word, WERD_RES* word2, BlamerBundle* orig_bb) const;
621  bool digit_or_numeric_punct(WERD_RES* word, int char_position);
622  int16_t eval_word_spacing(WERD_RES_LIST& word_res_list);
623  void match_current_words(WERD_RES_LIST& words, ROW* row, BLOCK* block);
624  int16_t fp_eval_word_spacing(WERD_RES_LIST& word_res_list);
625  void fix_noisy_space_list(WERD_RES_LIST& best_perm, ROW* row, BLOCK* block);
626  void fix_fuzzy_space_list(WERD_RES_LIST& best_perm, ROW* row, BLOCK* block);
627  void fix_sp_fp_word(WERD_RES_IT& word_res_it, ROW* row, BLOCK* block);
628  void fix_fuzzy_spaces( // find fuzzy words
629  ETEXT_DESC* monitor, // progress monitor
630  int32_t word_count, // count of words in doc
631  PAGE_RES* page_res);
632  void dump_words(WERD_RES_LIST& perm, int16_t score, int16_t mode,
633  bool improved);
635  int16_t worst_noise_blob(WERD_RES* word_res, float* worst_noise_score);
636  float blob_noise_score(TBLOB* blob);
637  void break_noisiest_blob_word(WERD_RES_LIST& words);
639 #ifndef DISABLED_LEGACY_ENGINE
640  GARBAGE_LEVEL garbage_word(WERD_RES* word, bool ok_dict_word);
641  bool potential_word_crunch(WERD_RES* word, GARBAGE_LEVEL garbage_level,
642  bool ok_dict_word);
643 #endif
644  void tilde_crunch(PAGE_RES_IT& page_res_it);
645  void unrej_good_quality_words( // unreject potential
646  PAGE_RES_IT& page_res_it);
647  void doc_and_block_rejection( // reject big chunks
648  PAGE_RES_IT& page_res_it, bool good_quality_doc);
649  void quality_based_rejection(PAGE_RES_IT& page_res_it, bool good_quality_doc);
650  void convert_bad_unlv_chs(WERD_RES* word_res);
651  void tilde_delete(PAGE_RES_IT& page_res_it);
652  int16_t word_blob_quality(WERD_RES* word, ROW* row);
653  void word_char_quality(WERD_RES* word, ROW* row, int16_t* match_count,
654  int16_t* accepted_match_count);
655  void unrej_good_chs(WERD_RES* word, ROW* row);
656  int16_t count_outline_errs(char c, int16_t outline_count);
657  int16_t word_outline_errs(WERD_RES* word);
658 #ifndef DISABLED_LEGACY_ENGINE
659  bool terrible_word_crunch(WERD_RES* word, GARBAGE_LEVEL garbage_level);
660 #endif
661  CRUNCH_MODE word_deletable(WERD_RES* word, int16_t& delete_mode);
662  int16_t failure_count(WERD_RES* word);
663  bool noise_outlines(TWERD* word);
666  PAGE_RES* page_res, // blocks to check
667  // function to call
668  TBOX& selection_box,
669  bool (tesseract::Tesseract::*word_processor)(PAGE_RES_IT* pr_it));
671  void tess_add_doc_word( // test acceptability
672  WERD_CHOICE* word_choice // after context
673  );
674  void tess_segment_pass_n(int pass_n, WERD_RES* word);
675  bool tess_acceptable_word(WERD_RES* word);
676 
678  // Applies the box file based on the image name fname, and resegments
679  // the words in the block_list (page), with:
680  // blob-mode: one blob per line in the box file, words as input.
681  // word/line-mode: one blob per space-delimited unit after the #, and one word
682  // per line in the box file. (See comment above for box file format.)
683  // If find_segmentation is true, (word/line mode) then the classifier is used
684  // to re-segment words/lines to match the space-delimited truth string for
685  // each box. In this case, the input box may be for a word or even a whole
686  // text line, and the output words will contain multiple blobs corresponding
687  // to the space-delimited input string.
688  // With find_segmentation false, no classifier is needed, but the chopper
689  // can still be used to correctly segment touching characters with the help
690  // of the input boxes.
691  // In the returned PAGE_RES, the WERD_RES are setup as they would be returned
692  // from normal classification, ie. with a word, chopped_word, rebuild_word,
693  // seam_array, denorm, box_word, and best_state, but NO best_choice or
694  // raw_choice, as they would require a UNICHARSET, which we aim to avoid.
695  // Instead, the correct_text member of WERD_RES is set, and this may be later
696  // converted to a best_choice using CorrectClassifyWords. CorrectClassifyWords
697  // is not required before calling ApplyBoxTraining.
698  PAGE_RES* ApplyBoxes(const STRING& fname, bool find_segmentation,
699  BLOCK_LIST* block_list);
700 
701  // Any row xheight that is significantly different from the median is set
702  // to the median.
703  void PreenXHeights(BLOCK_LIST* block_list);
704 
705  // Builds a PAGE_RES from the block_list in the way required for ApplyBoxes:
706  // All fuzzy spaces are removed, and all the words are maximally chopped.
708  BLOCK_LIST* block_list);
709  // Tests the chopper by exhaustively running chop_one_blob.
710  // The word_res will contain filled chopped_word, seam_array, denorm,
711  // box_word and best_state for the maximally chopped word.
712  void MaximallyChopWord(const GenericVector<TBOX>& boxes, BLOCK* block,
713  ROW* row, WERD_RES* word_res);
714  // Gather consecutive blobs that match the given box into the best_state
715  // and corresponding correct_text.
716  // Fights over which box owns which blobs are settled by pre-chopping and
717  // applying the blobs to box or next_box with the least non-overlap.
718  // Returns false if the box was in error, which can only be caused by
719  // failing to find an appropriate blob for a box.
720  // This means that occasionally, blobs may be incorrectly segmented if the
721  // chopper fails to find a suitable chop point.
722  bool ResegmentCharBox(PAGE_RES* page_res, const TBOX* prev_box,
723  const TBOX& box, const TBOX* next_box,
724  const char* correct_text);
725  // Consume all source blobs that strongly overlap the given box,
726  // putting them into a new word, with the correct_text label.
727  // Fights over which box owns which blobs are settled by
728  // applying the blobs to box or next_box with the least non-overlap.
729  // Returns false if the box was in error, which can only be caused by
730  // failing to find an overlapping blob for a box.
731  bool ResegmentWordBox(BLOCK_LIST* block_list, const TBOX& box,
732  const TBOX* next_box, const char* correct_text);
733  // Resegments the words by running the classifier in an attempt to find the
734  // correct segmentation that produces the required string.
736  // Converts the space-delimited string of utf8 text to a vector of UNICHAR_ID.
737  // Returns false if an invalid UNICHAR_ID is encountered.
738  bool ConvertStringToUnichars(const char* utf8,
739  GenericVector<UNICHAR_ID>* class_ids);
740  // Resegments the word to achieve the target_text from the classifier.
741  // Returns false if the re-segmentation fails.
742  // Uses brute-force combination of up to kMaxGroupSize adjacent blobs, and
743  // applies a full search on the classifier results to find the best classified
744  // segmentation. As a compromise to obtain better recall, 1-1 ambigiguity
745  // substitutions ARE used.
747  WERD_RES* word_res);
748  // Recursive helper to find a match to the target_text (from text_index
749  // position) in the choices (from choices_pos position).
750  // Choices is an array of GenericVectors, of length choices_length, with each
751  // element representing a starting position in the word, and the
752  // GenericVector holding classification results for a sequence of consecutive
753  // blobs, with index 0 being a single blob, index 1 being 2 blobs etc.
755  int choices_pos, int choices_length,
756  const GenericVector<UNICHAR_ID>& target_text,
757  int text_index, float rating,
758  GenericVector<int>* segmentation, float* best_rating,
759  GenericVector<int>* best_segmentation);
760  // Counts up the labelled words and the blobs within.
761  // Deletes all unused or emptied words, counting the unused ones.
762  // Resets W_BOL and W_EOL flags correctly.
763  // Builds the rebuild_word and rebuilds the box_word.
764  void TidyUp(PAGE_RES* page_res);
765  // Logs a bad box by line in the box file and box coords.
766  void ReportFailedBox(int boxfile_lineno, TBOX box, const char* box_ch,
767  const char* err_msg);
768  // Creates a fake best_choice entry in each WERD_RES with the correct text.
770  // Call LearnWord to extract features for labelled blobs within each word.
771  // Features are stored in an internal buffer.
772  void ApplyBoxTraining(const STRING& fontname, PAGE_RES* page_res);
773 
775  // Returns the number of misfit blob tops in this word.
776  int CountMisfitTops(WERD_RES* word_res);
777  // Returns a new x-height in pixels (original image coords) that is
778  // maximally compatible with the result in word_res.
779  // Returns 0.0f if no x-height is found that is better than the current
780  // estimate.
781  float ComputeCompatibleXheight(WERD_RES* word_res, float* baseline_shift);
783  // TODO(ocr-team): Find and remove obsolete parameters.
785  "Take segmentation and labeling from box file");
787  "Conversion of word/line box file to char box file");
789  "Generate training data from boxed chars");
791  "Generate more boxes from boxed chars");
793  "Break input into lines and remap boxes if present");
795  "Dump intermediate images made during page segmentation");
797  "Try inverting the image in `LSTMRecognizeWord`");
799  "Page seg mode: 0=osd only, 1=auto+osd, 2=auto, 3=col, 4=block,"
800  " 5=line, 6=word, 7=char"
801  " (Values from PageSegMode enum in publictypes.h)");
803  "Which OCR engine(s) to run (Tesseract, LSTM, both). Defaults"
804  " to loading and running the most accurate available.");
806  "Blacklist of chars not to recognize");
807  STRING_VAR_H(tessedit_char_whitelist, "", "Whitelist of chars to recognize");
809  "List of chars to override tessedit_char_blacklist");
811  "Perform training for ambiguities");
814  "Whether to use the top-line splitting process for Devanagari "
815  "documents while performing page-segmentation.");
818  "Whether to use the top-line splitting process for Devanagari "
819  "documents while performing ocr.");
821  "Write all parameters to the given file.");
823  "Generate and print debug information for adaption");
824  INT_VAR_H(bidi_debug, 0, "Debug level for BiDi");
825  INT_VAR_H(applybox_debug, 1, "Debug level");
826  INT_VAR_H(applybox_page, 0, "Page number to apply boxes from");
828  "Exposure value follows this pattern in the image"
829  " filename. The name of the image files are expected"
830  " to be in the form [lang].[fontname].exp[num].tif");
832  "Learn both character fragments (as is done in the"
833  " special low exposure mode) as well as unfragmented"
834  " characters.");
836  "Each bounding box is assumed to contain ngrams. Only"
837  " learn the ngrams whose outlines overlap horizontally.");
838  BOOL_VAR_H(tessedit_display_outwords, false, "Draw output words");
839  BOOL_VAR_H(tessedit_dump_choices, false, "Dump char choices");
840  BOOL_VAR_H(tessedit_timing_debug, false, "Print timing stats");
841  BOOL_VAR_H(tessedit_fix_fuzzy_spaces, true, "Try to improve fuzzy spaces");
843  "Don't bother with word plausibility");
844  BOOL_VAR_H(tessedit_fix_hyphens, true, "Crunch double hyphens?");
846  "Add words to the document dictionary");
847  BOOL_VAR_H(tessedit_debug_fonts, false, "Output font info per char");
848  BOOL_VAR_H(tessedit_debug_block_rejection, false, "Block and Row stats");
850  "Enable correction based on the word bigram dictionary.");
852  "Enable single word correction based on the dictionary.");
854  "Amount of debug output for bigram "
855  "correction.");
857  "Remove and conditionally reassign small outlines when they"
858  " confuse layout analysis, determining diacritics vs noise");
859  INT_VAR_H(debug_noise_removal, 0, "Debug reassignment of small outlines");
860  // Worst (min) certainty, for which a diacritic is allowed to make the base
861  // character worse and still be included.
862  double_VAR_H(noise_cert_basechar, -8.0, "Hingepoint for base char certainty");
863  // Worst (min) certainty, for which a non-overlapping diacritic is allowed to
864  // make the base character worse and still be included.
865  double_VAR_H(noise_cert_disjoint, -2.5, "Hingepoint for disjoint certainty");
866  // Worst (min) certainty, for which a diacritic is allowed to make a new
867  // stand-alone blob.
868  double_VAR_H(noise_cert_punc, -2.5, "Threshold for new punc char certainty");
869  // Factor of certainty margin for adding diacritics to not count as worse.
871  "Scaling on certainty diff from Hingepoint");
872  INT_VAR_H(noise_maxperblob, 8, "Max diacritics to apply to a blob");
873  INT_VAR_H(noise_maxperword, 16, "Max diacritics to apply to a word");
874  INT_VAR_H(debug_x_ht_level, 0, "Reestimate debug");
875  STRING_VAR_H(chs_leading_punct, "('`\"", "Leading punctuation");
876  STRING_VAR_H(chs_trailing_punct1, ").,;:?!", "1st Trailing punctuation");
877  STRING_VAR_H(chs_trailing_punct2, ")'`\"", "2nd Trailing punctuation");
878  double_VAR_H(quality_rej_pc, 0.08, "good_quality_doc lte rejection limit");
879  double_VAR_H(quality_blob_pc, 0.0, "good_quality_doc gte good blobs limit");
881  "good_quality_doc lte outline error limit");
882  double_VAR_H(quality_char_pc, 0.95, "good_quality_doc gte good char limit");
883  INT_VAR_H(quality_min_initial_alphas_reqd, 2, "alphas in a good word");
885  "Adaptation decision algorithm for tess");
887  "Do minimal rejection on pass 1 output");
888  BOOL_VAR_H(tessedit_test_adaption, false, "Test adaption criteria");
889  BOOL_VAR_H(test_pt, false, "Test for point");
890  double_VAR_H(test_pt_x, 99999.99, "xcoord");
891  double_VAR_H(test_pt_y, 99999.99, "ycoord");
892  INT_VAR_H(multilang_debug_level, 0, "Print multilang debug info.");
893  INT_VAR_H(paragraph_debug_level, 0, "Print paragraph debug info.");
895  "Run paragraph detection on the post-text-recognition "
896  "(more accurate)");
897  BOOL_VAR_H(lstm_use_matrix, 1, "Use ratings matrix/beam searct with lstm");
898  STRING_VAR_H(outlines_odd, "%| ", "Non standard number of outlines");
899  STRING_VAR_H(outlines_2, "ij!?%\":;", "Non standard number of outlines");
901  "Reduce rejection on good docs");
902  BOOL_VAR_H(tessedit_use_reject_spaces, true, "Reject spaces?");
904  "%rej allowed before rej whole doc");
906  "%rej allowed before rej whole block");
908  "%rej allowed before rej whole row");
910  "Number of row rejects in whole word rejects"
911  "which prevents whole row rejection");
913  "Only rej partially rejected words in block rejection");
915  "Only rej partially rejected words in row rejection");
917  "Use word segmentation quality metric");
919  "Use word segmentation quality metric");
921  "Only preserve wds longer than this");
923  "Apply row rejection to good docs");
925  "rej good doc wd if more than this fraction rejected");
926  BOOL_VAR_H(tessedit_reject_bad_qual_wds, true, "Reject all bad quality wds");
929  "Output data to debug file");
930  BOOL_VAR_H(bland_unrej, false, "unrej potential with no checks");
931  double_VAR_H(quality_rowrej_pc, 1.1, "good_quality_doc gte good char limit");
932  BOOL_VAR_H(unlv_tilde_crunching, false, "Mark v.bad words for tilde crunch");
933  BOOL_VAR_H(hocr_font_info, false, "Add font info to hocr output");
935  "Add coordinates for each character to hocr output");
936  BOOL_VAR_H(crunch_early_merge_tess_fails, true, "Before word crunch?");
937  BOOL_VAR_H(crunch_early_convert_bad_unlv_chs, false, "Take out ~^ early?");
938  double_VAR_H(crunch_terrible_rating, 80.0, "crunch rating lt this");
939  BOOL_VAR_H(crunch_terrible_garbage, true, "As it says");
940  double_VAR_H(crunch_poor_garbage_cert, -9.0, "crunch garbage cert lt this");
941  double_VAR_H(crunch_poor_garbage_rate, 60, "crunch garbage rating lt this");
942  double_VAR_H(crunch_pot_poor_rate, 40, "POTENTIAL crunch rating lt this");
943  double_VAR_H(crunch_pot_poor_cert, -8.0, "POTENTIAL crunch cert lt this");
944  double_VAR_H(crunch_del_rating, 60, "POTENTIAL crunch rating lt this");
945  double_VAR_H(crunch_del_cert, -10.0, "POTENTIAL crunch cert lt this");
946  double_VAR_H(crunch_del_min_ht, 0.7, "Del if word ht lt xht x this");
947  double_VAR_H(crunch_del_max_ht, 3.0, "Del if word ht gt xht x this");
948  double_VAR_H(crunch_del_min_width, 3.0, "Del if word width lt xht x this");
949  double_VAR_H(crunch_del_high_word, 1.5, "Del if word gt xht x this above bl");
950  double_VAR_H(crunch_del_low_word, 0.5, "Del if word gt xht x this below bl");
951  double_VAR_H(crunch_small_outlines_size, 0.6, "Small if lt xht x this");
952  INT_VAR_H(crunch_rating_max, 10, "For adj length in rating per ch");
953  INT_VAR_H(crunch_pot_indicators, 1, "How many potential indicators needed");
954  BOOL_VAR_H(crunch_leave_ok_strings, true, "Don't touch sensible strings");
955  BOOL_VAR_H(crunch_accept_ok, true, "Use acceptability in okstring");
957  "Don't pot crunch sensible strings");
958  BOOL_VAR_H(crunch_include_numerals, false, "Fiddle alpha figures");
960  "Don't crunch words with long lower case strings");
962  "Don't crunch words with long lower case strings");
963  INT_VAR_H(crunch_long_repetitions, 3, "Crunch words with long repetitions");
964  INT_VAR_H(crunch_debug, 0, "As it says");
965  INT_VAR_H(fixsp_non_noise_limit, 1, "How many non-noise blbs either side?");
966  double_VAR_H(fixsp_small_outlines_size, 0.28, "Small if lt xht x this");
967  BOOL_VAR_H(tessedit_prefer_joined_punct, false, "Reward punctuation joins");
968  INT_VAR_H(fixsp_done_mode, 1, "What constitues done for spacing");
969  INT_VAR_H(debug_fix_space_level, 0, "Contextual fixspace debug");
970  STRING_VAR_H(numeric_punctuation, ".,", "Punct. chs expected WITHIN numbers");
972  "Max allowed deviation of blob top outside of font data");
973  INT_VAR_H(x_ht_min_change, 8, "Min change in xht before actually trying it");
974  INT_VAR_H(superscript_debug, 0, "Debug level for sub & superscript fixer");
976  "How many times worse "
977  "certainty does a superscript position glyph need to be for us "
978  "to try classifying it as a char with a different baseline?");
980  "What reduction in "
981  "badness do we think sufficient to choose a superscript over "
982  "what we'd thought. For example, a value of 0.6 means we want "
983  "to reduce badness of certainty by 40%");
985  "A superscript scaled down more than this is unbelievably "
986  "small. For example, 0.3 means we expect the font size to "
987  "be no smaller than 30% of the text line font size.");
989  "Maximum top of a character measured as a multiple of x-height "
990  "above the baseline for us to reconsider whether it's a "
991  "subscript.");
993  "Minimum bottom of a character measured as a multiple of "
994  "x-height above the baseline for us to reconsider whether it's "
995  "a superscript.");
997  "Write block separators in output");
998  BOOL_VAR_H(tessedit_write_rep_codes, false, "Write repetition char code");
999  BOOL_VAR_H(tessedit_write_unlv, false, "Write .unlv output file");
1000  BOOL_VAR_H(tessedit_create_txt, false, "Write .txt output file");
1001  BOOL_VAR_H(tessedit_create_hocr, false, "Write .html hOCR output file");
1002  BOOL_VAR_H(tessedit_create_alto, false, "Write .xml ALTO output file");
1004  "Write .box file for LSTM training");
1005  BOOL_VAR_H(tessedit_create_tsv, false, "Write .tsv output file");
1007  "Write WordStr format .box output file");
1008  BOOL_VAR_H(tessedit_create_pdf, false, "Write .pdf output file");
1009  BOOL_VAR_H(textonly_pdf, false,
1010  "Create PDF with only one invisible text layer");
1011  INT_VAR_H(jpg_quality, 85, "Set JPEG quality level");
1012  INT_VAR_H(user_defined_dpi, 0, "Specify DPI for input image");
1014  "Specify minimum characters to try during OSD");
1015  STRING_VAR_H(unrecognised_char, "|", "Output char for unidentified blobs");
1016  INT_VAR_H(suspect_level, 99, "Suspect marker level");
1017  INT_VAR_H(suspect_short_words, 2, "Don't Suspect dict wds longer than this");
1018  BOOL_VAR_H(suspect_constrain_1Il, false, "UNLV keep 1Il chars rejected");
1019  double_VAR_H(suspect_rating_per_ch, 999.9, "Don't touch bad rating limit");
1020  double_VAR_H(suspect_accept_rating, -999.9, "Accept good rating limit");
1021  BOOL_VAR_H(tessedit_minimal_rejection, false, "Only reject tess failures");
1022  BOOL_VAR_H(tessedit_zero_rejection, false, "Don't reject ANYTHING");
1024  "Make output have exactly one word per WERD");
1026  "Don't reject ANYTHING AT ALL");
1027  INT_VAR_H(tessedit_reject_mode, 0, "Rejection algorithm");
1028  BOOL_VAR_H(tessedit_rejection_debug, false, "Adaption debug");
1029  BOOL_VAR_H(tessedit_flip_0O, true, "Contextual 0O O0 flips");
1030  double_VAR_H(tessedit_lower_flip_hyphen, 1.5, "Aspect ratio dot/hyphen test");
1031  double_VAR_H(tessedit_upper_flip_hyphen, 1.8, "Aspect ratio dot/hyphen test");
1032  BOOL_VAR_H(rej_trust_doc_dawg, false, "Use DOC dawg in 11l conf. detector");
1033  BOOL_VAR_H(rej_1Il_use_dict_word, false, "Use dictword test");
1034  BOOL_VAR_H(rej_1Il_trust_permuter_type, true, "Don't double check");
1035  BOOL_VAR_H(rej_use_tess_accepted, true, "Individual rejection control");
1036  BOOL_VAR_H(rej_use_tess_blanks, true, "Individual rejection control");
1037  BOOL_VAR_H(rej_use_good_perm, true, "Individual rejection control");
1038  BOOL_VAR_H(rej_use_sensible_wd, false, "Extend permuter check");
1039  BOOL_VAR_H(rej_alphas_in_number_perm, false, "Extend permuter check");
1041  INT_VAR_H(tessedit_image_border, 2, "Rej blbs near image edge limit");
1042  STRING_VAR_H(ok_repeated_ch_non_alphanum_wds, "-?*\075", "Allow NN to unrej");
1043  STRING_VAR_H(conflict_set_I_l_1, "Il1[]", "Il1 conflict set");
1044  INT_VAR_H(min_sane_x_ht_pixels, 8, "Reject any x-ht lt or eq than this");
1045  BOOL_VAR_H(tessedit_create_boxfile, false, "Output text with boxes");
1047  "-1 -> All pages, else specific page to process");
1048  BOOL_VAR_H(tessedit_write_images, false, "Capture the image from the IPE");
1049  BOOL_VAR_H(interactive_display_mode, false, "Run interactively?");
1050  STRING_VAR_H(file_type, ".tif", "Filename extension");
1051  BOOL_VAR_H(tessedit_override_permuter, true, "According to dict_word");
1053  "List of languages to load with this one");
1055  "In multilingual mode use params model of the primary language");
1056  // Min acceptable orientation margin (difference in scores between top and 2nd
1057  // choice in OSResults::orientations) to believe the page orientation.
1059  "Min acceptable orientation margin");
1060  BOOL_VAR_H(textord_tabfind_show_vlines, false, "Debug line finding");
1061  BOOL_VAR_H(textord_use_cjk_fp_model, false, "Use CJK fixed pitch model");
1063  "Allow feature extractors to see the original outline");
1065  "Only initialize with the config file. Useful if the instance is "
1066  "not going to be used for OCR but say only for layout analysis.");
1067  BOOL_VAR_H(textord_equation_detect, false, "Turn on equation detector");
1068  BOOL_VAR_H(textord_tabfind_vertical_text, true, "Enable vertical detection");
1070  "Force using vertical text page mode");
1072  "Fraction of textlines deemed vertical to use vertical page "
1073  "mode");
1075  "Fraction of height used as a minimum gap for aligned blobs.");
1076  INT_VAR_H(tessedit_parallelize, 0, "Run in parallel where possible");
1078  "Preserve multiple interword spaces");
1080  "Page separator (default is form feed control character)");
1082  "Allows to include alternative symbols choices in the hOCR "
1083  "output. "
1084  "Valid input values are 0, 1, 2 and 3. 0 is the default value. "
1085  "With 1 the alternative symbol choices per timestep are included. "
1086  "With 2 the alternative symbol choices are accumulated per "
1087  "character. ");
1089  "Detect music staff and remove intersecting components");
1090 
1092  FILE* init_recog_training(const STRING& fname);
1093  void recog_training_segmented(const STRING& fname, PAGE_RES* page_res,
1094  volatile ETEXT_DESC* monitor,
1095  FILE* output_file);
1096  void ambigs_classify_and_output(const char* label, PAGE_RES_IT* pr_it,
1097  FILE* output_file);
1098 
1099  private:
1100  // The filename of a backup config file. If not null, then we currently
1101  // have a temporary debug config file loaded, and backup_config_file_
1102  // will be loaded, and set to null when debug is complete.
1103  const char* backup_config_file_;
1104  // The filename of a config file to read when processing a debug word.
1105  STRING word_config_;
1106  // Image used for input to layout analysis and tesseract recognition.
1107  // May be modified by the ShiroRekhaSplitter to eliminate the top-line.
1108  Pix* pix_binary_;
1109  // Grey-level input image if the input was not binary, otherwise nullptr.
1110  Pix* pix_grey_;
1111  // Original input image. Color if the input was color.
1112  Pix* pix_original_;
1113  // Thresholds that were used to generate the thresholded image from grey.
1114  Pix* pix_thresholds_;
1115  // Debug images. If non-empty, will be written on destruction.
1116  DebugPixa pixa_debug_;
1117  // Input image resolution after any scaling. The resolution is not well
1118  // transmitted by operations on Pix, so we keep an independent record here.
1119  int source_resolution_;
1120  // The shiro-rekha splitter object which is used to split top-lines in
1121  // Devanagari words to provide a better word and grapheme segmentation.
1122  ShiroRekhaSplitter splitter_;
1123  // Page segmentation/layout
1124  Textord textord_;
1125  // True if the primary language uses right_to_left reading order.
1126  bool right_to_left_;
1127  Pix* scaled_color_;
1128  int scaled_factor_;
1129  FCOORD deskew_;
1130  FCOORD reskew_;
1131  TesseractStats stats_;
1132  // Sub-languages to be tried in addition to this.
1133  GenericVector<Tesseract*> sub_langs_;
1134  // Most recently used Tesseract out of this and sub_langs_. The default
1135  // language for the next word.
1136  Tesseract* most_recently_used_;
1137  // The size of the font table, ie max possible font id + 1.
1138  int font_table_size_;
1139  // Equation detector. Note: this pointer is NOT owned by the class.
1140  EquationDetect* equ_detect_;
1141  // LSTM recognizer, if available.
1142  LSTMRecognizer* lstm_recognizer_;
1143  // Output "page" number (actually line number) using TrainLineRecognizer.
1144  int train_line_page_num_;
1145 };
1146 
1147 } // namespace tesseract
1148 
1149 #endif // TESSERACT_CCMAIN_TESSERACTCLASS_H_
FCOORD
Definition: points.h:189
tesseract::ImageData
Definition: imagedata.h:105
tesseract::Tesseract::one_ell_conflict
bool one_ell_conflict(WERD_RES *word_res, bool update_map)
Definition: reject.cpp:298
tesseract::ShiroRekhaSplitter::NO_SPLIT
@ NO_SPLIT
Definition: devanagari_processing.h:74
TBOX
Definition: rect.h:34
tesseract::Tesseract::page_separator
char * page_separator
Definition: tesseractclass.h:1080
tesseract::TesseractStats::tilde_crunch_written
bool tilde_crunch_written
Definition: tesseractclass.h:139
tesseract::Tesseract::tessedit_enable_doc_dict
bool tessedit_enable_doc_dict
Definition: tesseractclass.h:846
tesseract::TesseractStats::last_char_was_newline
bool last_char_was_newline
Definition: tesseractclass.h:140
tesseract::Tesseract::crunch_pot_poor_cert
double crunch_pot_poor_cert
Definition: tesseractclass.h:943
tesseract::Tesseract::~Tesseract
~Tesseract() override
Definition: tesseractclass.cpp:540
tesseract::Tesseract::tessedit_preserve_min_wd_len
int tessedit_preserve_min_wd_len
Definition: tesseractclass.h:921
tesseract::Tesseract::crunch_leave_lc_strings
int crunch_leave_lc_strings
Definition: tesseractclass.h:960
tesseract::Tesseract::script_pos_pass
void script_pos_pass(PAGE_RES *page_res)
Definition: control.cpp:734
tesseract::Tesseract::chs_trailing_punct1
char * chs_trailing_punct1
Definition: tesseractclass.h:876
tesseract::Tesseract::tessedit_create_txt
bool tessedit_create_txt
Definition: tesseractclass.h:1000
tesseract::Tesseract::garbage_word
GARBAGE_LEVEL garbage_word(WERD_RES *word, bool ok_dict_word)
Definition: docqual.cpp:679
tesseract::Tesseract::tessedit_create_tsv
bool tessedit_create_tsv
Definition: tesseractclass.h:1005
tesseract::TesseractStats::good_char_count
int16_t good_char_count
Definition: tesseractclass.h:133
control.h
tesseract::Tesseract::tessedit_debug_doc_rejection
bool tessedit_debug_doc_rejection
Definition: tesseractclass.h:927
tesseract::Tesseract::rej_whole_of_mostly_reject_word_fract
double rej_whole_of_mostly_reject_word_fract
Definition: tesseractclass.h:1040
tesseract::Wordrec
Definition: wordrec.h:192
tesseract::Tesseract::doc_and_block_rejection
void doc_and_block_rejection(PAGE_RES_IT &page_res_it, bool good_quality_doc)
Definition: docqual.cpp:249
tesseract::WordData::row
ROW * row
Definition: tesseractclass.h:158
tesseract::Tesseract::write_results
void write_results(PAGE_RES_IT &page_res_it, char newline_type, bool force_eol)
Definition: output.cpp:98
tesseract::Tesseract::crunch_leave_uc_strings
int crunch_leave_uc_strings
Definition: tesseractclass.h:962
tesseract::Tesseract::ResetAdaptiveClassifier
void ResetAdaptiveClassifier()
Definition: tesseractclass.cpp:587
tesseract::Tesseract::superscript_min_y_bottom
double superscript_min_y_bottom
Definition: tesseractclass.h:995
tesseract::Tesseract::pix_binary
Pix * pix_binary() const
Definition: tesseractclass.h:202
tesseract::Tesseract::set_done
void set_done(WERD_RES *word, int16_t pass)
tesseract::Tesseract::TestNewNormalization
bool TestNewNormalization(int original_misfits, float baseline_shift, float new_x_ht, WERD_RES *word, BLOCK *block, ROW *row)
Definition: control.cpp:1519
tesseract::WordData::lang_words
PointerVector< WERD_RES > lang_words
Definition: tesseractclass.h:161
tesseract::WordRecognizer
void(Tesseract::*)(const WordData &, WERD_RES **, PointerVector< WERD_RES > *) WordRecognizer
Definition: tesseractclass.h:172
tesseract::Tesseract::tessedit_ambigs_training
bool tessedit_ambigs_training
Definition: tesseractclass.h:811
tesseract::Tesseract::TidyUp
void TidyUp(PAGE_RES *page_res)
tesseract::Tesseract::eval_word_spacing
int16_t eval_word_spacing(WERD_RES_LIST &word_res_list)
Definition: fixspace.cpp:266
tesseract::Tesseract::quality_based_rejection
void quality_based_rejection(PAGE_RES_IT &page_res_it, bool good_quality_doc)
Definition: docqual.cpp:155
tesseract::Tesseract::quality_rowrej_pc
double quality_rowrej_pc
Definition: tesseractclass.h:931
tesseract::Tesseract::flip_hyphens
void flip_hyphens(WERD_RES *word)
Definition: reject.cpp:622
tesseract::Tesseract::multilang_debug_level
int multilang_debug_level
Definition: tesseractclass.h:892
tesseract::Tesseract::TrainedXheightFix
bool TrainedXheightFix(WERD_RES *word, BLOCK *block, ROW *row)
Definition: control.cpp:1485
tesseract::Tesseract::debug_x_ht_level
int debug_x_ht_level
Definition: tesseractclass.h:874
TWERD
Definition: blobs.h:418
tesseract::Tesseract::split_word
void split_word(WERD_RES *word, int split_pt, WERD_RES **right_piece, BlamerBundle **orig_blamer_bundle) const
Definition: tfacepp.cpp:181
tesseract::Tesseract::CorrectClassifyWords
void CorrectClassifyWords(PAGE_RES *page_res)
tesseract::Tesseract::read_config_file
void read_config_file(const char *filename, SetParamConstraint constraint)
Definition: tessedit.cpp:66
tesseract::Tesseract::tessedit_reject_doc_percent
double tessedit_reject_doc_percent
Definition: tesseractclass.h:904
tesseract::Tesseract::first_alphanum_index
int16_t first_alphanum_index(const char *word, const char *word_lengths)
Definition: reject.cpp:475
tesseract::Tesseract::SubAndSuperscriptFix
bool SubAndSuperscriptFix(WERD_RES *word_res)
Definition: superscript.cpp:102
tesseract::TesseractStats::write_results_empty_block
bool write_results_empty_block
Definition: tesseractclass.h:142
tesseract::TesseractStats::doc_good_char_quality
int16_t doc_good_char_quality
Definition: tesseractclass.h:134
tesseract::Tesseract
Definition: tesseractclass.h:174
tesseract::Tesseract::applybox_page
int applybox_page
Definition: tesseractclass.h:826
tesseract::Tesseract::check_debug_pt
bool check_debug_pt(WERD_RES *word, int location)
Definition: control.cpp:1849
tesseract::Tesseract::textord_use_cjk_fp_model
bool textord_use_cjk_fp_model
Definition: tesseractclass.h:1061
tesseract::Tesseract::word_bln_display
bool word_bln_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:719
tesseract::Tesseract::tessedit_dont_rowrej_good_wds
bool tessedit_dont_rowrej_good_wds
Definition: tesseractclass.h:919
tesseract::Tesseract::reskew
const FCOORD & reskew() const
Definition: tesseractclass.h:194
CRUNCH_MODE
CRUNCH_MODE
Definition: pageres.h:157
tesseract::Tesseract::nn_match_word
void nn_match_word(WERD_RES *word, ROW *row)
tesseract::Tesseract::SetupWordScripts
void SetupWordScripts(BLOCK_LIST *blocks)
tesseract::Tesseract::tessedit_page_number
int tessedit_page_number
Definition: tesseractclass.h:1047
tesseract::Tesseract::pix_grey
Pix * pix_grey() const
Definition: tesseractclass.h:205
tesseract::Tesseract::tessedit_create_wordstrbox
bool tessedit_create_wordstrbox
Definition: tesseractclass.h:1007
tesseract::Tesseract::tessedit_char_whitelist
char * tessedit_char_whitelist
Definition: tesseractclass.h:807
tesseract::Tesseract::rej_use_good_perm
bool rej_use_good_perm
Definition: tesseractclass.h:1037
tesseract::WordData::WordData
WordData()
Definition: tesseractclass.h:147
tesseract::Tesseract::test_pt_x
double test_pt_x
Definition: tesseractclass.h:890
tesseract::Tesseract::noise_cert_factor
double noise_cert_factor
Definition: tesseractclass.h:871
tesseract::Tesseract::crunch_leave_ok_strings
bool crunch_leave_ok_strings
Definition: tesseractclass.h:954
tesseract::Tesseract::fixspace_thinks_word_done
bool fixspace_thinks_word_done(WERD_RES *word)
Definition: fixspace.cpp:530
tesseract::Tesseract::crunch_poor_garbage_rate
double crunch_poor_garbage_rate
Definition: tesseractclass.h:941
tesseract::Tesseract::debug_noise_removal
int debug_noise_removal
Definition: tesseractclass.h:859
tesseract::Tesseract::right_to_left
bool right_to_left() const
Definition: tesseractclass.h:275
tesseract::Tesseract::tessedit_dump_pageseg_images
bool tessedit_dump_pageseg_images
Definition: tesseractclass.h:795
tesseract::WordData::WordData
WordData(const PAGE_RES_IT &page_res_it)
Definition: tesseractclass.h:149
wordrec.h
tesseract::Tesseract::SetupApplyBoxes
PAGE_RES * SetupApplyBoxes(const GenericVector< TBOX > &boxes, BLOCK_LIST *block_list)
Definition: applybox.cpp:207
tesseract::Tesseract::paragraph_debug_level
int paragraph_debug_level
Definition: tesseractclass.h:893
ratngs.h
tesseract::Tesseract::tessedit_train_from_boxes
bool tessedit_train_from_boxes
Definition: tesseractclass.h:789
tesseract::Tesseract::SetupWordPassN
void SetupWordPassN(int pass_n, WordData *word)
Definition: control.cpp:177
tesseract::Tesseract::noise_outlines
bool noise_outlines(TWERD *word)
Definition: docqual.cpp:980
tesseract::Tesseract::pageseg_devanagari_split_strategy
int pageseg_devanagari_split_strategy
Definition: tesseractclass.h:815
double_VAR_H
#define double_VAR_H(name, val, comment)
Definition: params.h:301
tesseract::Tesseract::failure_count
int16_t failure_count(WERD_RES *word)
Definition: docqual.cpp:968
tesseract::Tesseract::AssignDiacriticsToNewBlobs
void AssignDiacriticsToNewBlobs(const GenericVector< C_OUTLINE * > &outlines, int pass, WERD *real_word, PAGE_RES_IT *pr_it, GenericVector< bool > *word_wanted, GenericVector< C_BLOB * > *target_blobs)
Definition: control.cpp:1064
GARBAGE_LEVEL
GARBAGE_LEVEL
Definition: docqual.h:30
tesseract::Tesseract::dont_allow_1Il
void dont_allow_1Il(WERD_RES *word)
Definition: reject.cpp:532
tesseract::Tesseract::process_cmd_win_event
bool process_cmd_win_event(int32_t cmd_event, char *new_value)
Definition: pgedit.cpp:415
tesseract::Tesseract::tessedit_char_blacklist
char * tessedit_char_blacklist
Definition: tesseractclass.h:806
tesseract::Tesseract::unlv_tilde_crunching
bool unlv_tilde_crunching
Definition: tesseractclass.h:932
INT_VAR_H
#define INT_VAR_H(name, val, comment)
Definition: params.h:295
tesseract::PSM_SINGLE_BLOCK
@ PSM_SINGLE_BLOCK
Assume a single uniform block of text. (Default.)
Definition: publictypes.h:172
WERD
Definition: werd.h:56
tesseract::Tesseract::GetRectImage
ImageData * GetRectImage(const TBOX &box, const BLOCK &block, int padding, TBOX *revised_box) const
Definition: linerec.cpp:170
tesseract::Tesseract::get_rep_char
UNICHAR_ID get_rep_char(WERD_RES *word)
Definition: output.cpp:255
tesseract::SetParamConstraint
SetParamConstraint
Definition: params.h:51
ETEXT_DESC
Definition: ocrclass.h:102
tesseract::Tesseract::tessedit_row_rej_good_docs
bool tessedit_row_rej_good_docs
Definition: tesseractclass.h:923
tesseract::Tesseract::applybox_learn_chars_and_char_frags_mode
bool applybox_learn_chars_and_char_frags_mode
Definition: tesseractclass.h:834
tesseract::Tesseract::crunch_del_low_word
double crunch_del_low_word
Definition: tesseractclass.h:950
tesseract::Tesseract::noise_maxperblob
int noise_maxperblob
Definition: tesseractclass.h:872
tesseract::Tesseract::tessedit_enable_dict_correction
bool tessedit_enable_dict_correction
Definition: tesseractclass.h:852
tesseract::Tesseract::tessedit_fix_fuzzy_spaces
bool tessedit_fix_fuzzy_spaces
Definition: tesseractclass.h:841
tesseract::Tesseract::textord_tabfind_aligned_gap_fraction
double textord_tabfind_aligned_gap_fraction
Definition: tesseractclass.h:1075
tesseract::Tesseract::tessedit_display_outwords
bool tessedit_display_outwords
Definition: tesseractclass.h:838
tesseract::Tesseract::textord_tabfind_vertical_text
bool textord_tabfind_vertical_text
Definition: tesseractclass.h:1068
tesseract
Definition: altorenderer.cpp:25
tesseract::Tesseract::pix_original
Pix * pix_original() const
Definition: tesseractclass.h:212
tesseract::Tesseract::file_type
char * file_type
Definition: tesseractclass.h:1050
tesseract::Tesseract::tessedit_debug_quality_metrics
bool tessedit_debug_quality_metrics
Definition: tesseractclass.h:929
tesseract::Tesseract::word_display
bool word_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:751
SVMenuNode
Definition: svmnode.h:35
tesseract::Tesseract::word_set_display
bool word_set_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:939
ACCEPTABLE_WERD_TYPE
ACCEPTABLE_WERD_TYPE
Definition: control.h:29
tesseract::Tesseract::tessedit_train_line_recognizer
bool tessedit_train_line_recognizer
Definition: tesseractclass.h:793
tesseract::Tesseract::tessedit_reject_row_percent
double tessedit_reject_row_percent
Definition: tesseractclass.h:908
tesseract::Tesseract::debug_fix_space_level
int debug_fix_space_level
Definition: tesseractclass.h:969
tesseract::Tesseract::AnyTessLang
bool AnyTessLang() const
Definition: tesseractclass.h:285
tesseract::Tesseract::init_tesseract
int init_tesseract(const char *datapath, const char *language, OcrEngineMode oem)
Definition: tesseractclass.h:512
tesseract::Tesseract::Clear
void Clear()
Definition: tesseractclass.cpp:564
tesseract::TesseractStats::doc_outline_errs
int16_t doc_outline_errs
Definition: tesseractclass.h:131
tesseract::TesseractStats::adaption_word_number
int32_t adaption_word_number
Definition: tesseractclass.h:129
tesseract::Tesseract::superscript_worse_certainty
double superscript_worse_certainty
Definition: tesseractclass.h:978
debugpixa.h
tesseract::Tesseract::x_ht_min_change
int x_ht_min_change
Definition: tesseractclass.h:973
GenericVector
Definition: baseapi.h:37
tesseract::Tesseract::rej_trust_doc_dawg
bool rej_trust_doc_dawg
Definition: tesseractclass.h:1032
tesseract::TessdataManager
Definition: tessdatamanager.h:126
strngs.h
tesseract::OEM_LSTM_ONLY
@ OEM_LSTM_ONLY
Definition: publictypes.h:270
tesseract::Tesseract::mutable_textord
Textord * mutable_textord()
Definition: tesseractclass.h:271
tesseract::Tesseract::unrej_good_quality_words
void unrej_good_quality_words(PAGE_RES_IT &page_res_it)
Definition: docqual.cpp:177
tesseract::Tesseract::min_sane_x_ht_pixels
int min_sane_x_ht_pixels
Definition: tesseractclass.h:1044
tesseract::Tesseract::ocr_devanagari_split_strategy
int ocr_devanagari_split_strategy
Definition: tesseractclass.h:819
tesseract::Tesseract::init_tesseract_internal
int init_tesseract_internal(const char *arg0, const char *textbase, const char *language, OcrEngineMode oem, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_init_params, TessdataManager *mgr)
Definition: tessedit.cpp:404
tesseract::Tesseract::acceptable_word_string
ACCEPTABLE_WERD_TYPE acceptable_word_string(const UNICHARSET &char_set, const char *s, const char *lengths)
Definition: control.cpp:1745
tesseract::Tesseract::MaximallyChopWord
void MaximallyChopWord(const GenericVector< TBOX > &boxes, BLOCK *block, ROW *row, WERD_RES *word_res)
Definition: applybox.cpp:243
tesseract::Tesseract::lstm_use_matrix
bool lstm_use_matrix
Definition: tesseractclass.h:897
tesseract::Tesseract::numeric_punctuation
char * numeric_punctuation
Definition: tesseractclass.h:970
genericvector.h
tesseract::Tesseract::set_pix_thresholds
void set_pix_thresholds(Pix *thresholds)
Definition: tesseractclass.h:242
tesseract::Tesseract::tessedit_parallelize
int tessedit_parallelize
Definition: tesseractclass.h:1076
UNICHAR_ID
int UNICHAR_ID
Definition: unichar.h:34
tesseract::Tesseract::crunch_del_rating
double crunch_del_rating
Definition: tesseractclass.h:944
tesseract::Tesseract::textord
const Textord & textord() const
Definition: tesseractclass.h:268
tesseract::Tesseract::tessedit_load_sublangs
char * tessedit_load_sublangs
Definition: tesseractclass.h:1053
tesseract::Tesseract::get_sub_lang
Tesseract * get_sub_lang(int index) const
Definition: tesseractclass.h:281
tesseract::Tesseract::recog_word_recursive
void recog_word_recursive(WERD_RES *word)
Definition: tfacepp.cpp:109
tesseract::Tesseract::tess_segment_pass_n
void tess_segment_pass_n(int pass_n, WERD_RES *word)
Definition: tessbox.cpp:32
tesseract::Tesseract::mutable_pix_binary
Pix ** mutable_pix_binary()
Definition: tesseractclass.h:198
tesseract::Tesseract::classify_word_and_language
void classify_word_and_language(int pass_n, PAGE_RES_IT *pr_it, WordData *word_data)
Definition: control.cpp:1319
tesseract::Tesseract::jpg_quality
int jpg_quality
Definition: tesseractclass.h:1011
tesseract::Tesseract::crunch_debug
int crunch_debug
Definition: tesseractclass.h:964
tesseract::Tesseract::set_pix_original
void set_pix_original(Pix *original_pix)
Definition: tesseractclass.h:216
tesseract::Tesseract::tessedit_prefer_joined_punct
bool tessedit_prefer_joined_punct
Definition: tesseractclass.h:967
tesseract::Tesseract::end_tesseract
void end_tesseract()
Definition: tessedit.cpp:483
STRING_VAR_H
#define STRING_VAR_H(name, val, comment)
Definition: params.h:299
tesseract::Tesseract::crunch_terrible_garbage
bool crunch_terrible_garbage
Definition: tesseractclass.h:939
tesseract::Tesseract::tessedit_lower_flip_hyphen
double tessedit_lower_flip_hyphen
Definition: tesseractclass.h:1030
tesseract::Tesseract::quality_char_pc
double quality_char_pc
Definition: tesseractclass.h:882
tesseract::Tesseract::poly_allow_detailed_fx
bool poly_allow_detailed_fx
Definition: tesseractclass.h:1063
tesseract::Tesseract::tessedit_create_lstmbox
bool tessedit_create_lstmbox
Definition: tesseractclass.h:1004
tesseract::Tesseract::reject_I_1_L
void reject_I_1_L(WERD_RES *word)
Definition: reject.cpp:194
tesseract::Tesseract::SetupPageSegAndDetectOrientation
ColumnFinder * SetupPageSegAndDetectOrientation(PageSegMode pageseg_mode, BLOCK_LIST *blocks, Tesseract *osd_tess, OSResults *osr, TO_BLOCK_LIST *to_blocks, Pix **photo_mask_pix, Pix **music_mask_pix)
Definition: pagesegmain.cpp:286
tesseract::Tesseract::interactive_display_mode
bool interactive_display_mode
Definition: tesseractclass.h:1049
tesseract::Tesseract::ParseLanguageString
void ParseLanguageString(const char *lang_str, GenericVector< STRING > *to_load, GenericVector< STRING > *not_to_load)
Definition: tessedit.cpp:272
tesseract::Tesseract::safe_dict_word
int16_t safe_dict_word(const WERD_RES *werd_res)
Definition: reject.cpp:613
tesseract::Tesseract::tessedit_zero_rejection
bool tessedit_zero_rejection
Definition: tesseractclass.h:1022
tesseract::Tesseract::debug_word
void debug_word(PAGE_RES *page_res, const TBOX &selection_box)
Definition: pgedit.cpp:665
tesseract::Tesseract::ApplyBoxTraining
void ApplyBoxTraining(const STRING &fontname, PAGE_RES *page_res)
tesseract::Tesseract::tessedit_zero_kelvin_rejection
bool tessedit_zero_kelvin_rejection
Definition: tesseractclass.h:1026
tesseract::Tesseract::tessedit_write_images
bool tessedit_write_images
Definition: tesseractclass.h:1048
tesseract::Tesseract::word_char_quality
void word_char_quality(WERD_RES *word, ROW *row, int16_t *match_count, int16_t *accepted_match_count)
Definition: docqual.cpp:109
tesseract::Tesseract::tessedit_rejection_debug
bool tessedit_rejection_debug
Definition: tesseractclass.h:1028
tesseract::WordData
Definition: tesseractclass.h:146
tesseract::Tesseract::tess_acceptable_word
bool tess_acceptable_word(WERD_RES *word)
Definition: tessbox.cpp:62
tesseract::Tesseract::ResetDocumentDictionary
void ResetDocumentDictionary()
Definition: tesseractclass.cpp:597
tesseract::ShiroRekhaSplitter
Definition: devanagari_processing.h:71
tesseract::Tesseract::ConvertStringToUnichars
bool ConvertStringToUnichars(const char *utf8, GenericVector< UNICHAR_ID > *class_ids)
tesseract::Tesseract::TrainFromBoxes
void TrainFromBoxes(const GenericVector< TBOX > &boxes, const GenericVector< STRING > &texts, BLOCK_LIST *block_list, DocumentData *training_data)
Definition: linerec.cpp:81
tesseract::TesseractStats::TesseractStats
TesseractStats()
Definition: tesseractclass.h:115
unichar.h
tesseract::DocumentData
Definition: imagedata.h:209
tesseract::Tesseract::noise_cert_basechar
double noise_cert_basechar
Definition: tesseractclass.h:862
tesseract::Tesseract::superscript_bettered_certainty
double superscript_bettered_certainty
Definition: tesseractclass.h:983
tesseract::Tesseract::ResegmentWordBox
bool ResegmentWordBox(BLOCK_LIST *block_list, const TBOX &box, const TBOX *next_box, const char *correct_text)
tesseract::Tesseract::suspect_short_words
int suspect_short_words
Definition: tesseractclass.h:1017
tesseract::WordData::word
WERD_RES * word
Definition: tesseractclass.h:157
tesseract::Tesseract::LSTMRecognizeWord
void LSTMRecognizeWord(const BLOCK &block, ROW *row, WERD_RES *word, PointerVector< WERD_RES > *words)
Definition: linerec.cpp:229
tesseract::ScriptPos
ScriptPos
Definition: ratngs.h:252
BOOL_VAR_H
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:297
tesseract::Tesseract::RecogAllWordsPassN
bool RecogAllWordsPassN(int pass_n, ETEXT_DESC *monitor, PAGE_RES_IT *pr_it, GenericVector< WordData > *words)
Definition: control.cpp:213
tesseract::Tesseract::fixsp_done_mode
int fixsp_done_mode
Definition: tesseractclass.h:968
tesseract::Tesseract::digit_or_numeric_punct
bool digit_or_numeric_punct(WERD_RES *word, int char_position)
Definition: fixspace.cpp:370
tesseract::Tesseract::tessedit_write_block_separators
bool tessedit_write_block_separators
Definition: tesseractclass.h:997
tesseract::Tesseract::AutoPageSeg
int AutoPageSeg(PageSegMode pageseg_mode, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks, BLOBNBOX_LIST *diacritic_blobs, Tesseract *osd_tess, OSResults *osr)
Definition: pagesegmain.cpp:216
BlamerBundle
Definition: blamer.h:102
tesseract::Tesseract::tessedit_good_quality_unrej
bool tessedit_good_quality_unrej
Definition: tesseractclass.h:901
tesseract::Tesseract::tessedit_upper_flip_hyphen
double tessedit_upper_flip_hyphen
Definition: tesseractclass.h:1031
tesseract::Tesseract::tessedit_reject_mode
int tessedit_reject_mode
Definition: tesseractclass.h:1027
tesseract::Tesseract::subscript_max_y_top
double subscript_max_y_top
Definition: tesseractclass.h:991
tesseract::Tesseract::acceptable_number_string
bool acceptable_number_string(const char *s, const char *lengths)
Definition: output.cpp:391
tesseract::Tesseract::textonly_pdf
bool textonly_pdf
Definition: tesseractclass.h:1010
tesseract::Tesseract::blob_feature_display
void blob_feature_display(PAGE_RES *page_res, const TBOX &selection_box)
Definition: pgedit.cpp:954
tesseract::Tesseract::ok_repeated_ch_non_alphanum_wds
char * ok_repeated_ch_non_alphanum_wds
Definition: tesseractclass.h:1042
tesseract::Tesseract::recog_interactive
bool recog_interactive(PAGE_RES_IT *pr_it)
Definition: control.cpp:77
tesseract::Tesseract::suspect_constrain_1Il
bool suspect_constrain_1Il
Definition: tesseractclass.h:1018
tesseract::Tesseract::PreenXHeights
void PreenXHeights(BLOCK_LIST *block_list)
Definition: applybox.cpp:181
SVEvent
Definition: scrollview.h:61
tesseract::Tesseract::SearchForText
void SearchForText(const GenericVector< BLOB_CHOICE_LIST * > *choices, int choices_pos, int choices_length, const GenericVector< UNICHAR_ID > &target_text, int text_index, float rating, GenericVector< int > *segmentation, float *best_rating, GenericVector< int > *best_segmentation)
tesseract::Tesseract::word_outline_errs
int16_t word_outline_errs(WERD_RES *word)
Definition: docqual.cpp:89
PAGE_RES_IT
Definition: pageres.h:675
tesseract::Tesseract::init_tesseract
int init_tesseract(const char *arg0, const char *textbase, const char *language, OcrEngineMode oem, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_init_params, TessdataManager *mgr)
Definition: tessedit.cpp:304
tesseract::WordData::block
BLOCK * block
Definition: tesseractclass.h:159
tesseract::Tesseract::SetupUniversalFontIds
void SetupUniversalFontIds()
Definition: tessedit.cpp:449
tesseract::Tesseract::tessedit_debug_block_rejection
bool tessedit_debug_block_rejection
Definition: tesseractclass.h:848
tesseract::Tesseract::ReSegmentByClassification
void ReSegmentByClassification(PAGE_RES *page_res)
tesseract::Tesseract::crunch_leave_accept_strings
bool crunch_leave_accept_strings
Definition: tesseractclass.h:957
tesseract::Tesseract::do_re_display
void do_re_display(bool(tesseract::Tesseract::*word_painter)(PAGE_RES_IT *pr_it))
Definition: pgedit.cpp:349
tesseract::Tesseract::TrySuperscriptSplits
WERD_RES * TrySuperscriptSplits(int num_chopped_leading, float leading_certainty, ScriptPos leading_pos, int num_chopped_trailing, float trailing_certainty, ScriptPos trailing_pos, WERD_RES *word, bool *is_good, int *retry_leading, int *retry_trailing)
Definition: superscript.cpp:383
tesseract::Tesseract::tilde_delete
void tilde_delete(PAGE_RES_IT &page_res_it)
Definition: docqual.cpp:589
tesseract::TesseractStats::word_count
int32_t word_count
Definition: tesseractclass.h:135
tesseract::Tesseract::FindSegmentation
bool FindSegmentation(const GenericVector< UNICHAR_ID > &target_text, WERD_RES *word_res)
tesseract::Tesseract::applybox_debug
int applybox_debug
Definition: tesseractclass.h:825
tesseract::Tesseract::recog_training_segmented
void recog_training_segmented(const STRING &fname, PAGE_RES *page_res, volatile ETEXT_DESC *monitor, FILE *output_file)
Definition: recogtraining.cpp:84
textord.h
tesseract::Tesseract::SetBlackAndWhitelist
void SetBlackAndWhitelist()
Definition: tesseractclass.cpp:604
tesseract::Tesseract::ClassifyBlobPlusOutlines
float ClassifyBlobPlusOutlines(const GenericVector< bool > &ok_outlines, const GenericVector< C_OUTLINE * > &outlines, int pass_n, PAGE_RES_IT *pr_it, C_BLOB *blob, STRING *best_str)
Definition: control.cpp:1226
tesseract::Tesseract::crunch_early_merge_tess_fails
bool crunch_early_merge_tess_fails
Definition: tesseractclass.h:936
tesseract::Tesseract::build_menu_new
SVMenuNode * build_menu_new()
Definition: pgedit.cpp:298
tesseract::OcrEngineMode
OcrEngineMode
Definition: publictypes.h:268
tesseract::Tesseract::GetLineData
ImageData * GetLineData(const TBOX &line_box, const GenericVector< TBOX > &boxes, const GenericVector< STRING > &texts, int start_box, int end_box, const BLOCK &block)
Definition: linerec.cpp:136
tesseract::Tesseract::tessedit_bigram_debug
int tessedit_bigram_debug
Definition: tesseractclass.h:855
tesseract::Tesseract::crunch_accept_ok
bool crunch_accept_ok
Definition: tesseractclass.h:955
tesseract::Tesseract::outlines_2
char * outlines_2
Definition: tesseractclass.h:899
tesseract::Tesseract::process_selected_words
void process_selected_words(PAGE_RES *page_res, TBOX &selection_box, bool(tesseract::Tesseract::*word_processor)(PAGE_RES_IT *pr_it))
Definition: pagewalk.cpp:47
tesseract::Tesseract::ambigs_classify_and_output
void ambigs_classify_and_output(const char *label, PAGE_RES_IT *pr_it, FILE *output_file)
Definition: recogtraining.cpp:211
tesseract::TesseractStats::dump_words_str
STRING dump_words_str
Definition: tesseractclass.h:137
tesseract::Tesseract::rej_use_tess_blanks
bool rej_use_tess_blanks
Definition: tesseractclass.h:1036
tesseract::Tesseract::test_pt
bool test_pt
Definition: tesseractclass.h:889
tesseract::Tesseract::paragraph_text_based
bool paragraph_text_based
Definition: tesseractclass.h:896
tesseract::Tesseract::suspect_accept_rating
double suspect_accept_rating
Definition: tesseractclass.h:1020
tesseract::Tesseract::crunch_del_min_ht
double crunch_del_min_ht
Definition: tesseractclass.h:946
OSResults
Definition: osdetect.h:49
tesseract::Tesseract::SelectGoodDiacriticOutlines
bool SelectGoodDiacriticOutlines(int pass, float certainty_threshold, PAGE_RES_IT *pr_it, C_BLOB *blob, const GenericVector< C_OUTLINE * > &outlines, int num_outlines, GenericVector< bool > *ok_outlines)
Definition: control.cpp:1140
tesseract::Tesseract::tessedit_pageseg_mode
int tessedit_pageseg_mode
Definition: tesseractclass.h:801
tesseract::Tesseract::classify_word_pass1
void classify_word_pass1(const WordData &word_data, WERD_RES **in_word, PointerVector< WERD_RES > *out_words)
Definition: control.cpp:1401
tesseract::Tesseract::init_tesseract_lm
int init_tesseract_lm(const char *arg0, const char *textbase, const char *language, TessdataManager *mgr)
Definition: tessedit.cpp:470
tesseract::Tesseract::tessedit_override_permuter
bool tessedit_override_permuter
Definition: tesseractclass.h:1051
tesseract::Tesseract::set_unlv_suspects
void set_unlv_suspects(WERD_RES *word)
Definition: output.cpp:277
tesseract::TesseractStats
Definition: tesseractclass.h:114
tesseract::Tesseract::crunch_long_repetitions
int crunch_long_repetitions
Definition: tesseractclass.h:963
tesseract::Tesseract::fixsp_non_noise_limit
int fixsp_non_noise_limit
Definition: tesseractclass.h:965
tesseract::Tesseract::rejection_passes
void rejection_passes(PAGE_RES *page_res, ETEXT_DESC *monitor, const TBOX *target_word_box, const char *word_config)
Definition: control.cpp:612
tesseract::Tesseract::chs_trailing_punct2
char * chs_trailing_punct2
Definition: tesseractclass.h:877
tesseract::Tesseract::BestPix
Pix * BestPix() const
Definition: tesseractclass.h:233
tesseract::Tesseract::recognize_page
void recognize_page(STRING &image_name)
tesseract::Tesseract::tessedit_resegment_from_boxes
bool tessedit_resegment_from_boxes
Definition: tesseractclass.h:785
tesseract::Tesseract::SearchWords
void SearchWords(PointerVector< WERD_RES > *words)
Definition: linerec.cpp:259
tesseract::OEM_DEFAULT
@ OEM_DEFAULT
Definition: publictypes.h:274
tesseract::Tesseract::recog_pseudo_word
void recog_pseudo_word(PAGE_RES *page_res, TBOX &selection_box)
Definition: control.cpp:62
tesseract::Tesseract::superscript_scaledown_ratio
double superscript_scaledown_ratio
Definition: tesseractclass.h:987
tesseract::Tesseract::tessedit_debug_fonts
bool tessedit_debug_fonts
Definition: tesseractclass.h:847
tesseract::Tesseract::tessedit_resegment_from_line_boxes
bool tessedit_resegment_from_line_boxes
Definition: tesseractclass.h:787
tesseract::Tesseract::ComputeCompatibleXheight
float ComputeCompatibleXheight(WERD_RES *word_res, float *baseline_shift)
Definition: fixxht.cpp:119
tesseract::Tesseract::rej_alphas_in_number_perm
bool rej_alphas_in_number_perm
Definition: tesseractclass.h:1039
tesseract::Tesseract::preserve_interword_spaces
bool preserve_interword_spaces
Definition: tesseractclass.h:1078
tesseract::Tesseract::tessedit_image_border
int tessedit_image_border
Definition: tesseractclass.h:1041
tesseract::Tesseract::bigram_correction_pass
void bigram_correction_pass(PAGE_RES *page_res)
Definition: control.cpp:467
tesseract::Tesseract::quality_rej_pc
double quality_rej_pc
Definition: tesseractclass.h:878
tesseract::Tesseract::outlines_odd
char * outlines_odd
Definition: tesseractclass.h:898
tesseract::Tesseract::ProcessTargetWord
bool ProcessTargetWord(const TBOX &word_box, const TBOX &target_word_box, const char *word_config, int pass)
Definition: control.cpp:120
tesseract::Tesseract::word_dumper
bool word_dumper(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:915
tesseract::Tesseract::set_word_fonts
void set_word_fonts(WERD_RES *word)
Definition: control.cpp:1962
tesseract::Tesseract::AssignDiacriticsToOverlappingBlobs
void AssignDiacriticsToOverlappingBlobs(const GenericVector< C_OUTLINE * > &outlines, int pass, WERD *real_word, PAGE_RES_IT *pr_it, GenericVector< bool > *word_wanted, GenericVector< bool > *overlapped_any_blob, GenericVector< C_BLOB * > *target_blobs)
Definition: control.cpp:1011
tesseract::Tesseract::count_alphanums
int16_t count_alphanums(const WERD_CHOICE &word)
Definition: output.cpp:380
tesseract::Tesseract::SetScaledColor
void SetScaledColor(int factor, Pix *color)
Definition: tesseractclass.h:264
tesseract::PointerVector< WERD_RES >
tesseract::Tesseract::tessedit_create_pdf
bool tessedit_create_pdf
Definition: tesseractclass.h:1008
tesseract::Tesseract::ApplyBoxes
PAGE_RES * ApplyBoxes(const STRING &fname, bool find_segmentation, BLOCK_LIST *block_list)
Definition: applybox.cpp:109
tesseract::Tesseract::flip_0O
void flip_0O(WERD_RES *word)
Definition: reject.cpp:679
tesseract::Tesseract::ResegmentCharBox
bool ResegmentCharBox(PAGE_RES *page_res, const TBOX *prev_box, const TBOX &box, const TBOX *next_box, const char *correct_text)
Definition: applybox.cpp:329
WERD_RES
Definition: pageres.h:166
tesseract::Tesseract::tessedit_use_primary_params_model
bool tessedit_use_primary_params_model
Definition: tesseractclass.h:1055
tesseract::Tesseract::scaled_factor
int scaled_factor() const
Definition: tesseractclass.h:261
tesseract::Tesseract::rej_1Il_trust_permuter_type
bool rej_1Il_trust_permuter_type
Definition: tesseractclass.h:1034
tesseract::EquationDetect
Definition: equationdetect.h:38
tesseract::Tesseract::tessedit_write_rep_codes
bool tessedit_write_rep_codes
Definition: tesseractclass.h:998
tesseract::Tesseract::SegmentPage
int SegmentPage(const STRING *input_file, BLOCK_LIST *blocks, Tesseract *osd_tess, OSResults *osr)
Definition: pagesegmain.cpp:115
tesseract::Tesseract::tessedit_create_boxfile
bool tessedit_create_boxfile
Definition: tesseractclass.h:1045
tesseract::Tesseract::RunOldFixXht
bool RunOldFixXht(WERD_RES *word, BLOCK *block, ROW *row)
tesseract::Tesseract::recog_word
void recog_word(WERD_RES *word)
Definition: tfacepp.cpp:45
tesseract::Tesseract::tessedit_preserve_blk_rej_perfect_wds
bool tessedit_preserve_blk_rej_perfect_wds
Definition: tesseractclass.h:913
tesseract::Tesseract::tessedit_init_config_only
bool tessedit_init_config_only
Definition: tesseractclass.h:1066
tessdatamanager.h
tesseract::Tesseract::split_and_recog_word
void split_and_recog_word(WERD_RES *word)
Definition: tfacepp.cpp:143
tesseract::Tesseract::blamer_pass
void blamer_pass(PAGE_RES *page_res)
Definition: control.cpp:710
tesseract::Tesseract::SetupAllWordsPassN
void SetupAllWordsPassN(int pass_n, const TBOX *target_word_box, const char *word_config, PAGE_RES *page_res, GenericVector< WordData > *words)
Definition: control.cpp:154
tesseract::Tesseract::tessedit_minimal_rej_pass1
bool tessedit_minimal_rej_pass1
Definition: tesseractclass.h:887
tesseract::Tesseract::terrible_word_crunch
bool terrible_word_crunch(WERD_RES *word, GARBAGE_LEVEL garbage_level)
Definition: docqual.cpp:503
tesseract::Tesseract::tessedit_minimal_rejection
bool tessedit_minimal_rejection
Definition: tesseractclass.h:1021
tesseract::Tesseract::word_blank_and_set_display
bool word_blank_and_set_display(PAGE_RES_IT *pr_its)
Definition: pgedit.cpp:707
tesseract::Tesseract::recog_all_words
bool recog_all_words(PAGE_RES *page_res, ETEXT_DESC *monitor, const TBOX *target_word_box, const char *word_config, int dopasses)
Definition: control.cpp:302
tesseract::Tesseract::fix_rep_char
void fix_rep_char(PAGE_RES_IT *page_res_it)
Definition: control.cpp:1706
tesseract::Tesseract::tessedit_test_adaption
bool tessedit_test_adaption
Definition: tesseractclass.h:888
tesseract::Tesseract::set_source_resolution
void set_source_resolution(int ppi)
Definition: tesseractclass.h:249
tesseract::Tesseract::word_contains_non_1_digit
bool word_contains_non_1_digit(const char *word, const char *word_lengths)
Definition: reject.cpp:515
tesseract::Tesseract::tessedit_reject_block_percent
double tessedit_reject_block_percent
Definition: tesseractclass.h:906
tesseract::Tesseract::tessedit_tess_adaption_mode
int tessedit_tess_adaption_mode
Definition: tesseractclass.h:885
tesseract::Tesseract::quality_outline_pc
double quality_outline_pc
Definition: tesseractclass.h:881
tesseract::Tesseract::x_ht_acceptance_tolerance
int x_ht_acceptance_tolerance
Definition: tesseractclass.h:972
tesseract::Tesseract::classify_word_pass2
void classify_word_pass2(const WordData &word_data, WERD_RES **in_word, PointerVector< WERD_RES > *out_words)
Definition: control.cpp:1572
tesseract::Tesseract::tessedit_timing_debug
bool tessedit_timing_debug
Definition: tesseractclass.h:840
tesseract::Tesseract::alpha_count
int16_t alpha_count(const char *word, const char *word_lengths)
Definition: reject.cpp:501
tesseract::Tesseract::tessedit_enable_bigram_correction
bool tessedit_enable_bigram_correction
Definition: tesseractclass.h:850
tesseract::Tesseract::bidi_debug
int bidi_debug
Definition: tesseractclass.h:824
tesseract::Tesseract::crunch_rating_max
int crunch_rating_max
Definition: tesseractclass.h:952
TBLOB
Definition: blobs.h:284
tesseract::Tesseract::worst_noise_blob
int16_t worst_noise_blob(WERD_RES *word_res, float *worst_noise_score)
Definition: fixspace.cpp:707
tesseract::Tesseract::init_recog_training
FILE * init_recog_training(const STRING &fname)
Definition: recogtraining.cpp:36
publictypes.h
tesseract::Tesseract::Tesseract
Tesseract()
Definition: tesseractclass.cpp:52
tesseract::Tesseract::applybox_exposure_pattern
char * applybox_exposure_pattern
Definition: tesseractclass.h:830
tesseract::Tesseract::test_pt_y
double test_pt_y
Definition: tesseractclass.h:891
tesseract::Tesseract::match_word_pass_n
void match_word_pass_n(int pass_n, WERD_RES *word, ROW *row, BLOCK *block)
Definition: control.cpp:1630
tesseract::Tesseract::tessedit_good_doc_still_rowrej_wd
double tessedit_good_doc_still_rowrej_wd
Definition: tesseractclass.h:925
tesseract::Tesseract::hocr_font_info
bool hocr_font_info
Definition: tesseractclass.h:933
tesseract::Tesseract::quality_min_initial_alphas_reqd
int quality_min_initial_alphas_reqd
Definition: tesseractclass.h:883
tesseract::Dict
Definition: dict.h:91
tesseract::Tesseract::crunch_del_max_ht
double crunch_del_max_ht
Definition: tesseractclass.h:947
tesseract::WordData::WordData
WordData(BLOCK *block_in, ROW *row_in, WERD_RES *word_res)
Definition: tesseractclass.h:154
tesseract::Tesseract::AnyLSTMLang
bool AnyLSTMLang() const
Definition: tesseractclass.h:295
tesseract::Textord
Definition: textord.h:68
tesseract::Tesseract::tessedit_ocr_engine_mode
int tessedit_ocr_engine_mode
Definition: tesseractclass.h:804
tesseract::Tesseract::crunch_early_convert_bad_unlv_chs
bool crunch_early_convert_bad_unlv_chs
Definition: tesseractclass.h:937
tesseract::Tesseract::rej_1Il_use_dict_word
bool rej_1Il_use_dict_word
Definition: tesseractclass.h:1033
tesseract::Tesseract::fixsp_small_outlines_size
double fixsp_small_outlines_size
Definition: tesseractclass.h:966
tesseract::Tesseract::fix_fuzzy_space_list
void fix_fuzzy_space_list(WERD_RES_LIST &best_perm, ROW *row, BLOCK *block)
Definition: fixspace.cpp:172
tesseract::Tesseract::set_pix_grey
void set_pix_grey(Pix *grey_pix)
Definition: tesseractclass.h:208
tesseract::Tesseract::pgeditor_main
void pgeditor_main(int width, int height, PAGE_RES *page_res)
Definition: pgedit.cpp:378
tesseract::Tesseract::match_current_words
void match_current_words(WERD_RES_LIST &words, ROW *row, BLOCK *block)
Definition: fixspace.cpp:223
devanagari_processing.h
tesseract::Tesseract::word_deletable
CRUNCH_MODE word_deletable(WERD_RES *word, int16_t &delete_mode)
Definition: docqual.cpp:897
tesseract::Tesseract::crunch_poor_garbage_cert
double crunch_poor_garbage_cert
Definition: tesseractclass.h:940
tesseract::Tesseract::noise_maxperword
int noise_maxperword
Definition: tesseractclass.h:873
tesseract::Tesseract::tessedit_reject_bad_qual_wds
bool tessedit_reject_bad_qual_wds
Definition: tesseractclass.h:926
tesseract::Tesseract::noise_cert_disjoint
double noise_cert_disjoint
Definition: tesseractclass.h:865
tesseract::Tesseract::quality_blob_pc
double quality_blob_pc
Definition: tesseractclass.h:879
tesseract::PageSegMode
PageSegMode
Definition: publictypes.h:163
tesseract::Tesseract::tessedit_create_alto
bool tessedit_create_alto
Definition: tesseractclass.h:1002
tesseract::Tesseract::word_adaptable
bool word_adaptable(WERD_RES *word, uint16_t mode)
Definition: adaptions.cpp:51
tesseract::Tesseract::convert_bad_unlv_chs
void convert_bad_unlv_chs(WERD_RES *word_res)
Definition: docqual.cpp:659
tesseract::Tesseract::blob_noise_score
float blob_noise_score(TBLOB *blob)
Definition: fixspace.cpp:787
tesseract::Tesseract::tessedit_adaption_debug
bool tessedit_adaption_debug
Definition: tesseractclass.h:823
tesseract::Tesseract::reject_mostly_rejects
void reject_mostly_rejects(WERD_RES *word)
Definition: reject.cpp:579
tesseract::Tesseract::hocr_char_boxes
bool hocr_char_boxes
Definition: tesseractclass.h:935
tesseract::Tesseract::fix_fuzzy_spaces
void fix_fuzzy_spaces(ETEXT_DESC *monitor, int32_t word_count, PAGE_RES *page_res)
Definition: fixspace.cpp:75
tesseract::TesseractStats::doc_blob_quality
int16_t doc_blob_quality
Definition: tesseractclass.h:130
tesseract::Tesseract::make_reject_map
void make_reject_map(WERD_RES *word, ROW *row, int16_t pass)
tesseract::ColumnFinder
Definition: colfind.h:50
C_BLOB
Definition: stepblob.h:38
tesseract::Tesseract::tessedit_do_invert
bool tessedit_do_invert
Definition: tesseractclass.h:797
tesseract::Tesseract::potential_word_crunch
bool potential_word_crunch(WERD_RES *word, GARBAGE_LEVEL garbage_level, bool ok_dict_word)
Definition: docqual.cpp:541
tesseract::Tesseract::min_orientation_margin
double min_orientation_margin
Definition: tesseractclass.h:1059
tesseract::Tesseract::output_pass
void output_pass(PAGE_RES_IT &page_res_it, const TBOX *target_word_box)
Definition: output.cpp:36
tesseract::Tesseract::crunch_del_high_word
double crunch_del_high_word
Definition: tesseractclass.h:949
tesseract::Tesseract::tessedit_preserve_row_rej_perfect_wds
bool tessedit_preserve_row_rej_perfect_wds
Definition: tesseractclass.h:915
tesseract::Tesseract::ReportXhtFixResult
void ReportXhtFixResult(bool accept_new_word, float new_x_ht, WERD_RES *word, WERD_RES *new_word)
Definition: control.cpp:1462
tesseract::WordData::prev_word
WordData * prev_word
Definition: tesseractclass.h:160
tesseract::Tesseract::crunch_include_numerals
bool crunch_include_numerals
Definition: tesseractclass.h:958
tesseract::Tesseract::suspect_level
int suspect_level
Definition: tesseractclass.h:1016
tesseract::Tesseract::unrecognised_char
char * unrecognised_char
Definition: tesseractclass.h:1015
tesseract::Tesseract::tessedit_write_params_to_file
char * tessedit_write_params_to_file
Definition: tesseractclass.h:821
tesseract::Tesseract::tessedit_flip_0O
bool tessedit_flip_0O
Definition: tesseractclass.h:1029
tesseract::Tesseract::textord_equation_detect
bool textord_equation_detect
Definition: tesseractclass.h:1067
tesseract::Tesseract::fix_sp_fp_word
void fix_sp_fp_word(WERD_RES_IT &word_res_it, ROW *row, BLOCK *block)
Definition: fixspace.cpp:562
tesseract::Tesseract::non_0_digit
bool non_0_digit(const UNICHARSET &ch_set, UNICHAR_ID unichar_id)
Definition: reject.cpp:795
tesseract::Tesseract::tessedit_fix_hyphens
bool tessedit_fix_hyphens
Definition: tesseractclass.h:844
tesseract::Tesseract::crunch_del_cert
double crunch_del_cert
Definition: tesseractclass.h:945
tesseract::Tesseract::tessedit_word_for_word
bool tessedit_word_for_word
Definition: tesseractclass.h:1024
tesseract::Tesseract::BelievableSuperscript
bool BelievableSuperscript(bool debug, const WERD_RES &word, float certainty_threshold, int *left_ok, int *right_ok) const
Definition: superscript.cpp:522
tesseract::Tesseract::dump_words
void dump_words(WERD_RES_LIST &perm, int16_t score, int16_t mode, bool improved)
Definition: fixspace.cpp:476
tesseract::Tesseract::ClassifyBlobAsWord
float ClassifyBlobAsWord(int pass_n, PAGE_RES_IT *pr_it, C_BLOB *blob, STRING *best_str, float *c2)
Definition: control.cpp:1270
tesseract::Tesseract::nn_recover_rejects
void nn_recover_rejects(WERD_RES *word, ROW *row)
tesseract::Tesseract::fix_noisy_space_list
void fix_noisy_space_list(WERD_RES_LIST &best_perm, ROW *row, BLOCK *block)
Definition: fixspace.cpp:596
tesseract::Tesseract::chs_leading_punct
char * chs_leading_punct
Definition: tesseractclass.h:875
tesseract::Tesseract::source_resolution
int source_resolution() const
Definition: tesseractclass.h:246
tesseract::Tesseract::ImageWidth
int ImageWidth() const
Definition: tesseractclass.h:252
tesseract::Tesseract::ReassignDiacritics
bool ReassignDiacritics(int pass, PAGE_RES_IT *pr_it, bool *make_next_word_fuzzy)
Definition: control.cpp:945
tesseract::Tesseract::reject_edge_blobs
void reject_edge_blobs(WERD_RES *word)
Definition: reject.cpp:269
tesseract::LSTMRecognizer
Definition: lstmrecognizer.h:54
tesseract::Tesseract::tessedit_dump_choices
bool tessedit_dump_choices
Definition: tesseractclass.h:839
tesseract::Tesseract::tess_add_doc_word
void tess_add_doc_word(WERD_CHOICE *word_choice)
Definition: tessbox.cpp:72
tesseract::Tesseract::count_alphas
int16_t count_alphas(const WERD_CHOICE &word)
Definition: output.cpp:370
ROW
Definition: ocrrow.h:37
tesseract::Tesseract::GetSubAndSuperscriptCandidates
void GetSubAndSuperscriptCandidates(const WERD_RES *word, int *num_rebuilt_leading, ScriptPos *leading_pos, float *leading_certainty, int *num_rebuilt_trailing, ScriptPos *trailing_pos, float *trailing_certainty, float *avg_certainty, float *unlikely_threshold)
Definition: superscript.cpp:254
tesseract::Tesseract::ImageHeight
int ImageHeight() const
Definition: tesseractclass.h:255
tesseract::Tesseract::rej_use_sensible_wd
bool rej_use_sensible_wd
Definition: tesseractclass.h:1038
tesseract::Tesseract::crunch_terrible_rating
double crunch_terrible_rating
Definition: tesseractclass.h:938
tesseract::Tesseract::scaled_color
Pix * scaled_color() const
Definition: tesseractclass.h:258
tesseract::Tesseract::tessedit_char_unblacklist
char * tessedit_char_unblacklist
Definition: tesseractclass.h:809
tesseract::Tesseract::crunch_pot_poor_rate
double crunch_pot_poor_rate
Definition: tesseractclass.h:942
tesseract::Tesseract::user_defined_dpi
int user_defined_dpi
Definition: tesseractclass.h:1012
points.h
tesseract::Tesseract::join_words
void join_words(WERD_RES *word, WERD_RES *word2, BlamerBundle *orig_bb) const
Definition: tfacepp.cpp:239
BLOCK
Definition: ocrblock.h:31
tesseract::Tesseract::PrerecAllWordsPar
void PrerecAllWordsPar(const GenericVector< WordData > &words)
Definition: par_control.cpp:38
tesseract::Tesseract::repeated_nonalphanum_wd
bool repeated_nonalphanum_wd(WERD_RES *word, ROW *row)
Definition: reject.cpp:588
tesseract::Tesseract::RetryWithLanguage
int RetryWithLanguage(const WordData &word_data, WordRecognizer recognizer, bool debug, WERD_RES **in_word, PointerVector< WERD_RES > *best_words)
Definition: control.cpp:904
tesseract::Tesseract::TrainLineRecognizer
bool TrainLineRecognizer(const STRING &input_imagename, const STRING &output_basename, BLOCK_LIST *block_list)
Definition: linerec.cpp:44
tesseract::Tesseract::textord_tabfind_vertical_text_ratio
double textord_tabfind_vertical_text_ratio
Definition: tesseractclass.h:1073
tesseract::Tesseract::count_outline_errs
int16_t count_outline_errs(char c, int16_t outline_count)
Definition: docqual.cpp:143
tesseract::Tesseract::tessedit_create_hocr
bool tessedit_create_hocr
Definition: tesseractclass.h:1001
tesseract::Tesseract::tessedit_whole_wd_rej_row_percent
double tessedit_whole_wd_rej_row_percent
Definition: tesseractclass.h:911
tesseract::Tesseract::CountMisfitTops
int CountMisfitTops(WERD_RES *word_res)
Definition: fixxht.cpp:87
tesseract::Tesseract::ReportFailedBox
void ReportFailedBox(int boxfile_lineno, TBOX box, const char *box_ch, const char *err_msg)
tesseract::Tesseract::num_sub_langs
int num_sub_langs() const
Definition: tesseractclass.h:278
STRING
Definition: strngs.h:45
tesseract::Tesseract::first_alphanum_offset
int16_t first_alphanum_offset(const char *word, const char *word_lengths)
Definition: reject.cpp:488
tesseract::Tesseract::tessedit_dont_blkrej_good_wds
bool tessedit_dont_blkrej_good_wds
Definition: tesseractclass.h:917
tesseract::Tesseract::min_characters_to_try
int min_characters_to_try
Definition: tesseractclass.h:1014
tesseract::Tesseract::process_image_event
void process_image_event(const SVEvent &event)
Definition: pgedit.cpp:587
params.h
PAGE_RES
Definition: pageres.h:76
tesseract::Tesseract::SetEquationDetect
void SetEquationDetect(EquationDetect *detector)
Definition: tesseractclass.cpp:581
tesseract::Tesseract::break_noisiest_blob_word
void break_noisiest_blob_word(WERD_RES_LIST &words)
Definition: fixspace.cpp:642
tesseract::DebugPixa
Definition: debugpixa.h:10
tesseract::Tesseract::lstm_choice_mode
int lstm_choice_mode
Definition: tesseractclass.h:1087
tesseract::Tesseract::suspect_rating_per_ch
double suspect_rating_per_ch
Definition: tesseractclass.h:1019
tesseract::Tesseract::textord_tabfind_show_vlines
bool textord_tabfind_show_vlines
Definition: tesseractclass.h:1060
tesseract::Tesseract::fp_eval_word_spacing
int16_t fp_eval_word_spacing(WERD_RES_LIST &word_res_list)
Definition: fixspace.cpp:857
tesseract::Tesseract::PrepareForPageseg
void PrepareForPageseg()
Definition: tesseractclass.cpp:631
UNICHARSET
Definition: unicharset.h:145
tesseract::TesseractStats::doc_char_quality
int16_t doc_char_quality
Definition: tesseractclass.h:132
tesseract::Tesseract::crunch_small_outlines_size
double crunch_small_outlines_size
Definition: tesseractclass.h:951
tesseract::Tesseract::crunch_pot_indicators
int crunch_pot_indicators
Definition: tesseractclass.h:953
tesseract::Tesseract::pageseg_apply_music_mask
bool pageseg_apply_music_mask
Definition: tesseractclass.h:1089
tesseract::Tesseract::crunch_del_min_width
double crunch_del_min_width
Definition: tesseractclass.h:948
tesseract::Tesseract::bland_unrej
bool bland_unrej
Definition: tesseractclass.h:930
tesseract::Tesseract::tessedit_write_unlv
bool tessedit_write_unlv
Definition: tesseractclass.h:999
tesseract::Tesseract::tessedit_unrej_any_wd
bool tessedit_unrej_any_wd
Definition: tesseractclass.h:843
pageres.h
WERD_CHOICE
Definition: ratngs.h:263
tesseract::TesseractStats::dict_words
int32_t dict_words
Definition: tesseractclass.h:136
tesseract::Tesseract::getDict
Dict & getDict() override
Definition: tesseractclass.cpp:551
tesseract::Tesseract::dictionary_correction_pass
void dictionary_correction_pass(PAGE_RES *page_res)
Definition: control.cpp:2093
tesseract::Tesseract::init_tesseract_lang_data
bool init_tesseract_lang_data(const char *arg0, const char *textbase, const char *language, OcrEngineMode oem, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_init_params, TessdataManager *mgr)
Definition: tessedit.cpp:97
tesseract::Tesseract::applybox_learn_ngrams_mode
bool applybox_learn_ngrams_mode
Definition: tesseractclass.h:837
tesseract::OEM_TESSERACT_ONLY
@ OEM_TESSERACT_ONLY
Definition: publictypes.h:269
tesseract::Tesseract::noise_cert_punc
double noise_cert_punc
Definition: tesseractclass.h:868
tesseract::Tesseract::rej_use_tess_accepted
bool rej_use_tess_accepted
Definition: tesseractclass.h:1035
tesseract::Tesseract::superscript_debug
int superscript_debug
Definition: tesseractclass.h:974
tesseract::Tesseract::font_recognition_pass
void font_recognition_pass(PAGE_RES *page_res)
Definition: control.cpp:2037
tesseract::Tesseract::unrej_good_chs
void unrej_good_chs(WERD_RES *word, ROW *row)
Definition: docqual.cpp:132
tesseract::TesseractStats::last_char_was_tilde
bool last_char_was_tilde
Definition: tesseractclass.h:141
tesseract::Tesseract::tessedit_use_reject_spaces
bool tessedit_use_reject_spaces
Definition: tesseractclass.h:902
tesseract::Tesseract::enable_noise_removal
bool enable_noise_removal
Definition: tesseractclass.h:858
docqual.h
tesseract::Tesseract::PrepareForTessOCR
void PrepareForTessOCR(BLOCK_LIST *block_list, Tesseract *osd_tess, OSResults *osr)
Definition: tesseractclass.cpp:662
tesseract::Tesseract::tessedit_make_boxes_from_boxes
bool tessedit_make_boxes_from_boxes
Definition: tesseractclass.h:791
tesseract::Tesseract::textord_tabfind_force_vertical_text
bool textord_tabfind_force_vertical_text
Definition: tesseractclass.h:1070
tesseract::Tesseract::conflict_set_I_l_1
char * conflict_set_I_l_1
Definition: tesseractclass.h:1043
tesseract::Tesseract::tilde_crunch
void tilde_crunch(PAGE_RES_IT &page_res_it)
Definition: docqual.cpp:417
tesseract::Tesseract::non_O_upper
bool non_O_upper(const UNICHARSET &ch_set, UNICHAR_ID unichar_id)
Definition: reject.cpp:791
tesseract::Tesseract::word_blob_quality
int16_t word_blob_quality(WERD_RES *word, ROW *row)
Definition: docqual.cpp:77