tesseract  4.0.0-1-g2a2b
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");
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
bool textord_force_make_prop_words
Definition: wordseg.cpp:41
#define TRUE
Definition: capi.h:51
bool textord_fp_chopping
Definition: wordseg.cpp:39
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:267
bool textord_chopper_test
Definition: wordseg.cpp:43
int32_t row_words2(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:341
void make_real_words(tesseract::Textord *textord, TO_BLOCK *block, FCOORD rotation)
Definition: wordseg.cpp:495
integer coordinate
Definition: points.h:32
ROW * make_rep_words(TO_ROW *row, TO_BLOCK *block)
Definition: wordseg.cpp:551
#define FALSE
Definition: capi.h:52
void make_words(tesseract::Textord *textord, ICOORD page_tr, float gradient, BLOCK_LIST *blocks, TO_BLOCK_LIST *port_blocks)
Definition: wordseg.cpp:100
Definition: werd.h:59
Definition: ocrrow.h:36
WERD * make_real_word(BLOBNBOX_IT *box_it, int32_t blobcount, bool bol, uint8_t blanks)
Definition: wordseg.cpp:583
Definition: points.h:189
int32_t row_words(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:174
void set_row_spaces(TO_BLOCK *block, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:130
void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST *real_rows)
Definition: wordseg.cpp:56