tesseract  5.0.0-alpha-619-ge9db
pgedit.cpp
Go to the documentation of this file.
1 /**********************************************************************
2  * File: pgedit.cpp (Formerly pgeditor.c)
3  * Description: Page structure file editor
4  * Author: Phil Cheatle
5  *
6  *(C) Copyright 1991, Hewlett-Packard Ltd.
7  ** Licensed under the Apache License, Version 2.0(the "License");
8  ** you may not use this file except in compliance with the License.
9  ** You may obtain a copy of the License at
10  ** http:// www.apache.org/licenses/LICENSE-2.0
11  ** Unless required by applicable law or agreed to in writing, software
12  ** distributed under the License is distributed on an "AS IS" BASIS,
13  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ** See the License for the specific language governing permissions and
15  ** limitations under the License.
16  *
17  **********************************************************************/
18 
19 // Include automatically generated configuration file if running autoconf.
20 #ifdef HAVE_CONFIG_H
21 #include "config_auto.h"
22 #endif
23 
24 #include "pgedit.h"
25 
26 #include <cctype>
27 #include <cmath>
28 
29 #include "blread.h"
30 #include "control.h"
31 #include "paramsd.h"
32 #include "pageres.h"
33 #include "tordmain.h"
34 #include "scrollview.h"
35 #include "svmnode.h"
36 #include "statistc.h"
37 #include "tesseractclass.h"
38 #include "werdit.h"
39 
40 #ifndef GRAPHICS_DISABLED
41 #define ASC_HEIGHT (2 * kBlnBaselineOffset + kBlnXHeight)
42 #define X_HEIGHT (kBlnBaselineOffset + kBlnXHeight)
43 #define BL_HEIGHT kBlnBaselineOffset
44 #define DESC_HEIGHT 0
45 
47 {
78 };
79 
91 };
92 
93 /*
94  *
95  * Some global data
96  *
97  */
98 
99 static ScrollView* image_win;
100 static ParamsEditor* pe;
101 static bool stillRunning = false;
102 
103 static ScrollView* bln_word_window = nullptr; // baseline norm words
104 
105 static CMD_EVENTS mode = CHANGE_DISP_CMD_EVENT; // selected words op
106 
107 static bool recog_done = false; // recog_all_words was called
108 
109 // These variables should remain global, since they are only used for the
110 // debug mode (in which only a single Tesseract thread/instance will exist).
111 static BITS16 word_display_mode;
112 static ColorationMode color_mode = CM_RAINBOW;
113 static bool display_image = false;
114 static bool display_blocks = false;
115 static bool display_baselines = false;
116 
117 static PAGE_RES *current_page_res = nullptr;
118 
119 STRING_VAR(editor_image_win_name, "EditorImage",
120  "Editor image window name");
121 INT_VAR(editor_image_xpos, 590, "Editor image X Pos");
122 INT_VAR(editor_image_ypos, 10, "Editor image Y Pos");
123 static INT_VAR(editor_image_menuheight, 50, "Add to image height for menu bar");
125  "Word bounding box colour");
127  "Blob bounding box colour");
129  "Correct text colour");
130 
131 STRING_VAR(editor_dbwin_name, "EditorDBWin",
132  "Editor debug window name");
133 INT_VAR(editor_dbwin_xpos, 50, "Editor debug window X Pos");
134 INT_VAR(editor_dbwin_ypos, 500, "Editor debug window Y Pos");
135 INT_VAR(editor_dbwin_height, 24, "Editor debug window height");
136 INT_VAR(editor_dbwin_width, 80, "Editor debug window width");
137 
138 STRING_VAR(editor_word_name, "BlnWords", "BL normalized word window");
139 INT_VAR(editor_word_xpos, 60, "Word window X Pos");
140 INT_VAR(editor_word_ypos, 510, "Word window Y Pos");
141 INT_VAR(editor_word_height, 240, "Word window height");
142 INT_VAR(editor_word_width, 655, "Word window width");
143 
151 static void show_point(PAGE_RES* page_res, float x, float y) {
152  FCOORD pt(x, y);
153  PAGE_RES_IT pr_it(page_res);
154 
155  const int kBufsize = 512;
156  char msg[kBufsize];
157  char *msg_ptr = msg;
158 
159  msg_ptr += sprintf(msg_ptr, "Pt:(%0.3f, %0.3f) ", x, y);
160 
161  for (WERD_RES* word = pr_it.word(); word != nullptr; word = pr_it.forward()) {
162  if (pr_it.row() != pr_it.prev_row() &&
163  pr_it.row()->row->bounding_box().contains(pt)) {
164  msg_ptr += sprintf(msg_ptr, "BL(x)=%0.3f ",
165  pr_it.row()->row->base_line(x));
166  }
167  if (word->word->bounding_box().contains(pt)) {
168  TBOX box = word->word->bounding_box();
169  msg_ptr += sprintf(msg_ptr, "Wd(%d, %d)/(%d, %d) ",
170  box.left(), box.bottom(),
171  box.right(), box.top());
172  C_BLOB_IT cblob_it(word->word->cblob_list());
173  for (cblob_it.mark_cycle_pt();
174  !cblob_it.cycled_list();
175  cblob_it.forward()) {
176  C_BLOB* cblob = cblob_it.data();
177  box = cblob->bounding_box();
178  if (box.contains(pt)) {
179  msg_ptr += sprintf(msg_ptr,
180  "CBlb(%d, %d)/(%d, %d) ",
181  box.left(), box.bottom(),
182  box.right(), box.top());
183  }
184  }
185  }
186  }
187  image_win->AddMessage(msg);
188 }
189 
196 static void pgeditor_msg( // message display
197  const char *msg) {
198  image_win->AddMessage(msg);
199 }
200 
202  public:
203  void Notify(const SVEvent* sv_event) override {
204  if (sv_event->type == SVET_DESTROY)
205  bln_word_window = nullptr;
206  else if (sv_event->type == SVET_CLICK)
207  show_point(current_page_res, sv_event->x, sv_event->y);
208  }
209 };
210 
216 static ScrollView* bln_word_window_handle() { // return handle
217  // not opened yet
218  if (bln_word_window == nullptr) {
219  pgeditor_msg("Creating BLN word window...");
220  bln_word_window = new ScrollView(editor_word_name.c_str(),
222  editor_word_height, 4000, 4000, true);
223  auto* a = new BlnEventHandler();
224  bln_word_window->AddEventHandler(a);
225  pgeditor_msg("Creating BLN word window...Done");
226  }
227  return bln_word_window;
228 }
229 
237 static void build_image_window(int width, int height) {
238  delete image_win;
239  image_win = new ScrollView(editor_image_win_name.c_str(),
241  width + 1,
242  height + editor_image_menuheight + 1,
243  width,
244  height,
245  true);
246 }
247 
254 static void display_bln_lines(ScrollView* window, ScrollView::Color colour,
255  float scale_factor, float y_offset,
256  float minx, float maxx) {
257  window->Pen(colour);
258  window->Line(minx, y_offset + scale_factor * DESC_HEIGHT,
259  maxx, y_offset + scale_factor * DESC_HEIGHT);
260  window->Line(minx, y_offset + scale_factor * BL_HEIGHT,
261  maxx, y_offset + scale_factor * BL_HEIGHT);
262  window->Line(minx, y_offset + scale_factor * X_HEIGHT,
263  maxx, y_offset + scale_factor * X_HEIGHT);
264  window->Line(minx, y_offset + scale_factor * ASC_HEIGHT,
265  maxx, y_offset + scale_factor * ASC_HEIGHT);
266 }
267 
276 void PGEventHandler::Notify(const SVEvent* event) {
277  char myval = '0';
278  if (event->type == SVET_POPUP) {
279  pe->Notify(event);
280  } // These are handled by ParamsEditor
281  else if (event->type == SVET_EXIT) { stillRunning = false; }
282  else if (event->type == SVET_MENU) {
283  if (strcmp(event->parameter, "true") == 0) { myval = 'T'; }
284  else if (strcmp(event->parameter, "false") == 0) { myval = 'F'; }
285  tess_->process_cmd_win_event(event->command_id, &myval);
286  }
287  else {
288  tess_->process_image_event(*event);
289  }
290 }
291 
297 namespace tesseract {
299  SVMenuNode* parent_menu;
300  auto* root_menu_item = new SVMenuNode();
301 
302  SVMenuNode* modes_menu_item = root_menu_item->AddChild("MODES");
303 
304  modes_menu_item->AddChild("Change Display", CHANGE_DISP_CMD_EVENT);
305  modes_menu_item->AddChild("Dump Word", DUMP_WERD_CMD_EVENT);
306  modes_menu_item->AddChild("Show Point", SHOW_POINT_CMD_EVENT);
307  modes_menu_item->AddChild("Show BL Norm Word", SHOW_BLN_WERD_CMD_EVENT);
308  modes_menu_item->AddChild("Config Words", DEBUG_WERD_CMD_EVENT);
309  modes_menu_item->AddChild("Recog Words", RECOG_WERDS);
310  modes_menu_item->AddChild("Recog Blobs", RECOG_PSEUDO);
311  modes_menu_item->AddChild("Show Blob Features", SHOW_BLOB_FEATURES);
312 
313  parent_menu = root_menu_item->AddChild("DISPLAY");
314 
315  parent_menu->AddChild("Blamer", BLAMER_CMD_EVENT, false);
316  parent_menu->AddChild("Bounding Boxes", BOUNDING_BOX_CMD_EVENT, false);
317  parent_menu->AddChild("Correct Text", CORRECT_TEXT_CMD_EVENT, false);
318  parent_menu->AddChild("Polygonal Approx", POLYGONAL_CMD_EVENT, false);
319  parent_menu->AddChild("Baseline Normalized", BL_NORM_CMD_EVENT, false);
320  parent_menu->AddChild("Edge Steps", BITMAP_CMD_EVENT, true);
321  parent_menu->AddChild("Subscripts", SHOW_SUBSCRIPT_CMD_EVENT);
322  parent_menu->AddChild("Superscripts", SHOW_SUPERSCRIPT_CMD_EVENT);
323  parent_menu->AddChild("Italics", SHOW_ITALIC_CMD_EVENT);
324  parent_menu->AddChild("Bold", SHOW_BOLD_CMD_EVENT);
325  parent_menu->AddChild("Underline", SHOW_UNDERLINE_CMD_EVENT);
326  parent_menu->AddChild("FixedPitch", SHOW_FIXEDPITCH_CMD_EVENT);
327  parent_menu->AddChild("Serifs", SHOW_SERIF_CMD_EVENT);
328  parent_menu->AddChild("SmallCaps", SHOW_SMALLCAPS_CMD_EVENT);
329  parent_menu->AddChild("DropCaps", SHOW_DROPCAPS_CMD_EVENT);
330 
331 
332  parent_menu = root_menu_item->AddChild("OTHER");
333 
334  parent_menu->AddChild("Quit", QUIT_CMD_EVENT);
335  parent_menu->AddChild("Show Image", IMAGE_CMD_EVENT, false);
336  parent_menu->AddChild("ShowBlock Outlines", BLOCKS_CMD_EVENT, false);
337  parent_menu->AddChild("Show Baselines", BASELINES_CMD_EVENT, false);
338  parent_menu->AddChild("Uniform Display", UNIFORM_DISP_CMD_EVENT);
339  parent_menu->AddChild("Refresh Display", REFRESH_CMD_EVENT);
340 
341  return root_menu_item;
342 }
343 
350  bool (tesseract::Tesseract::* word_painter)(PAGE_RES_IT* pr_it)) {
351  int block_count = 1;
352 
353  image_win->Clear();
354  if (display_image) {
355  image_win->Image(pix_binary_, 0, 0);
356  }
357 
358  image_win->Brush(ScrollView::NONE);
359  PAGE_RES_IT pr_it(current_page_res);
360  for (WERD_RES* word = pr_it.word(); word != nullptr; word = pr_it.forward()) {
361  (this->*word_painter)(&pr_it);
362  if (display_baselines && pr_it.row() != pr_it.prev_row())
363  pr_it.row()->row->plot_baseline(image_win, ScrollView::GREEN);
364  if (display_blocks && pr_it.block() != pr_it.prev_block())
365  pr_it.block()->block->pdblk.plot(image_win, block_count++, ScrollView::RED);
366  }
367  image_win->Update();
368 }
369 
378 void Tesseract::pgeditor_main(int width, int height, PAGE_RES *page_res) {
379  current_page_res = page_res;
380  if (current_page_res->block_res_list.empty())
381  return;
382 
383  recog_done = false;
384  stillRunning = true;
385 
386  build_image_window(width, height);
387  word_display_mode.turn_on_bit(DF_EDGE_STEP);
389 #ifndef GRAPHICS_DISABLED
390  pe = new ParamsEditor(this, image_win);
391 #endif
392  PGEventHandler pgEventHandler(this);
393 
394  image_win->AddEventHandler(&pgEventHandler);
395  image_win->AddMessageBox();
396 
397  SVMenuNode* svMenuRoot = build_menu_new();
398 
399  svMenuRoot->BuildMenu(image_win);
400  image_win->SetVisible(true);
401 
402  image_win->AwaitEvent(SVET_DESTROY);
403  image_win->AddEventHandler(nullptr);
404 }
405 } // namespace tesseract
406 
414 namespace tesseract {
415 bool Tesseract::process_cmd_win_event( // UI command semantics
416  int32_t cmd_event, // which menu item?
417  char* new_value // any prompt data
418 ) {
419  char msg[160];
420  bool exit = false;
421 
422  color_mode = CM_RAINBOW;
423 
424  // Run recognition on the full page if needed.
425  switch (cmd_event) {
426  case BLAMER_CMD_EVENT:
430  case SHOW_BOLD_CMD_EVENT:
436  if (!recog_done) {
437  recog_all_words(current_page_res, nullptr, nullptr, nullptr, 0);
438  recog_done = true;
439  }
440  break;
441  default:
442  break;
443  }
444 
445  char* parameter;
446 
447  switch (cmd_event) {
448  case NULL_CMD_EVENT:
449  break;
450 
452  case DUMP_WERD_CMD_EVENT:
455  case RECOG_WERDS:
456  case RECOG_PSEUDO:
457  case SHOW_BLOB_FEATURES:
458  mode =static_cast<CMD_EVENTS>(cmd_event);
459  break;
461  mode = DEBUG_WERD_CMD_EVENT;
462  parameter = image_win->ShowInputDialog("Config File Name");
463  word_config_ = parameter;
464  delete[] parameter;
465  break;
467  if (new_value[0] == 'T')
468  word_display_mode.turn_on_bit(DF_BOX);
469  else
470  word_display_mode.turn_off_bit(DF_BOX);
471  mode = CHANGE_DISP_CMD_EVENT;
472  break;
473  case BLAMER_CMD_EVENT:
474  if (new_value[0] == 'T')
475  word_display_mode.turn_on_bit(DF_BLAMER);
476  else
477  word_display_mode.turn_off_bit(DF_BLAMER);
479  mode = CHANGE_DISP_CMD_EVENT;
480  break;
482  if (new_value[0] == 'T')
483  word_display_mode.turn_on_bit(DF_TEXT);
484  else
485  word_display_mode.turn_off_bit(DF_TEXT);
486  mode = CHANGE_DISP_CMD_EVENT;
487  break;
488  case POLYGONAL_CMD_EVENT:
489  if (new_value[0] == 'T')
490  word_display_mode.turn_on_bit(DF_POLYGONAL);
491  else
492  word_display_mode.turn_off_bit(DF_POLYGONAL);
493  mode = CHANGE_DISP_CMD_EVENT;
494  break;
495  case BL_NORM_CMD_EVENT:
496  if (new_value[0] == 'T')
497  word_display_mode.turn_on_bit(DF_BN_POLYGONAL);
498  else
499  word_display_mode.turn_off_bit(DF_BN_POLYGONAL);
500  mode = CHANGE_DISP_CMD_EVENT;
501  break;
502  case BITMAP_CMD_EVENT:
503  if (new_value[0] == 'T')
504  word_display_mode.turn_on_bit(DF_EDGE_STEP);
505  else
506  word_display_mode.turn_off_bit(DF_EDGE_STEP);
507  mode = CHANGE_DISP_CMD_EVENT;
508  break;
511  break;
512  case IMAGE_CMD_EVENT:
513  display_image =(new_value[0] == 'T');
515  break;
516  case BLOCKS_CMD_EVENT:
517  display_blocks =(new_value[0] == 'T');
519  break;
520  case BASELINES_CMD_EVENT:
521  display_baselines =(new_value[0] == 'T');
523  break;
525  color_mode = CM_SUBSCRIPT;
527  break;
529  color_mode = CM_SUPERSCRIPT;
531  break;
533  color_mode = CM_ITALIC;
535  break;
536  case SHOW_BOLD_CMD_EVENT:
537  color_mode = CM_BOLD;
539  break;
541  color_mode = CM_UNDERLINE;
543  break;
545  color_mode = CM_FIXEDPITCH;
547  break;
549  color_mode = CM_SERIF;
551  break;
553  color_mode = CM_SMALLCAPS;
555  break;
557  color_mode = CM_DROPCAPS;
559  break;
560  case REFRESH_CMD_EVENT:
562  break;
563  case QUIT_CMD_EVENT:
564  exit = true;
566  break;
567 
568  default:
569  snprintf(msg, sizeof(msg), "Unrecognised event %" PRId32 "(%s)",
570  cmd_event, new_value);
571  image_win->AddMessage(msg);
572  break;
573  }
574  return exit;
575 }
576 
577 
587 void Tesseract::process_image_event( // action in image win
588  const SVEvent &event) {
589  // The following variable should remain static, since it is used by
590  // debug editor, which uses a single Tesseract instance.
591  static ICOORD down;
592  ICOORD up;
593  TBOX selection_box;
594  char msg[80];
595 
596  switch(event.type) {
597 
598  case SVET_SELECTION:
599  if (event.type == SVET_SELECTION) {
600  down.set_x(event.x + event.x_size);
601  down.set_y(event.y + event.y_size);
602  if (mode == SHOW_POINT_CMD_EVENT)
603  show_point(current_page_res, event.x, event.y);
604  }
605 
606  up.set_x(event.x);
607  up.set_y(event.y);
608 
609  selection_box = TBOX(down, up);
610 
611  switch(mode) {
614  current_page_res,
615  selection_box,
617  break;
618  case DUMP_WERD_CMD_EVENT:
619  process_selected_words(current_page_res,
620  selection_box,
622  break;
624  process_selected_words(current_page_res,
625  selection_box,
627  break;
629  debug_word(current_page_res, selection_box);
630  break;
632  break; // ignore up event
633 
634  case RECOG_WERDS:
635  #ifndef DISABLED_LEGACY_ENGINE
636  image_win->AddMessage("Recogging selected words");
637  this->process_selected_words(current_page_res,
638  selection_box,
640  #endif // ndef DISABLED_LEGACY_ENGINE
641  break;
642  case RECOG_PSEUDO:
643  image_win->AddMessage("Recogging selected blobs");
644  recog_pseudo_word(current_page_res, selection_box);
645  break;
646  case SHOW_BLOB_FEATURES:
647  blob_feature_display(current_page_res, selection_box);
648  break;
649 
650  default:
651  sprintf(msg, "Mode %d not yet implemented", mode);
652  image_win->AddMessage(msg);
653  break;
654  }
655  default:
656  break;
657  }
658 }
659 
665 void Tesseract::debug_word(PAGE_RES* page_res, const TBOX &selection_box) {
666 #ifndef DISABLED_LEGACY_ENGINE
668 #endif
669  recog_all_words(page_res, nullptr, &selection_box, word_config_.c_str(), 0);
670 }
671 } // namespace tesseract
672 
673 
674 /**********************************************************************
675  * WERD PROCESSOR FUNCTIONS
676  * ========================
677  *
678  * These routines are invoked by one or more of:
679  * process_all_words()
680  * process_selected_words()
681  * or
682  * process_all_words_it()
683  * process_selected_words_it()
684  * for each word to be processed
685  **********************************************************************/
686 
693 #endif // GRAPHICS_DISABLED
694 namespace tesseract {
695 #ifndef GRAPHICS_DISABLED
697  pr_it->word()->word->bounding_box().plot(image_win, ScrollView::BLACK,
699  return word_set_display(pr_it);
700 }
701 
702 
709  WERD_RES* word_res = pr_it->word();
710  if (word_res->chopped_word == nullptr) {
711  // Setup word normalization parameters.
712  word_res->SetupForRecognition(unicharset, this, BestPix(),
713  tessedit_ocr_engine_mode, nullptr,
717  pr_it->row()->row, pr_it->block()->block);
718  }
719  bln_word_window_handle()->Clear();
720  display_bln_lines(bln_word_window_handle(), ScrollView::CYAN,
721  1.0, 0.0f, -1000.0f, 1000.0f);
722  C_BLOB_IT it(word_res->word->cblob_list());
724  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
725  it.data()->plot_normed(word_res->denorm, color, ScrollView::BROWN,
726  bln_word_window_handle());
727  color = WERD::NextColor(color);
728  }
729  bln_word_window_handle()->Update();
730  return true;
731 }
732 
733 
734 
741  WERD_RES* word_res = pr_it->word();
742  WERD* word = word_res->word;
743  TBOX word_bb; // word bounding box
744  int word_height; // ht of word BB
745  bool displayed_something = false;
746  float shift; // from bot left
747 
748  if (color_mode != CM_RAINBOW && word_res->box_word != nullptr) {
749  #ifndef DISABLED_LEGACY_ENGINE
750  BoxWord* box_word = word_res->box_word;
751  WERD_CHOICE* best_choice = word_res->best_choice;
752  int length = box_word->length();
753  if (word_res->fontinfo == nullptr) return false;
754  const FontInfo& font_info = *word_res->fontinfo;
755  for (int i = 0; i < length; ++i) {
757  switch (color_mode) {
758  case CM_SUBSCRIPT:
759  if (best_choice->BlobPosition(i) == SP_SUBSCRIPT)
760  color = ScrollView::RED;
761  break;
762  case CM_SUPERSCRIPT:
763  if (best_choice->BlobPosition(i) == SP_SUPERSCRIPT)
764  color = ScrollView::RED;
765  break;
766  case CM_ITALIC:
767  if (font_info.is_italic())
768  color = ScrollView::RED;
769  break;
770  case CM_BOLD:
771  if (font_info.is_bold())
772  color = ScrollView::RED;
773  break;
774  case CM_FIXEDPITCH:
775  if (font_info.is_fixed_pitch())
776  color = ScrollView::RED;
777  break;
778  case CM_SERIF:
779  if (font_info.is_serif())
780  color = ScrollView::RED;
781  break;
782  case CM_SMALLCAPS:
783  if (word_res->small_caps)
784  color = ScrollView::RED;
785  break;
786  case CM_DROPCAPS:
787  if (best_choice->BlobPosition(i) == SP_DROPCAP)
788  color = ScrollView::RED;
789  break;
790  // TODO(rays) underline is currently completely unsupported.
791  case CM_UNDERLINE:
792  default:
793  break;
794  }
795  image_win->Pen(color);
796  TBOX box = box_word->BlobBox(i);
797  image_win->Rectangle(box.left(), box.bottom(), box.right(), box.top());
798  }
799  return true;
800  #else
801  return false;
802  #endif // ndef DISABLED_LEGACY_ENGINE
803  }
804  /*
805  Note the double coercions of(COLOUR)((int32_t)editor_image_word_bb_color)
806  etc. are to keep the compiler happy.
807  */
808  // display bounding box
809  if (word->display_flag(DF_BOX)) {
810  word->bounding_box().plot(image_win,
811  static_cast<ScrollView::Color>((int32_t)
813  static_cast<ScrollView::Color>((int32_t)
815 
816  auto c = static_cast<ScrollView::Color>((int32_t) editor_image_blob_bb_color);
817  image_win->Pen(c);
818  // cblob iterator
819  C_BLOB_IT c_it(word->cblob_list());
820  for (c_it.mark_cycle_pt(); !c_it.cycled_list(); c_it.forward())
821  c_it.data()->bounding_box().plot(image_win);
822  displayed_something = true;
823  }
824 
825  // display edge steps
826  if (word->display_flag(DF_EDGE_STEP)) { // edgesteps available
827  word->plot(image_win); // rainbow colors
828  displayed_something = true;
829  }
830 
831  // display poly approx
832  if (word->display_flag(DF_POLYGONAL)) {
833  // need to convert
835  tword->plot(image_win);
836  delete tword;
837  displayed_something = true;
838  }
839 
840  // Display correct text and blamer information.
841  STRING text;
842  STRING blame;
843  if (word->display_flag(DF_TEXT) && word->text() != nullptr) {
844  text = word->text();
845  }
846  if (word->display_flag(DF_BLAMER) &&
847  !(word_res->blamer_bundle != nullptr &&
849  text = "";
850  const BlamerBundle *blamer_bundle = word_res->blamer_bundle;
851  if (blamer_bundle == nullptr) {
852  text += "NULL";
853  } else {
854  text = blamer_bundle->TruthString();
855  }
856  text += " -> ";
857  STRING best_choice_str;
858  if (word_res->best_choice == nullptr) {
859  best_choice_str = "NULL";
860  } else {
861  word_res->best_choice->string_and_lengths(&best_choice_str, nullptr);
862  }
863  text += best_choice_str;
864  IncorrectResultReason reason = (blamer_bundle == nullptr) ?
865  IRR_PAGE_LAYOUT : blamer_bundle->incorrect_result_reason();
866  ASSERT_HOST(reason < IRR_NUM_REASONS);
867  blame += " [";
868  blame += BlamerBundle::IncorrectReasonName(reason);
869  blame += "]";
870  }
871  if (text.length() > 0) {
872  word_bb = word->bounding_box();
873  image_win->Pen(ScrollView::RED);
874  word_height = word_bb.height();
875  int text_height = 0.50 * word_height;
876  if (text_height > 20) text_height = 20;
877  image_win->TextAttributes("Arial", text_height, false, false, false);
878  shift = (word_height < word_bb.width()) ? 0.25 * word_height : 0.0f;
879  image_win->Text(word_bb.left() + shift,
880  word_bb.bottom() + 0.25 * word_height, text.c_str());
881  if (blame.length() > 0) {
882  image_win->Text(word_bb.left() + shift,
883  word_bb.bottom() + 0.25 * word_height - text_height,
884  blame.c_str());
885  }
886 
887  displayed_something = true;
888  }
889 
890  if (!displayed_something) // display BBox anyway
891  word->bounding_box().plot(image_win,
892  static_cast<ScrollView::Color>((int32_t) editor_image_word_bb_color),
893  static_cast<ScrollView::Color>((int32_t)
895  return true;
896 }
897 #endif // GRAPHICS_DISABLED
898 
904 bool Tesseract::word_dumper(PAGE_RES_IT* pr_it) {
905  if (pr_it->block()->block != nullptr) {
906  tprintf("\nBlock data...\n");
907  pr_it->block()->block->print(nullptr, false);
908  }
909  tprintf("\nRow data...\n");
910  pr_it->row()->row->print(nullptr);
911  tprintf("\nWord data...\n");
912  WERD_RES* word_res = pr_it->word();
913  word_res->word->print();
914  if (word_res->blamer_bundle != nullptr && wordrec_debug_blamer &&
916  tprintf("Current blamer debug: %s\n",
917  word_res->blamer_bundle->debug().c_str());
918  }
919  return true;
920 }
921 
922 #ifndef GRAPHICS_DISABLED
923 
929  WERD* word = pr_it->word()->word;
930  word->set_display_flag(DF_BOX, word_display_mode.bit(DF_BOX));
931  word->set_display_flag(DF_TEXT, word_display_mode.bit(DF_TEXT));
932  word->set_display_flag(DF_POLYGONAL, word_display_mode.bit(DF_POLYGONAL));
933  word->set_display_flag(DF_EDGE_STEP, word_display_mode.bit(DF_EDGE_STEP));
935  word_display_mode.bit(DF_BN_POLYGONAL));
936  word->set_display_flag(DF_BLAMER, word_display_mode.bit(DF_BLAMER));
937  return word_display(pr_it);
938 }
939 
940 
941 // page_res is non-const because the iterator doesn't know if you are going
942 // to change the items it points to! Really a const here though.
944  const TBOX& selection_box) {
945 #ifndef DISABLED_LEGACY_ENGINE
946  PAGE_RES_IT* it = make_pseudo_word(page_res, selection_box);
947  if (it != nullptr) {
948  WERD_RES* word_res = it->word();
949  word_res->x_height = it->row()->row->x_height();
950  word_res->SetupForRecognition(unicharset, this, BestPix(),
951  tessedit_ocr_engine_mode, nullptr,
955  it->row()->row, it->block()->block);
956  TWERD* bln_word = word_res->chopped_word;
957  TBLOB* bln_blob = bln_word->blobs[0];
958  INT_FX_RESULT_STRUCT fx_info;
961  Classify::ExtractFeatures(*bln_blob, classify_nonlinear_norm, &bl_features,
962  &cn_features, &fx_info, nullptr);
963  // Display baseline features.
964  ScrollView* bl_win = CreateFeatureSpaceWindow("BL Features", 512, 0);
966  for (int f = 0; f < bl_features.size(); ++f)
967  RenderIntFeature(bl_win, &bl_features[f], ScrollView::GREEN);
968  bl_win->Update();
969  // Display cn features.
970  ScrollView* cn_win = CreateFeatureSpaceWindow("CN Features", 512, 0);
972  for (int f = 0; f < cn_features.size(); ++f)
973  RenderIntFeature(cn_win, &cn_features[f], ScrollView::GREEN);
974  cn_win->Update();
975 
976  it->DeleteCurrentWord();
977  delete it;
978  }
979 #endif // ndef DISABLED_LEGACY_ENGINE
980 }
981 
982 
983 #endif // GRAPHICS_DISABLED
984 
985 } // namespace tesseract
CM_ITALIC
Definition: pgedit.cpp:84
TBOX
Definition: cleanapi_test.cc:19
BLOCKS_CMD_EVENT
Definition: pgedit.cpp:61
SHOW_BOLD_CMD_EVENT
Definition: pgedit.cpp:72
ScrollView
Definition: scrollview.h:97
SHOW_FIXEDPITCH_CMD_EVENT
Definition: pgedit.cpp:74
SHOW_UNDERLINE_CMD_EVENT
Definition: pgedit.cpp:73
INT_VAR
#define INT_VAR(name, val, comment)
Definition: params.h:300
ScrollView::Brush
void Brush(Color color)
Definition: scrollview.cpp:723
ICOORD::set_x
void set_x(int16_t xin)
rewrite function
Definition: points.h:60
tesseract::Tesseract::poly_allow_detailed_fx
bool poly_allow_detailed_fx
Definition: tesseractclass.h:1061
BlnEventHandler::Notify
void Notify(const SVEvent *sv_event) override
Definition: pgedit.cpp:203
SVET_DESTROY
Definition: scrollview.h:45
BlamerBundle::TruthString
STRING TruthString() const
Definition: blamer.h:115
C_BLOB::bounding_box
TBOX bounding_box() const
Definition: stepblob.cpp:247
PAGE_RES_IT::forward
WERD_RES * forward()
Definition: pageres.h:728
SVEvent::y_size
int y_size
Definition: scrollview.h:69
WERD_RES::box_word
tesseract::BoxWord * box_word
Definition: pageres.h:266
werdit.h
tesseract::Tesseract::recog_pseudo_word
void recog_pseudo_word(PAGE_RES *page_res, TBOX &selection_box)
Definition: control.cpp:62
BITS16::turn_on_bit
void turn_on_bit(uint8_t bit_num)
Definition: bits16.h:46
pageres.h
editor_dbwin_name
char * editor_dbwin_name
Definition: pgedit.cpp:132
editor_word_height
int editor_word_height
Definition: pgedit.cpp:141
ScrollView::AddMessage
void AddMessage(const char *format,...)
Definition: scrollview.cpp:560
SVET_CLICK
Definition: scrollview.h:47
BITS16::bit
bool bit(uint8_t bit_num) const
Definition: bits16.h:65
SHOW_SMALLCAPS_CMD_EVENT
Definition: pgedit.cpp:76
editor_dbwin_ypos
int editor_dbwin_ypos
Definition: pgedit.cpp:134
editor_image_blob_bb_color
int editor_image_blob_bb_color
Definition: pgedit.cpp:127
tesseract::Tesseract::textord_use_cjk_fp_model
bool textord_use_cjk_fp_model
Definition: tesseractclass.h:1059
CM_SERIF
Definition: pgedit.cpp:88
ASC_HEIGHT
#define ASC_HEIGHT
Definition: pgedit.cpp:41
ScrollView::SetVisible
void SetVisible(bool visible)
Definition: scrollview.cpp:548
WERD::NextColor
static ScrollView::Color NextColor(ScrollView::Color colour)
Definition: werd.cpp:291
PGEventHandler::Notify
void Notify(const SVEvent *sve) override
Definition: pgedit.cpp:276
ColorationMode
ColorationMode
Definition: pgedit.cpp:80
WERD_CHOICE
Definition: ratngs.h:261
ScrollView::AddMessageBox
void AddMessageBox()
Definition: scrollview.cpp:577
TWERD
Definition: blobs.h:416
POLYGONAL_CMD_EVENT
Definition: pgedit.cpp:57
tesseractclass.h
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:87
editor_image_ypos
int editor_image_ypos
Definition: pgedit.cpp:122
SVET_POPUP
Definition: scrollview.h:53
blread.h
WERD::bounding_box
TBOX bounding_box() const
Definition: werd.cpp:147
RECOG_WERDS
Definition: pgedit.cpp:66
SVMenuNode::AddChild
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:58
baseline
Definition: mfoutline.h:62
INT_FX_RESULT_STRUCT
Definition: intfx.h:34
WERD_RES::denorm
DENORM denorm
Definition: pageres.h:195
control.h
DF_TEXT
Correct ascii.
Definition: werd.h:46
SVEventHandler
Definition: scrollview.h:81
DUMP_WERD_CMD_EVENT
Definition: pgedit.cpp:50
WERD::display_flag
bool display_flag(uint8_t flag) const
Definition: werd.h:119
tesseract::Tesseract::debug_word
void debug_word(PAGE_RES *page_res, const TBOX &selection_box)
Definition: pgedit.cpp:665
WERD::plot
void plot(ScrollView *window, ScrollView::Color colour)
Definition: werd.cpp:282
PAGE_RES_IT::block
BLOCK_RES * block() const
Definition: pageres.h:754
SVET_EXIT
Definition: scrollview.h:46
PAGE_RES_IT::row
ROW_RES * row() const
Definition: pageres.h:751
ICOORD
integer coordinate
Definition: points.h:30
tesseract::Tesseract
Definition: tesseractclass.h:172
CM_RAINBOW
Definition: pgedit.cpp:81
tesseract::RECOG_WERDS
Definition: tessedit.cpp:488
RECOG_PSEUDO
Definition: pgedit.cpp:67
TBOX::top
int16_t top() const
Definition: rect.h:57
TBOX::contains
bool contains(const FCOORD pt) const
Definition: rect.h:330
tesseract::Tesseract::recog_interactive
bool recog_interactive(PAGE_RES_IT *pr_it)
Definition: control.cpp:77
BlnEventHandler
Definition: pgedit.cpp:201
tesseract::FontInfo::is_italic
bool is_italic() const
Definition: fontinfo.h:111
STRING
Definition: strngs.h:45
WERD_RES::x_height
float x_height
Definition: pageres.h:310
ScrollView::Clear
void Clear()
Definition: scrollview.cpp:588
SHOW_ITALIC_CMD_EVENT
Definition: pgedit.cpp:71
SHOW_BLOB_FEATURES
Definition: pgedit.cpp:68
tesseract::Classify::ExtractFeatures
static void ExtractFeatures(const TBLOB &blob, bool nonlinear_norm, GenericVector< INT_FEATURE_STRUCT > *bl_features, GenericVector< INT_FEATURE_STRUCT > *cn_features, INT_FX_RESULT_STRUCT *results, GenericVector< int > *outline_cn_counts)
Definition: intfx.cpp:440
BITS16
Definition: bits16.h:24
SHOW_SERIF_CMD_EVENT
Definition: pgedit.cpp:75
ScrollView::BROWN
Definition: scrollview.h:120
tesseract::RECOG_PSEUDO
Definition: tessedit.cpp:489
WERD_RES::fontinfo
const FontInfo * fontinfo
Definition: pageres.h:303
WERD_RES
Definition: pageres.h:160
ScrollView::CYAN
Definition: scrollview.h:107
ScrollView::NONE
Definition: scrollview.h:101
STRING_VAR
#define STRING_VAR(name, val, comment)
Definition: params.h:306
ScrollView::Pen
void Pen(Color color)
Definition: scrollview.cpp:717
CMD_EVENTS
CMD_EVENTS
Definition: pgedit.cpp:46
ScrollView::Image
void Image(struct Pix *image, int x_pos, int y_pos)
Definition: scrollview.cpp:763
SHOW_DROPCAPS_CMD_EVENT
Definition: pgedit.cpp:77
PAGE_RES_IT::prev_row
ROW_RES * prev_row() const
Definition: pageres.h:742
IncorrectResultReason
IncorrectResultReason
Definition: blamer.h:52
BL_NORM_CMD_EVENT
Definition: pgedit.cpp:58
ROW::print
void print(FILE *fp)
Definition: ocrrow.cpp:160
WERD::set_display_flag
void set_display_flag(uint8_t flag, bool value)
Definition: werd.h:120
WERD_CHOICE::BlobPosition
tesseract::ScriptPos BlobPosition(int index) const
Definition: ratngs.h:310
FCOORD
Definition: points.h:187
SHOW_SUBSCRIPT_CMD_EVENT
Definition: pgedit.cpp:69
CM_BOLD
Definition: pgedit.cpp:85
SHOW_POINT_CMD_EVENT
Definition: pgedit.cpp:51
ScrollView::BLUE
Definition: scrollview.h:108
ICOORD::set_y
void set_y(int16_t yin)
rewrite function
Definition: points.h:64
PAGE_RES::block_res_list
BLOCK_RES_LIST block_res_list
Definition: pageres.h:78
C_BLOB
Definition: stepblob.h:36
tesseract::CCUtil::unicharset
UNICHARSET unicharset
Definition: ccutil.h:57
editor_word_width
int editor_word_width
Definition: pgedit.cpp:142
TBOX::height
int16_t height() const
Definition: rect.h:107
tesseract::Tesseract::BestPix
Pix * BestPix() const
Definition: tesseractclass.h:231
tesseract::Tesseract::pgeditor_main
void pgeditor_main(int width, int height, PAGE_RES *page_res)
Definition: pgedit.cpp:378
SVEvent::y
int y
Definition: scrollview.h:67
QUIT_CMD_EVENT
Definition: pgedit.cpp:65
WERD::cblob_list
C_BLOB_LIST * cblob_list()
Definition: werd.h:94
WERD_RES::blamer_bundle
BlamerBundle * blamer_bundle
Definition: pageres.h:246
tesseract::SP_SUBSCRIPT
Definition: ratngs.h:252
CM_SUPERSCRIPT
Definition: pgedit.cpp:83
ParamsEditor::Notify
void Notify(const SVEvent *sve) override
Definition: paramsd.cpp:271
statistc.h
BlamerBundle::IncorrectReasonName
static const char * IncorrectReasonName(IncorrectResultReason irr)
Definition: blamer.cpp:62
WERD_CHOICE::string_and_lengths
void string_and_lengths(STRING *word_str, STRING *word_lengths_str) const
Definition: ratngs.cpp:451
tesseract::Tesseract::build_menu_new
SVMenuNode * build_menu_new()
Definition: pgedit.cpp:298
WERD::print
void print()
Definition: werd.cpp:252
BLOCK::print
void print(FILE *fp, bool dump)
dump whole table
Definition: ocrblock.cpp:189
svmnode.h
BLAMER_CMD_EVENT
Definition: pgedit.cpp:54
BLOCK::pdblk
PDBLK pdblk
Page Description Block.
Definition: ocrblock.h:189
ScrollView::BLACK
Definition: scrollview.h:102
CHANGE_DISP_CMD_EVENT
Definition: pgedit.cpp:49
SVEvent::parameter
char * parameter
Definition: scrollview.h:65
tesseract::Tesseract::word_bln_display
bool word_bln_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:717
ROW::x_height
float x_height() const
Definition: ocrrow.h:63
BITMAP_CMD_EVENT
Definition: pgedit.cpp:59
CORRECT_TEXT_CMD_EVENT
Definition: pgedit.cpp:56
tesseract::BoxWord::BlobBox
const TBOX & BlobBox(int index) const
Definition: boxword.h:83
WERD_RES::best_choice
WERD_CHOICE * best_choice
Definition: pageres.h:235
WERD_RES::SetupForRecognition
bool SetupForRecognition(const UNICHARSET &unicharset_in, tesseract::Tesseract *tesseract, Pix *pix, int norm_mode, const TBOX *norm_box, bool numeric_mode, bool use_body_size, bool allow_detailed_fx, ROW *row, const BLOCK *block)
Definition: pageres.cpp:298
STRING::c_str
const char * c_str() const
Definition: strngs.cpp:192
ROW::plot_baseline
void plot_baseline(ScrollView *window, ScrollView::Color colour)
Definition: ocrrow.h:136
BITS16::turn_off_bit
void turn_off_bit(uint8_t bit_num)
Definition: bits16.h:51
ROW_RES::row
ROW * row
Definition: pageres.h:136
ScrollView::Exit
static void Exit()
Definition: scrollview.cpp:582
tesseract::Classify::classify_nonlinear_norm
bool classify_nonlinear_norm
Definition: classify.h:452
editor_word_name
char * editor_word_name
Definition: pgedit.cpp:138
DF_BLAMER
Blamer information.
Definition: werd.h:50
editor_dbwin_width
int editor_dbwin_width
Definition: pgedit.cpp:136
PAGE_RES_IT::prev_block
BLOCK_RES * prev_block() const
Definition: pageres.h:745
TWERD::blobs
GenericVector< TBLOB * > blobs
Definition: blobs.h:457
editor_word_xpos
int editor_word_xpos
Definition: pgedit.cpp:139
ParamsEditor
Definition: paramsd.h:99
PAGE_RES_IT::DeleteCurrentWord
void DeleteCurrentWord()
Definition: pageres.cpp:1436
DF_EDGE_STEP
Edge steps.
Definition: werd.h:48
TBOX::width
int16_t width() const
Definition: rect.h:114
CM_SMALLCAPS
Definition: pgedit.cpp:89
TWERD::PolygonalCopy
static TWERD * PolygonalCopy(bool allow_detailed_fx, WERD *src)
Definition: blobs.cpp:774
ScrollView::YELLOW
Definition: scrollview.h:105
TBOX::bottom
int16_t bottom() const
Definition: rect.h:64
tesseract::Tesseract::do_re_display
void do_re_display(bool(tesseract::Tesseract::*word_painter)(PAGE_RES_IT *pr_it))
Definition: pgedit.cpp:349
CreateFeatureSpaceWindow
ScrollView * CreateFeatureSpaceWindow(const char *name, int xpos, int ypos)
Definition: intproto.cpp:1764
ScrollView::WHITE
Definition: scrollview.h:103
make_pseudo_word
PAGE_RES_IT * make_pseudo_word(PAGE_RES *page_res, const TBOX &selection_box)
Definition: werdit.cpp:33
character
Definition: mfoutline.h:62
WERD_RES::chopped_word
TWERD * chopped_word
Definition: pageres.h:206
BL_HEIGHT
#define BL_HEIGHT
Definition: pgedit.cpp:43
IRR_CORRECT
Definition: blamer.h:54
tesseract
Definition: baseapi.h:65
tesseract::Tesseract::process_cmd_win_event
bool process_cmd_win_event(int32_t cmd_event, char *new_value)
Definition: pgedit.cpp:415
PAGE_RES_IT::word
WERD_RES * word() const
Definition: pageres.h:748
tesseract::FontInfo::is_fixed_pitch
bool is_fixed_pitch() const
Definition: fontinfo.h:113
PAGE_RES
Definition: pageres.h:73
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:45
SVEvent::type
SVEventType type
Definition: scrollview.h:63
TBOX::plot
void plot(ScrollView *fd) const
Definition: rect.h:285
ScrollView::RED
Definition: scrollview.h:104
editor_dbwin_height
int editor_dbwin_height
Definition: pgedit.cpp:135
tesseract::Tesseract::word_display
bool word_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:749
pgedit.h
tesseract::Tesseract::blob_feature_display
void blob_feature_display(PAGE_RES *page_res, const TBOX &selection_box)
Definition: pgedit.cpp:952
tesseract::SP_DROPCAP
Definition: ratngs.h:254
editor_dbwin_xpos
int editor_dbwin_xpos
Definition: pgedit.cpp:133
tesseract::FontInfo
Definition: fontinfo.h:62
PGEventHandler
Definition: pgedit.h:34
GenericVector
Definition: baseapi.h:40
IMAGE_CMD_EVENT
Definition: pgedit.cpp:60
PAGE_RES_IT
Definition: pageres.h:668
DF_BOX
Bounding box.
Definition: werd.h:45
IRR_NUM_REASONS
Definition: blamer.h:99
DF_BN_POLYGONAL
BL normalisd polyapx.
Definition: werd.h:49
SVMenuNode::BuildMenu
void BuildMenu(ScrollView *sv, bool menu_bar=true)
Definition: svmnode.cpp:120
IRR_PAGE_LAYOUT
Definition: blamer.h:73
ScrollView::AwaitEvent
SVEvent * AwaitEvent(SVEventType type)
Definition: scrollview.cpp:443
tesseract::Wordrec::wordrec_debug_blamer
bool wordrec_debug_blamer
Definition: wordrec.h:231
tesseract::Tesseract::process_image_event
void process_image_event(const SVEvent &event)
Definition: pgedit.cpp:587
STRING::length
int32_t length() const
Definition: strngs.cpp:187
editor_image_text_color
int editor_image_text_color
Definition: pgedit.cpp:129
SVEvent::x_size
int x_size
Definition: scrollview.h:68
editor_image_word_bb_color
int editor_image_word_bb_color
Definition: pgedit.cpp:125
BlamerBundle::debug
const STRING & debug() const
Definition: blamer.h:131
WERD::text
const char * text() const
Definition: werd.h:113
tesseract::BoxWord::length
int length() const
Definition: boxword.h:82
TBLOB
Definition: blobs.h:282
SVMenuNode
Definition: svmnode.h:35
WERD
Definition: werd.h:55
ScrollView::TextAttributes
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
Definition: scrollview.cpp:634
BLOCK_RES::block
BLOCK * block
Definition: pageres.h:113
TBOX::left
int16_t left() const
Definition: rect.h:71
SVEvent
Definition: scrollview.h:60
tesseract::SP_SUPERSCRIPT
Definition: ratngs.h:253
ScrollView::GREEN
Definition: scrollview.h:106
UNIFORM_DISP_CMD_EVENT
Definition: pgedit.cpp:63
SVEvent::command_id
int command_id
Definition: scrollview.h:70
TBOX::right
int16_t right() const
Definition: rect.h:78
paramsd.h
ScrollView::Line
void Line(int x1, int y1, int x2, int y2)
Definition: scrollview.cpp:531
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
PDBLK::plot
void plot(ScrollView *window, int32_t serial, ScrollView::Color colour)
Definition: pdblock.cpp:174
ScrollView::AddEventHandler
void AddEventHandler(SVEventHandler *listener)
Add an Event Listener to this ScrollView Window.
Definition: scrollview.cpp:415
SVEvent::x
int x
Definition: scrollview.h:66
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
ScrollView::Update
static void Update()
Definition: scrollview.cpp:708
SVET_MENU
Definition: scrollview.h:54
CM_FIXEDPITCH
Definition: pgedit.cpp:87
TWERD::plot
void plot(ScrollView *window)
Definition: blobs.cpp:895
WERD_RES::word
WERD * word
Definition: pageres.h:180
CM_DROPCAPS
Definition: pgedit.cpp:90
BlamerBundle::incorrect_result_reason
IncorrectResultReason incorrect_result_reason() const
Definition: blamer.h:121
ScrollView::Text
void Text(int x, int y, const char *mystring)
Definition: scrollview.cpp:651
REFRESH_CMD_EVENT
Definition: pgedit.cpp:64
ScrollView::Color
Color
Definition: scrollview.h:100
tesseract::Tesseract::word_blank_and_set_display
bool word_blank_and_set_display(PAGE_RES_IT *pr_its)
Definition: pgedit.cpp:705
tesseract::Tesseract::word_set_display
bool word_set_display(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:937
tesseract::Tesseract::ResetAdaptiveClassifier
void ResetAdaptiveClassifier()
Definition: tesseractclass.cpp:597
tesseract::Classify::classify_bln_numeric_mode
bool classify_bln_numeric_mode
Definition: classify.h:508
X_HEIGHT
#define X_HEIGHT
Definition: pgedit.cpp:42
tordmain.h
ScrollView::ShowInputDialog
char * ShowInputDialog(const char *msg)
Definition: scrollview.cpp:731
ScrollView::Rectangle
void Rectangle(int x1, int y1, int x2, int y2)
Definition: scrollview.cpp:599
BlamerBundle
Definition: blamer.h:103
DF_POLYGONAL
Polyg approx.
Definition: werd.h:47
tesseract::Tesseract::word_dumper
bool word_dumper(PAGE_RES_IT *pr_it)
Definition: pgedit.cpp:913
SHOW_SUPERSCRIPT_CMD_EVENT
Definition: pgedit.cpp:70
DEBUG_WERD_CMD_EVENT
Definition: pgedit.cpp:53
GenericVector::size
int size() const
Definition: genericvector.h:71
tesseract::Tesseract::tessedit_ocr_engine_mode
int tessedit_ocr_engine_mode
Definition: tesseractclass.h:802
SHOW_BLN_WERD_CMD_EVENT
Definition: pgedit.cpp:52
scrollview.h
tesseract::FontInfo::is_bold
bool is_bold() const
Definition: fontinfo.h:112
CM_UNDERLINE
Definition: pgedit.cpp:86
tesseract::ClearFeatureSpaceWindow
void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView *window)
Definition: intproto.cpp:987
BOUNDING_BOX_CMD_EVENT
Definition: pgedit.cpp:55
SVET_SELECTION
Definition: scrollview.h:48
CM_SUBSCRIPT
Definition: pgedit.cpp:82
NULL_CMD_EVENT
Definition: pgedit.cpp:48
WERD_RES::small_caps
bool small_caps
Definition: pageres.h:300
RenderIntFeature
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT *Feature, ScrollView::Color color)
Definition: intproto.cpp:1603
DESC_HEIGHT
#define DESC_HEIGHT
Definition: pgedit.cpp:44
editor_image_xpos
int editor_image_xpos
Definition: pgedit.cpp:121
tesseract::FontInfo::is_serif
bool is_serif() const
Definition: fontinfo.h:114
BASELINES_CMD_EVENT
Definition: pgedit.cpp:62
TBOX
Definition: rect.h:33
editor_image_win_name
char * editor_image_win_name
Definition: pgedit.cpp:120
editor_word_ypos
int editor_word_ypos
Definition: pgedit.cpp:140
tesseract::BoxWord
Definition: boxword.h:36