Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
wordseg.h
Go to the documentation of this file.
1 /**********************************************************************
2  * File: wordseg.h (Formerly wspace.h)
3  * Description: Code to segment the blobs into words.
4  * Author: Ray Smith
5  * Created: Fri Oct 16 11:32:28 BST 1992
6  *
7  * (C) Copyright 1992, 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 #ifndef WORDSEG_H
21 #define WORDSEG_H
22 
23 #include "params.h"
24 #include "blobbox.h"
25 #include "notdll.h"
26 #include "textord.h"
27 
28 namespace tesseract {
29 class Tesseract;
30 }
31 
32 extern BOOL_VAR_H (textord_fp_chopping, TRUE, "Do fixed pitch chopping");
34  "Force proportional word segmentation on all rows");
36  "Chopper is being tested.");
37 
38 void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST* real_rows);
39 void make_words(tesseract::Textord *textord,
40  ICOORD page_tr, // top right
41  float gradient, // page skew
42  BLOCK_LIST *blocks, // block list
43  TO_BLOCK_LIST *port_blocks); // output list
44 void set_row_spaces( //find space sizes
45  TO_BLOCK *block, //block to do
46  FCOORD rotation, //for drawing
47  BOOL8 testing_on //correct orientation
48  );
49 inT32 row_words( //compute space size
50  TO_BLOCK *block, //block it came from
51  TO_ROW *row, //row to operate on
52  inT32 maxwidth, //max expected space size
53  FCOORD rotation, //for drawing
54  BOOL8 testing_on //for debug
55  );
56 inT32 row_words2( //compute space size
57  TO_BLOCK *block, //block it came from
58  TO_ROW *row, //row to operate on
59  inT32 maxwidth, //max expected space size
60  FCOORD rotation, //for drawing
61  BOOL8 testing_on //for debug
62  );
63 void make_real_words(
64  tesseract::Textord *textord,
65  TO_BLOCK *block, //block to do
66  FCOORD rotation //for drawing
67  );
68 ROW *make_rep_words( //make a row
69  TO_ROW *row, //row to convert
70  TO_BLOCK *block //block it lives in
71  );
72 WERD *make_real_word( //make a WERD
73  BLOBNBOX_IT *box_it, //iterator
74  inT32 blobcount, //no of blobs to use
75  BOOL8 bol, //start of line
76  uinT8 blanks //no of blanks
77  );
78 #endif