tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
wordseg.h
1 /**********************************************************************
2  * File: wordseg.h (Formerly wspace.h)
3  * Description: Code to segment the blobs into words.
4  * Author: Ray Smith
5  *
6  * (C) Copyright 1992, 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 #ifndef WORDSEG_H
20 #define WORDSEG_H
21 
22 #include "params.h"
23 #include "blobbox.h"
24 #include "textord.h"
25 
26 namespace tesseract {
27 class Tesseract;
28 }
29 
30 extern BOOL_VAR_H (textord_fp_chopping, TRUE, "Do fixed pitch chopping");
31 extern BOOL_VAR_H(textord_force_make_prop_words, FALSE,
32  "Force proportional word segmentation on all rows");
33 extern BOOL_VAR_H (textord_chopper_test, FALSE,
34  "Chopper is being tested.");
35 
36 void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST* real_rows);
37 void make_words(tesseract::Textord *textord,
38  ICOORD page_tr, // top right
39  float gradient, // page skew
40  BLOCK_LIST *blocks, // block list
41  TO_BLOCK_LIST *port_blocks); // output list
42 void set_row_spaces( //find space sizes
43  TO_BLOCK* block, //block to do
44  FCOORD rotation, //for drawing
45  bool testing_on //correct orientation
46 );
47 int32_t row_words( //compute space size
48  TO_BLOCK* block, //block it came from
49  TO_ROW* row, //row to operate on
50  int32_t maxwidth, //max expected space size
51  FCOORD rotation, //for drawing
52  bool testing_on //for debug
53 );
54 int32_t row_words2( //compute space size
55  TO_BLOCK* block, //block it came from
56  TO_ROW* row, //row to operate on
57  int32_t maxwidth, //max expected space size
58  FCOORD rotation, //for drawing
59  bool testing_on //for debug
60 );
61 void make_real_words(
62  tesseract::Textord *textord,
63  TO_BLOCK *block, //block to do
64  FCOORD rotation //for drawing
65  );
66 ROW *make_rep_words( //make a row
67  TO_ROW *row, //row to convert
68  TO_BLOCK *block //block it lives in
69  );
70 WERD *make_real_word( //make a WERD
71  BLOBNBOX_IT* box_it, //iterator
72  int32_t blobcount, //no of blobs to use
73  bool bol, //start of line
74  uint8_t blanks //no of blanks
75 );
76 #endif
Definition: werd.h:59
Definition: baseapi.cpp:94
BOOL_VAR_H(textord_tabfind_find_tables, false, "run table detection")
Definition: blobbox.h:556
integer coordinate
Definition: points.h:32
Definition: ocrrow.h:36
Definition: textord.h:68
Definition: blobbox.h:705
Definition: points.h:189