tesseract  5.0.0-alpha-619-ge9db
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  *
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");
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
blobbox.h
params.h
ICOORD
integer coordinate
Definition: points.h:30
TO_BLOCK
Definition: blobbox.h:691
row_words
int32_t row_words(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:169
make_single_word
void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST *real_rows)
Definition: wordseg.cpp:51
FCOORD
Definition: points.h:187
make_real_word
WERD * make_real_word(BLOBNBOX_IT *box_it, int32_t blobcount, bool bol, uint8_t blanks)
Definition: wordseg.cpp:578
textord.h
tesseract
Definition: baseapi.h:65
make_real_words
void make_real_words(tesseract::Textord *textord, TO_BLOCK *block, FCOORD rotation)
Definition: wordseg.cpp:490
textord_force_make_prop_words
bool textord_force_make_prop_words
Definition: wordseg.cpp:37
BOOL_VAR_H
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:294
WERD
Definition: werd.h:55
textord_fp_chopping
bool textord_fp_chopping
Definition: wordseg.cpp:35
tesseract::Textord
Definition: textord.h:68
ROW
Definition: ocrrow.h:35
make_words
void make_words(tesseract::Textord *textord, ICOORD page_tr, float gradient, BLOCK_LIST *blocks, TO_BLOCK_LIST *port_blocks)
Definition: wordseg.cpp:95
row_words2
int32_t row_words2(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:336
TO_ROW
Definition: blobbox.h:543
textord_chopper_test
bool textord_chopper_test
Definition: wordseg.cpp:39
make_rep_words
ROW * make_rep_words(TO_ROW *row, TO_BLOCK *block)
Definition: wordseg.cpp:546
set_row_spaces
void set_row_spaces(TO_BLOCK *block, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:125