Leptonica  1.83.1
Image processing and image analysis suite
recog.h
Go to the documentation of this file.
1 /*====================================================================*
2  - Copyright (C) 2001 Leptonica. All rights reserved.
3  -
4  - Redistribution and use in source and binary forms, with or without
5  - modification, are permitted provided that the following conditions
6  - are met:
7  - 1. Redistributions of source code must retain the above copyright
8  - notice, this list of conditions and the following disclaimer.
9  - 2. Redistributions in binary form must reproduce the above
10  - copyright notice, this list of conditions and the following
11  - disclaimer in the documentation and/or other materials
12  - provided with the distribution.
13  -
14  - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16  - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17  - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18  - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *====================================================================*/
26 
27 #ifndef LEPTONICA_RECOG_H
28 #define LEPTONICA_RECOG_H
29 
114 #define RECOG_VERSION_NUMBER 2
115 
116 struct L_Recog {
117  l_int32 scalew;
119  l_int32 scaleh;
121  l_int32 linew;
123  l_int32 templ_use;
126  l_int32 maxarraysize;
127  l_int32 setsize;
128  l_int32 threshold;
129  l_int32 maxyshift;
131  l_int32 charset_type;
132  l_int32 charset_size;
133  l_int32 min_nopad;
134  l_int32 num_samples;
135  l_int32 minwidth_u;
136  l_int32 maxwidth_u;
137  l_int32 minheight_u;
138  l_int32 maxheight_u;
139  l_int32 minwidth;
140  l_int32 maxwidth;
141  l_int32 ave_done;
142  l_int32 train_done;
144  l_float32 max_wh_ratio;
145  l_float32 max_ht_ratio;
146  l_int32 min_splitw;
147  l_int32 max_splith;
148  struct Sarray *sa_text;
149  struct L_Dna *dna_tochar;
150  l_int32 *centtab;
151  l_int32 *sumtab;
152  struct Pixaa *pixaa_u;
153  struct Ptaa *ptaa_u;
154  struct Numaa *naasum_u;
155  struct Pixaa *pixaa;
156  struct Ptaa *ptaa;
157  struct Numaa *naasum;
158  struct Pixa *pixa_u;
159  struct Pta *pta_u;
160  struct Numa *nasum_u;
161  struct Pixa *pixa;
162  struct Pta *pta;
163  struct Numa *nasum;
164  struct Pixa *pixa_tr;
165  struct Pixa *pixadb_ave;
166  struct Pixa *pixa_id;
167  struct Pix *pixdb_ave;
168  struct Pix *pixdb_range;
169  struct Pixa *pixadb_boot;
170  struct Pixa *pixadb_split;
171  struct L_Bmf *bmf;
172  l_int32 bmf_size;
173  struct L_Rdid *did;
174  struct L_Rch *rch;
175  struct L_Rcha *rcha;
176 };
177 typedef struct L_Recog L_RECOG;
178 
182 struct L_Rch {
183  l_int32 index;
184  l_float32 score;
185  char *text;
186  l_int32 sample;
188  l_int32 xloc;
189  l_int32 yloc;
190  l_int32 width;
191 };
192 typedef struct L_Rch L_RCH;
193 
197 struct L_Rcha {
198  struct Numa *naindex;
199  struct Numa *nascore;
200  struct Sarray *satext;
201  struct Numa *nasample;
202  struct Numa *naxloc;
203  struct Numa *nayloc;
204  struct Numa *nawidth;
205 };
206 typedef struct L_Rcha L_RCHA;
207 
211 struct L_Rdid {
212  struct Pix *pixs;
213  l_int32 **counta;
214  l_int32 **delya;
215  l_int32 narray;
216  l_int32 size;
217  l_int32 *setwidth;
218  struct Numa *nasum;
219  struct Numa *namoment;
220  l_int32 fullarrays;
221  l_float32 *beta;
222  l_float32 *gamma;
223  l_float32 *trellisscore;
224  l_int32 *trellistempl;
225  struct Numa *natempl;
226  struct Numa *naxloc;
227  struct Numa *nadely;
228  struct Numa *nawidth;
229  struct Boxa *boxa;
230  struct Numa *nascore;
231  struct Numa *natempl_r;
232  struct Numa *nasample_r;
233  struct Numa *naxloc_r;
234  struct Numa *nadely_r;
235  struct Numa *nawidth_r;
236  struct Numa *nascore_r;
237 };
238 typedef struct L_Rdid L_RDID;
239 
240 
241 /*-------------------------------------------------------------------------*
242  * Flags for describing limited character sets *
243  *-------------------------------------------------------------------------*/
245 enum {
246  L_UNKNOWN = 0,
251  L_UC_ALPHA = 5
252 };
253 
254 /*-------------------------------------------------------------------------*
255  * Flags for selecting between using average and all templates: *
256  * recog->templ_use *
257  *-------------------------------------------------------------------------*/
259 enum {
262 };
263 
264 #endif /* LEPTONICA_RECOG_H */
@ L_USE_AVERAGE_TEMPLATES
Definition: recog.h:261
@ L_USE_ALL_TEMPLATES
Definition: recog.h:260
@ L_LC_ALPHA
Definition: recog.h:250
@ L_ARABIC_NUMERALS
Definition: recog.h:247
@ L_UC_ALPHA
Definition: recog.h:251
@ L_LC_ROMAN_NUMERALS
Definition: recog.h:248
@ L_UNKNOWN
Definition: recog.h:246
@ L_UC_ROMAN_NUMERALS
Definition: recog.h:249
Definition: bmf.h:47
Definition: recog.h:182
l_int32 sample
Definition: recog.h:186
l_int32 yloc
Definition: recog.h:189
l_float32 score
Definition: recog.h:184
char * text
Definition: recog.h:185
l_int32 index
Definition: recog.h:183
l_int32 xloc
Definition: recog.h:188
l_int32 width
Definition: recog.h:190
Definition: recog.h:197
struct Numa * nasample
Definition: recog.h:201
struct Sarray * satext
Definition: recog.h:200
struct Numa * nascore
Definition: recog.h:199
struct Numa * nawidth
Definition: recog.h:204
struct Numa * naxloc
Definition: recog.h:202
struct Numa * naindex
Definition: recog.h:198
struct Numa * nayloc
Definition: recog.h:203
Definition: recog.h:211
struct Numa * naxloc
Definition: recog.h:226
struct Numa * naxloc_r
Definition: recog.h:233
struct Numa * nawidth
Definition: recog.h:228
struct Numa * natempl_r
Definition: recog.h:231
l_int32 * setwidth
Definition: recog.h:217
struct Numa * namoment
Definition: recog.h:219
struct Numa * nawidth_r
Definition: recog.h:235
l_int32 narray
Definition: recog.h:215
l_float32 * trellisscore
Definition: recog.h:223
l_int32 size
Definition: recog.h:216
struct Numa * natempl
Definition: recog.h:225
l_int32 * trellistempl
Definition: recog.h:224
struct Numa * nasum
Definition: recog.h:218
struct Boxa * boxa
Definition: recog.h:229
l_int32 fullarrays
Definition: recog.h:220
l_int32 ** counta
Definition: recog.h:213
struct Numa * nadely_r
Definition: recog.h:234
struct Numa * nascore_r
Definition: recog.h:236
struct Numa * nasample_r
Definition: recog.h:232
l_float32 * gamma
Definition: recog.h:222
struct Numa * nascore
Definition: recog.h:230
l_int32 ** delya
Definition: recog.h:214
struct Pix * pixs
Definition: recog.h:212
struct Numa * nadely
Definition: recog.h:227
l_float32 * beta
Definition: recog.h:221
Definition: recog.h:116
l_int32 charset_size
Definition: recog.h:132
struct Numa * nasum
Definition: recog.h:163
struct L_Dna * dna_tochar
Definition: recog.h:149
l_int32 ave_done
Definition: recog.h:141
l_int32 templ_use
Definition: recog.h:123
l_int32 maxwidth
Definition: recog.h:140
l_int32 num_samples
Definition: recog.h:134
l_int32 * centtab
Definition: recog.h:150
l_int32 min_nopad
Definition: recog.h:133
struct L_Rch * rch
Definition: recog.h:174
struct Pixa * pixa_u
Definition: recog.h:158
l_int32 train_done
Definition: recog.h:142
l_int32 maxwidth_u
Definition: recog.h:136
struct Pta * pta_u
Definition: recog.h:159
struct Ptaa * ptaa_u
Definition: recog.h:153
l_int32 maxyshift
Definition: recog.h:129
l_int32 linew
Definition: recog.h:121
struct Numaa * naasum_u
Definition: recog.h:154
l_int32 scalew
Definition: recog.h:117
struct Ptaa * ptaa
Definition: recog.h:156
l_int32 maxheight_u
Definition: recog.h:138
l_int32 min_splitw
Definition: recog.h:146
l_float32 max_ht_ratio
Definition: recog.h:145
l_int32 bmf_size
Definition: recog.h:172
struct Pixa * pixadb_ave
Definition: recog.h:165
l_int32 minwidth
Definition: recog.h:139
l_int32 minheight_u
Definition: recog.h:137
struct Pixa * pixa_tr
Definition: recog.h:164
l_int32 threshold
Definition: recog.h:128
struct Numa * nasum_u
Definition: recog.h:160
struct L_Rcha * rcha
Definition: recog.h:175
struct Pixa * pixa_id
Definition: recog.h:166
l_int32 scaleh
Definition: recog.h:119
l_int32 max_splith
Definition: recog.h:147
struct Pix * pixdb_range
Definition: recog.h:168
l_int32 * sumtab
Definition: recog.h:151
struct Pix * pixdb_ave
Definition: recog.h:167
struct Pixa * pixadb_split
Definition: recog.h:170
struct Pta * pta
Definition: recog.h:162
l_int32 minwidth_u
Definition: recog.h:135
l_int32 charset_type
Definition: recog.h:131
struct Numaa * naasum
Definition: recog.h:157
l_float32 max_wh_ratio
Definition: recog.h:144
struct Pixaa * pixaa_u
Definition: recog.h:152
l_int32 setsize
Definition: recog.h:127
struct Sarray * sa_text
Definition: recog.h:148
struct L_Bmf * bmf
Definition: recog.h:171
struct Pixa * pixadb_boot
Definition: recog.h:169
struct L_Rdid * did
Definition: recog.h:173
struct Pixaa * pixaa
Definition: recog.h:155
struct Pixa * pixa
Definition: recog.h:161
l_int32 maxarraysize
Definition: recog.h:126