tesseract  4.0.0-1-g2a2b
werd.cpp
Go to the documentation of this file.
1 /**********************************************************************
2  * File: werd.cpp (Formerly word.c)
3  * Description: Code for the WERD class.
4  * Author: Ray Smith
5  * Created: Tue Oct 08 14:32:12 BST 1991
6  *
7  * (C) Copyright 1991, Hewlett-Packard Ltd.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  *
18  **********************************************************************/
19 
20 #include "helpers.h"
21 #include "linlsq.h"
22 #include "werd.h"
23 
24 // Include automatically generated configuration file if running autoconf.
25 #ifdef HAVE_CONFIG_H
26 #include "config_auto.h"
27 #endif
28 
29 #define FIRST_COLOUR ScrollView::RED //< first rainbow colour
30 #define LAST_COLOUR ScrollView::AQUAMARINE //< last rainbow colour
31 #define CHILD_COLOUR ScrollView::BROWN //< colour of children
32 
34  "Attempted to scale an edgestep format word";
35 
37 
38 
47 WERD::WERD(C_BLOB_LIST *blob_list, uint8_t blank_count, const char *text)
48  : blanks(blank_count),
49  flags(0),
50  script_id_(0),
51  correct(text) {
52  C_BLOB_IT start_it = &cblobs;
53  C_BLOB_IT rej_cblob_it = &rej_cblobs;
54  C_OUTLINE_IT c_outline_it;
55  int16_t inverted_vote = 0;
56  int16_t non_inverted_vote = 0;
57 
58  // Move blob_list's elements into cblobs.
59  start_it.add_list_after(blob_list);
60 
61  /*
62  Set white on black flag for the WERD, moving any duff blobs onto the
63  rej_cblobs list.
64  First, walk the cblobs checking the inverse flag for each outline of each
65  cblob. If a cblob has inconsistent flag settings for its different
66  outlines, move the blob to the reject list. Otherwise, increment the
67  appropriate w-on-b or b-on-w vote for the word.
68 
69  Now set the inversion flag for the WERD by maximum vote.
70 
71  Walk the blobs again, moving any blob whose inversion flag does not agree
72  with the concencus onto the reject list.
73  */
74  start_it.set_to_list(&cblobs);
75  if (start_it.empty())
76  return;
77  for (start_it.mark_cycle_pt(); !start_it.cycled_list(); start_it.forward()) {
78  bool reject_blob = false;
79  bool blob_inverted;
80 
81  c_outline_it.set_to_list(start_it.data()->out_list());
82  blob_inverted = c_outline_it.data()->flag(COUT_INVERSE);
83  for (c_outline_it.mark_cycle_pt();
84  !c_outline_it.cycled_list() && !reject_blob;
85  c_outline_it.forward()) {
86  reject_blob = c_outline_it.data()->flag(COUT_INVERSE) != blob_inverted;
87  }
88  if (reject_blob) {
89  rej_cblob_it.add_after_then_move(start_it.extract());
90  } else {
91  if (blob_inverted)
92  inverted_vote++;
93  else
94  non_inverted_vote++;
95  }
96  }
97 
98  flags.set_bit(W_INVERSE, (inverted_vote > non_inverted_vote));
99 
100  start_it.set_to_list(&cblobs);
101  if (start_it.empty())
102  return;
103  for (start_it.mark_cycle_pt(); !start_it.cycled_list(); start_it.forward()) {
104  c_outline_it.set_to_list(start_it.data()->out_list());
105  if (c_outline_it.data()->flag(COUT_INVERSE) != flags.bit(W_INVERSE))
106  rej_cblob_it.add_after_then_move(start_it.extract());
107  }
108 }
109 
110 
118 WERD::WERD(C_BLOB_LIST * blob_list, //< In word order
119  WERD * clone) //< Source of flags
120  : flags(clone->flags),
121  script_id_(clone->script_id_),
122  correct(clone->correct) {
123  C_BLOB_IT start_it = blob_list; // iterator
124  C_BLOB_IT end_it = blob_list; // another
125 
126  while (!end_it.at_last ())
127  end_it.forward (); //move to last
128  (reinterpret_cast<C_BLOB_LIST*>(&cblobs))->assign_to_sublist(&start_it, &end_it);
129  //move to our list
130  blanks = clone->blanks;
131  // fprintf(stderr,"Wrong constructor!!!!\n");
132 }
133 
134 // Construct a WERD from a single_blob and clone the flags from this.
135 // W_BOL and W_EOL flags are set according to the given values.
136 WERD* WERD::ConstructFromSingleBlob(bool bol, bool eol, C_BLOB* blob) {
137  C_BLOB_LIST temp_blobs;
138  C_BLOB_IT temp_it(&temp_blobs);
139  temp_it.add_after_then_move(blob);
140  WERD* blob_word = new WERD(&temp_blobs, this);
141  blob_word->set_flag(W_BOL, bol);
142  blob_word->set_flag(W_EOL, eol);
143  return blob_word;
144 }
145 
159 TBOX WERD::bounding_box() const { return restricted_bounding_box(true, true); }
160 
161 // Returns the bounding box including the desired combination of upper and
162 // lower noise/diacritic elements.
163 TBOX WERD::restricted_bounding_box(bool upper_dots, bool lower_dots) const {
164  TBOX box = true_bounding_box();
165  int bottom = box.bottom();
166  int top = box.top();
167  // This is a read-only iteration of the rejected blobs.
168  C_BLOB_IT it(const_cast<C_BLOB_LIST*>(&rej_cblobs));
169  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
170  TBOX dot_box = it.data()->bounding_box();
171  if ((upper_dots || dot_box.bottom() <= top) &&
172  (lower_dots || dot_box.top() >= bottom)) {
173  box += dot_box;
174  }
175  }
176  return box;
177 }
178 
179 // Returns the bounding box of only the good blobs.
181  TBOX box; // box being built
182  // This is a read-only iteration of the good blobs.
183  C_BLOB_IT it(const_cast<C_BLOB_LIST*>(&cblobs));
184  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
185  box += it.data()->bounding_box();
186  }
187  return box;
188 }
189 
197 void WERD::move(const ICOORD vec) {
198  C_BLOB_IT cblob_it(&cblobs); // cblob iterator
199 
200  for (cblob_it.mark_cycle_pt(); !cblob_it.cycled_list(); cblob_it.forward())
201  cblob_it.data()->move(vec);
202 }
203 
210 void WERD::join_on(WERD* other) {
211  C_BLOB_IT blob_it(&cblobs);
212  C_BLOB_IT src_it(&other->cblobs);
213  C_BLOB_IT rej_cblob_it(&rej_cblobs);
214  C_BLOB_IT src_rej_it(&other->rej_cblobs);
215 
216  while (!src_it.empty()) {
217  blob_it.add_to_end(src_it.extract());
218  src_it.forward();
219  }
220  while (!src_rej_it.empty()) {
221  rej_cblob_it.add_to_end(src_rej_it.extract());
222  src_rej_it.forward();
223  }
224 }
225 
226 
233 void WERD::copy_on(WERD* other) {
234  bool reversed = other->bounding_box().left() < bounding_box().left();
235  C_BLOB_IT c_blob_it(&cblobs);
236  C_BLOB_LIST c_blobs;
237 
238  c_blobs.deep_copy(&other->cblobs, &C_BLOB::deep_copy);
239  if (reversed) {
240  c_blob_it.add_list_before(&c_blobs);
241  } else {
242  c_blob_it.move_to_last();
243  c_blob_it.add_list_after(&c_blobs);
244  }
245  if (!other->rej_cblobs.empty()) {
246  C_BLOB_IT rej_c_blob_it(&rej_cblobs);
247  C_BLOB_LIST new_rej_c_blobs;
248 
249  new_rej_c_blobs.deep_copy(&other->rej_cblobs, &C_BLOB::deep_copy);
250  if (reversed) {
251  rej_c_blob_it.add_list_before(&new_rej_c_blobs);
252  } else {
253  rej_c_blob_it.move_to_last();
254  rej_c_blob_it.add_list_after(&new_rej_c_blobs);
255  }
256  }
257 }
258 
265 void WERD::print() {
266  tprintf("Blanks= %d\n", blanks);
267  bounding_box().print();
268  tprintf("Flags = %d = 0%o\n", flags.val, flags.val);
269  tprintf(" W_SEGMENTED = %s\n", flags.bit(W_SEGMENTED) ? "TRUE" : "FALSE ");
270  tprintf(" W_ITALIC = %s\n", flags.bit(W_ITALIC) ? "TRUE" : "FALSE ");
271  tprintf(" W_BOL = %s\n", flags.bit(W_BOL) ? "TRUE" : "FALSE ");
272  tprintf(" W_EOL = %s\n", flags.bit(W_EOL) ? "TRUE" : "FALSE ");
273  tprintf(" W_NORMALIZED = %s\n",
274  flags.bit(W_NORMALIZED) ? "TRUE" : "FALSE ");
275  tprintf(" W_SCRIPT_HAS_XHEIGHT = %s\n",
276  flags.bit(W_SCRIPT_HAS_XHEIGHT) ? "TRUE" : "FALSE ");
277  tprintf(" W_SCRIPT_IS_LATIN = %s\n",
278  flags.bit(W_SCRIPT_IS_LATIN) ? "TRUE" : "FALSE ");
279  tprintf(" W_DONT_CHOP = %s\n", flags.bit(W_DONT_CHOP) ? "TRUE" : "FALSE ");
280  tprintf(" W_REP_CHAR = %s\n", flags.bit(W_REP_CHAR) ? "TRUE" : "FALSE ");
281  tprintf(" W_FUZZY_SP = %s\n", flags.bit(W_FUZZY_SP) ? "TRUE" : "FALSE ");
282  tprintf(" W_FUZZY_NON = %s\n", flags.bit(W_FUZZY_NON) ? "TRUE" : "FALSE ");
283  tprintf("Correct= %s\n", correct.string());
284  tprintf("Rejected cblob count = %d\n", rej_cblobs.length());
285  tprintf("Script = %d\n", script_id_);
286 }
287 
288 
295 #ifndef GRAPHICS_DISABLED
296 void WERD::plot(ScrollView *window, ScrollView::Color colour) {
297  C_BLOB_IT it = &cblobs;
298  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
299  it.data()->plot(window, colour, colour);
300  }
301  plot_rej_blobs(window);
302 }
303 
304 // Get the next color in the (looping) rainbow.
306  ScrollView::Color next = static_cast<ScrollView::Color>(colour + 1);
307  if (next >= LAST_COLOUR || next < FIRST_COLOUR)
308  next = FIRST_COLOUR;
309  return next;
310 }
311 
318 void WERD::plot(ScrollView* window) {
320  C_BLOB_IT it = &cblobs;
321  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
322  it.data()->plot(window, colour, CHILD_COLOUR);
323  colour = NextColor(colour);
324  }
325  plot_rej_blobs(window);
326 }
327 
328 
337  C_BLOB_IT it = &rej_cblobs;
338  for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
339  it.data()->plot(window, ScrollView::GREY, ScrollView::GREY);
340  }
341 }
342 #endif // GRAPHICS_DISABLED
343 
344 
352  WERD *new_word = new WERD;
353 
354  new_word->blanks = blanks;
355  new_word->flags = flags;
356  new_word->dummy = dummy;
357  new_word->correct = correct;
358  return new_word;
359 }
360 
361 
368 WERD & WERD::operator= (const WERD & source) {
369  this->ELIST2_LINK::operator= (source);
370  blanks = source.blanks;
371  flags = source.flags;
372  script_id_ = source.script_id_;
373  dummy = source.dummy;
374  correct = source.correct;
375  if (!cblobs.empty())
376  cblobs.clear();
377  cblobs.deep_copy(&source.cblobs, &C_BLOB::deep_copy);
378 
379  if (!rej_cblobs.empty())
380  rej_cblobs.clear();
381  rej_cblobs.deep_copy(&source.rej_cblobs, &C_BLOB::deep_copy);
382  return *this;
383 }
384 
385 
393 int word_comparator(const void *word1p, const void *word2p) {
394  const WERD *word1 = *reinterpret_cast<const WERD* const*>(word1p);
395  const WERD *word2 = *reinterpret_cast<const WERD* const*>(word2p);
396  return word1->bounding_box().left() - word2->bounding_box().left();
397 }
398 
411 WERD* WERD::ConstructWerdWithNewBlobs(C_BLOB_LIST* all_blobs,
412  C_BLOB_LIST* orphan_blobs) {
413  C_BLOB_LIST current_blob_list;
414  C_BLOB_IT werd_blobs_it(&current_blob_list);
415  // Add the word's c_blobs.
416  werd_blobs_it.add_list_after(cblob_list());
417 
418  // New blob list. These contain the blobs which will form the new word.
419  C_BLOB_LIST new_werd_blobs;
420  C_BLOB_IT new_blobs_it(&new_werd_blobs);
421 
422  // not_found_blobs contains the list of current word's blobs for which a
423  // corresponding blob wasn't found in the input all_blobs list.
424  C_BLOB_LIST not_found_blobs;
425  C_BLOB_IT not_found_it(&not_found_blobs);
426  not_found_it.move_to_last();
427 
428  werd_blobs_it.move_to_first();
429  for (werd_blobs_it.mark_cycle_pt(); !werd_blobs_it.cycled_list();
430  werd_blobs_it.forward()) {
431  C_BLOB* werd_blob = werd_blobs_it.extract();
432  TBOX werd_blob_box = werd_blob->bounding_box();
433  bool found = false;
434  // Now find the corresponding blob for this blob in the all_blobs
435  // list. For now, follow the inefficient method of pairwise
436  // comparisons. Ideally, one can pre-bucket the blobs by row.
437  C_BLOB_IT all_blobs_it(all_blobs);
438  for (all_blobs_it.mark_cycle_pt(); !all_blobs_it.cycled_list();
439  all_blobs_it.forward()) {
440  C_BLOB* a_blob = all_blobs_it.data();
441  // Compute the overlap of the two blobs. If major, a_blob should
442  // be added to the new blobs list.
443  TBOX a_blob_box = a_blob->bounding_box();
444  if (a_blob_box.null_box()) {
445  tprintf("Bounding box couldn't be ascertained\n");
446  }
447  if (werd_blob_box.contains(a_blob_box) ||
448  werd_blob_box.major_overlap(a_blob_box)) {
449  // Old blobs are from minimal splits, therefore are expected to be
450  // bigger. The new small blobs should cover a significant portion.
451  // This is it.
452  all_blobs_it.extract();
453  new_blobs_it.add_after_then_move(a_blob);
454  found = true;
455  }
456  }
457  if (!found) {
458  not_found_it.add_after_then_move(werd_blob);
459  } else {
460  delete werd_blob;
461  }
462  }
463  // Iterate over all not found blobs. Some of them may be due to
464  // under-segmentation (which is OK, since the corresponding blob is already
465  // in the list in that case.
466  not_found_it.move_to_first();
467  for (not_found_it.mark_cycle_pt(); !not_found_it.cycled_list();
468  not_found_it.forward()) {
469  C_BLOB* not_found = not_found_it.data();
470  TBOX not_found_box = not_found->bounding_box();
471  C_BLOB_IT existing_blobs_it(new_blobs_it);
472  for (existing_blobs_it.mark_cycle_pt(); !existing_blobs_it.cycled_list();
473  existing_blobs_it.forward()) {
474  C_BLOB* a_blob = existing_blobs_it.data();
475  TBOX a_blob_box = a_blob->bounding_box();
476  if ((not_found_box.major_overlap(a_blob_box) ||
477  a_blob_box.major_overlap(not_found_box)) &&
478  not_found_box.y_overlap_fraction(a_blob_box) > 0.8) {
479  // Already taken care of.
480  delete not_found_it.extract();
481  break;
482  }
483  }
484  }
485  if (orphan_blobs) {
486  C_BLOB_IT orphan_blobs_it(orphan_blobs);
487  orphan_blobs_it.move_to_last();
488  orphan_blobs_it.add_list_after(&not_found_blobs);
489  }
490 
491  // New blobs are ready. Create a new werd object with these.
492  WERD* new_werd = nullptr;
493  if (!new_werd_blobs.empty()) {
494  new_werd = new WERD(&new_werd_blobs, this);
495  } else {
496  // Add the blobs back to this word so that it can be reused.
497  C_BLOB_IT this_list_it(cblob_list());
498  this_list_it.add_list_after(&not_found_blobs);
499  }
500  return new_werd;
501 }
502 
503 // Removes noise from the word by moving small outlines to the rej_cblobs
504 // list, based on the size_threshold.
505 void WERD::CleanNoise(float size_threshold) {
506  C_BLOB_IT blob_it(&cblobs);
507  C_BLOB_IT rej_it(&rej_cblobs);
508  for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
509  C_BLOB* blob = blob_it.data();
510  C_OUTLINE_IT ol_it(blob->out_list());
511  for (ol_it.mark_cycle_pt(); !ol_it.cycled_list(); ol_it.forward()) {
512  C_OUTLINE* outline = ol_it.data();
513  TBOX ol_box = outline->bounding_box();
514  int ol_size =
515  ol_box.width() > ol_box.height() ? ol_box.width() : ol_box.height();
516  if (ol_size < size_threshold) {
517  // This outline is too small. Move it to a separate blob in the
518  // reject blobs list.
519  C_BLOB* rej_blob = new C_BLOB(ol_it.extract());
520  rej_it.add_after_then_move(rej_blob);
521  }
522  }
523  if (blob->out_list()->empty()) delete blob_it.extract();
524  }
525 }
526 
527 // Extracts all the noise outlines and stuffs the pointers into the given
528 // vector of outlines. Afterwards, the outlines vector owns the pointers.
530  C_BLOB_IT rej_it(&rej_cblobs);
531  for (rej_it.mark_cycle_pt(); !rej_it.empty(); rej_it.forward()) {
532  C_BLOB* blob = rej_it.extract();
533  C_OUTLINE_IT ol_it(blob->out_list());
534  outlines->push_back(ol_it.extract());
535  delete blob;
536  }
537 }
538 
539 // Adds the selected outlines to the indcated real blobs, and puts the rest
540 // back in rej_cblobs where they came from. Where the target_blobs entry is
541 // nullptr, a run of wanted outlines is put into a single new blob.
542 // Ownership of the outlines is transferred back to the word. (Hence
543 // GenericVector and not PointerVector.)
544 // Returns true if any new blob was added to the start of the word, which
545 // suggests that it might need joining to the word before it, and likewise
546 // sets make_next_word_fuzzy true if any new blob was added to the end.
548  const GenericVector<C_BLOB*>& target_blobs,
549  const GenericVector<C_OUTLINE*>& outlines,
550  bool* make_next_word_fuzzy) {
551  bool outline_added_to_start = false;
552  if (make_next_word_fuzzy != nullptr) *make_next_word_fuzzy = false;
553  C_BLOB_IT rej_it(&rej_cblobs);
554  for (int i = 0; i < outlines.size(); ++i) {
555  C_OUTLINE* outline = outlines[i];
556  if (outline == nullptr) continue; // Already used it.
557  if (wanted[i]) {
558  C_BLOB* target_blob = target_blobs[i];
559  TBOX noise_box = outline->bounding_box();
560  if (target_blob == nullptr) {
561  target_blob = new C_BLOB(outline);
562  // Need to find the insertion point.
563  C_BLOB_IT blob_it(&cblobs);
564  for (blob_it.mark_cycle_pt(); !blob_it.cycled_list();
565  blob_it.forward()) {
566  C_BLOB* blob = blob_it.data();
567  TBOX blob_box = blob->bounding_box();
568  if (blob_box.left() > noise_box.left()) {
569  if (blob_it.at_first() && !flag(W_FUZZY_SP) && !flag(W_FUZZY_NON)) {
570  // We might want to join this word to its predecessor.
571  outline_added_to_start = true;
572  }
573  blob_it.add_before_stay_put(target_blob);
574  break;
575  }
576  }
577  if (blob_it.cycled_list()) {
578  blob_it.add_to_end(target_blob);
579  if (make_next_word_fuzzy != nullptr) *make_next_word_fuzzy = true;
580  }
581  // Add all consecutive wanted, but null-blob outlines to same blob.
582  C_OUTLINE_IT ol_it(target_blob->out_list());
583  while (i + 1 < outlines.size() && wanted[i + 1] &&
584  target_blobs[i + 1] == nullptr) {
585  ++i;
586  ol_it.add_to_end(outlines[i]);
587  }
588  } else {
589  // Insert outline into this blob.
590  C_OUTLINE_IT ol_it(target_blob->out_list());
591  ol_it.add_to_end(outline);
592  }
593  } else {
594  // Put back on noise list.
595  rej_it.add_to_end(new C_BLOB(outline));
596  }
597  }
598  return outline_added_to_start;
599 }
void CleanNoise(float size_threshold)
Definition: werd.cpp:505
Definition: werd.h:43
int size() const
Definition: genericvector.h:71
void plot_rej_blobs(ScrollView *window)
Definition: werd.cpp:336
#define LAST_COLOUR
Definition: werd.cpp:30
WERD & operator=(const WERD &source)
Definition: werd.cpp:368
void print() const
Definition: rect.h:278
bool null_box() const
Definition: rect.h:50
void move(const ICOORD vec)
Definition: werd.cpp:197
const char * string() const
Definition: strngs.cpp:196
WERD * ConstructFromSingleBlob(bool bol, bool eol, C_BLOB *blob)
Definition: werd.cpp:136
int word_comparator(const void *word1p, const void *word2p)
Definition: werd.cpp:393
TBOX bounding_box() const
Definition: werd.cpp:159
static ScrollView::Color NextColor(ScrollView::Color colour)
Definition: werd.cpp:305
void GetNoiseOutlines(GenericVector< C_OUTLINE *> *outlines)
Definition: werd.cpp:529
void plot(ScrollView *window, ScrollView::Color colour)
Definition: werd.cpp:296
Definition: rect.h:34
WERD * shallow_copy()
Definition: werd.cpp:351
Definition: werd.h:35
double y_overlap_fraction(const TBOX &box) const
Definition: rect.h:479
#define CHILD_COLOUR
Definition: werd.cpp:31
void set_flag(WERD_FLAGS mask, bool value)
Definition: werd.h:127
Definition: werd.h:32
#define ELIST2IZE(CLASSNAME)
Definition: elst2.h:961
int16_t width() const
Definition: rect.h:115
void print()
Definition: werd.cpp:265
#define FIRST_COLOUR
Definition: werd.cpp:29
bool AddSelectedOutlines(const GenericVector< bool > &wanted, const GenericVector< C_BLOB *> &target_blobs, const GenericVector< C_OUTLINE *> &outlines, bool *make_next_word_fuzzy)
Definition: werd.cpp:547
int16_t left() const
Definition: rect.h:72
bool flag(WERD_FLAGS mask) const
Definition: werd.h:126
int16_t top() const
Definition: rect.h:58
integer coordinate
Definition: points.h:32
bool major_overlap(const TBOX &box) const
Definition: rect.h:368
VECTOR vec
Definition: blobs.h:171
Definition: werd.h:59
const TBOX & bounding_box() const
Definition: coutln.h:113
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:37
Definition: werd.h:34
C_BLOB_LIST * cblob_list()
Definition: werd.h:98
WERD()=default
void operator=(const ELIST2_LINK &)
Definition: elst2.h:76
int push_back(T object)
TBOX bounding_box() const
Definition: stepblob.cpp:255
TBOX restricted_bounding_box(bool upper_dots, bool lower_dots) const
Definition: werd.cpp:163
bool contains(const FCOORD pt) const
Definition: rect.h:333
C_OUTLINE_LIST * out_list()
Definition: stepblob.h:70
const ERRCODE CANT_SCALE_EDGESTEPS
Definition: werd.cpp:33
char flags[EDGEPTFLAGS]
Definition: blobs.h:175
void copy_on(WERD *other)
Definition: werd.cpp:233
void join_on(WERD *other)
Definition: werd.cpp:210
WERD * ConstructWerdWithNewBlobs(C_BLOB_LIST *all_blobs, C_BLOB_LIST *orphan_blobs)
Definition: werd.cpp:411
int16_t bottom() const
Definition: rect.h:65
EDGEPT * next
Definition: blobs.h:176
int16_t height() const
Definition: rect.h:108
static C_BLOB * deep_copy(const C_BLOB *src)
Definition: stepblob.h:119
TBOX true_bounding_box() const
Definition: werd.cpp:180