tesseract 4.1.1
Loading...
Searching...
No Matches
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
26namespace tesseract {
27class Tesseract;
28}
29
30extern BOOL_VAR_H (textord_fp_chopping, true, "Do fixed pitch chopping");
32 "Force proportional word segmentation on all rows");
33extern BOOL_VAR_H (textord_chopper_test, false,
34 "Chopper is being tested.");
35
36void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST* real_rows);
37void 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
42void 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);
47int32_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);
54int32_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);
62 tesseract::Textord *textord,
63 TO_BLOCK *block, //block to do
64 FCOORD rotation //for drawing
65 );
66ROW *make_rep_words( //make a row
67 TO_ROW *row, //row to convert
68 TO_BLOCK *block //block it lives in
69 );
70WERD *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
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:297
void make_real_words(tesseract::Textord *textord, TO_BLOCK *block, FCOORD rotation)
Definition: wordseg.cpp:491
int32_t row_words2(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:337
void make_words(tesseract::Textord *textord, ICOORD page_tr, float gradient, BLOCK_LIST *blocks, TO_BLOCK_LIST *port_blocks)
Definition: wordseg.cpp:96
void set_row_spaces(TO_BLOCK *block, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:126
bool textord_fp_chopping
Definition: wordseg.cpp:36
bool textord_chopper_test
Definition: wordseg.cpp:40
bool textord_force_make_prop_words
Definition: wordseg.cpp:38
void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST *real_rows)
Definition: wordseg.cpp:52
int32_t row_words(TO_BLOCK *block, TO_ROW *row, int32_t maxwidth, FCOORD rotation, bool testing_on)
Definition: wordseg.cpp:170
WERD * make_real_word(BLOBNBOX_IT *box_it, int32_t blobcount, bool bol, uint8_t blanks)
Definition: wordseg.cpp:579
ROW * make_rep_words(TO_ROW *row, TO_BLOCK *block)
Definition: wordseg.cpp:547
Definition: ocrrow.h:37
integer coordinate
Definition: points.h:32
Definition: points.h:189
Definition: werd.h:56