-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00116.html
412 lines (397 loc) · 64.2 KB
/
a00116.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /usr/src/tesseract-ocr.master/src/ccmain/osdetect.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">tesseract
 <span id="projectnumber">4.0.0-1-g2a2b</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00116.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#namespaces">Namespaces</a> |
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">osdetect.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="a00560_source.html">platform.h</a>"</code><br />
</div>
<p><a href="a00116_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="a02182.html">GenericVector< T ></a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="a02262.html">OSBestResult</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="a02266.html">OSResults</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="a02270.html">OrientationDetector</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="a02274.html">ScriptDetector</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:a01629"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="a01629.html">tesseract</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af7ea57b0e1847f524c98576cb5cace43"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#af7ea57b0e1847f524c98576cb5cace43">orientation_and_script_detection</a> (<a class="el" href="a02834.html">STRING</a> &filename, <a class="el" href="a02266.html">OSResults</a> *, <a class="el" href="a02358.html">tesseract::Tesseract</a> *)</td></tr>
<tr class="separator:af7ea57b0e1847f524c98576cb5cace43"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a93fedb9cccbbcf81d3433b95bbc46bdd"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#a93fedb9cccbbcf81d3433b95bbc46bdd">os_detect</a> (TO_BLOCK_LIST *port_blocks, <a class="el" href="a02266.html">OSResults</a> *osr, <a class="el" href="a02358.html">tesseract::Tesseract</a> *tess)</td></tr>
<tr class="separator:a93fedb9cccbbcf81d3433b95bbc46bdd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad5f8904fd2cc2c56563df5c6b0c6cc64"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#ad5f8904fd2cc2c56563df5c6b0c6cc64">os_detect_blobs</a> (const <a class="el" href="a02182.html">GenericVector</a>< int > *allowed_scripts, BLOBNBOX_CLIST *blob_list, <a class="el" href="a02266.html">OSResults</a> *osr, <a class="el" href="a02358.html">tesseract::Tesseract</a> *tess)</td></tr>
<tr class="separator:ad5f8904fd2cc2c56563df5c6b0c6cc64"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acd67dc649eafb2a0048434366730af2e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#acd67dc649eafb2a0048434366730af2e">os_detect_blob</a> (<a class="el" href="a02374.html">BLOBNBOX</a> *bbox, <a class="el" href="a02270.html">OrientationDetector</a> *o, <a class="el" href="a02274.html">ScriptDetector</a> *s, <a class="el" href="a02266.html">OSResults</a> *, <a class="el" href="a02358.html">tesseract::Tesseract</a> *tess)</td></tr>
<tr class="separator:acd67dc649eafb2a0048434366730af2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6d7d4d8dcc0ca1987d6890f2b8b0889e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#a6d7d4d8dcc0ca1987d6890f2b8b0889e">OrientationIdToValue</a> (const int &id)</td></tr>
<tr class="separator:a6d7d4d8dcc0ca1987d6890f2b8b0889e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ab52d878a730b63bcf57d7bb3113882a1"><td class="memItemLeft" align="right" valign="top">const int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00116.html#ab52d878a730b63bcf57d7bb3113882a1">kMaxNumberOfScripts</a> = 116 + 1 + 2 + 1</td></tr>
<tr class="separator:ab52d878a730b63bcf57d7bb3113882a1"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="af7ea57b0e1847f524c98576cb5cace43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7ea57b0e1847f524c98576cb5cace43">◆ </a></span>orientation_and_script_detection()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int orientation_and_script_detection </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a02834.html">STRING</a> & </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02266.html">OSResults</a> * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02358.html">tesseract::Tesseract</a> * </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00113_source.html#l00190">190</a> of file <a class="el" href="a00113_source.html">osdetect.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  {</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="a02834.html">STRING</a> name = filename; <span class="comment">//truncated name</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *lastdot; <span class="comment">//of name</span></div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <a class="code" href="a02610.html">TBOX</a> page_box;</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> </div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  lastdot = strrchr (name.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a> (), <span class="charliteral">'.'</span>);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">if</span> (lastdot != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  name[lastdot-name.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>()] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(tess->pix_binary() != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordtype">int</span> width = pixGetWidth(tess->pix_binary());</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordtype">int</span> height = pixGetHeight(tess->pix_binary());</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> </div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  BLOCK_LIST blocks;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">if</span> (!<a class="code" href="a00233.html#a74a37aa6889ec51bda0d091767c6ae46">read_unlv_file</a>(name, width, height, &blocks))</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="code" href="a00233.html#a6d4d883ff45201c5b6166b5941cb96a2">FullPageBlock</a>(width, height, &blocks);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="comment">// Try to remove non-text regions from consideration.</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  TO_BLOCK_LIST land_blocks, port_blocks;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  remove_nontext_regions(tess, &blocks, &port_blocks);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> </div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keywordflow">if</span> (port_blocks.empty()) {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="comment">// page segmentation did not succeed, so we need to find_components first.</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  tess->mutable_textord()->find_components(tess->pix_binary(),</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  &blocks, &port_blocks);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  page_box.<a class="code" href="a02610.html#ae6151cd794841e100d8a346a0c4a46e6">set_left</a>(0);</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  page_box.<a class="code" href="a02610.html#a6f803b24b046883cb0f3882dc3d92302">set_bottom</a>(0);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  page_box.<a class="code" href="a02610.html#a2246293d3667b28c52a52353a2d5caea">set_right</a>(width);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  page_box.<a class="code" href="a02610.html#a7f40dfd290a907200bdc98c196f63f45">set_top</a>(height);</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="comment">// Filter_blobs sets up the TO_BLOCKs the same as find_components does.</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  tess->mutable_textord()->filter_blobs(page_box.<a class="code" href="a02610.html#af10e637035ec7fa70e00a48dfdd825f0">topright</a>(),</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  &port_blocks, <span class="keyword">true</span>);</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  }</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordflow">return</span> <a class="code" href="a00113.html#a93fedb9cccbbcf81d3433b95bbc46bdd">os_detect</a>(&port_blocks, osr, tess);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> }</div><div class="ttc" id="a02610_html_af10e637035ec7fa70e00a48dfdd825f0"><div class="ttname"><a href="a02610.html#af10e637035ec7fa70e00a48dfdd825f0">TBOX::topright</a></div><div class="ttdeci">const ICOORD & topright() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00104">rect.h:104</a></div></div>
<div class="ttc" id="a02610_html_a7f40dfd290a907200bdc98c196f63f45"><div class="ttname"><a href="a02610.html#a7f40dfd290a907200bdc98c196f63f45">TBOX::set_top</a></div><div class="ttdeci">void set_top(int y)</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00061">rect.h:61</a></div></div>
<div class="ttc" id="a02610_html_a6f803b24b046883cb0f3882dc3d92302"><div class="ttname"><a href="a02610.html#a6f803b24b046883cb0f3882dc3d92302">TBOX::set_bottom</a></div><div class="ttdeci">void set_bottom(int y)</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00068">rect.h:68</a></div></div>
<div class="ttc" id="a02834_html_abf0a7b3c6ae39a46e5441f28f61de5de"><div class="ttname"><a href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">STRING::string</a></div><div class="ttdeci">const char * string() const</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00196">strngs.cpp:196</a></div></div>
<div class="ttc" id="a00113_html_a93fedb9cccbbcf81d3433b95bbc46bdd"><div class="ttname"><a href="a00113.html#a93fedb9cccbbcf81d3433b95bbc46bdd">os_detect</a></div><div class="ttdeci">int os_detect(TO_BLOCK_LIST *port_blocks, OSResults *osr, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00233">osdetect.cpp:233</a></div></div>
<div class="ttc" id="a02610_html"><div class="ttname"><a href="a02610.html">TBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00034">rect.h:34</a></div></div>
<div class="ttc" id="a02610_html_a2246293d3667b28c52a52353a2d5caea"><div class="ttname"><a href="a02610.html#a2246293d3667b28c52a52353a2d5caea">TBOX::set_right</a></div><div class="ttdeci">void set_right(int x)</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00082">rect.h:82</a></div></div>
<div class="ttc" id="a02610_html_ae6151cd794841e100d8a346a0c4a46e6"><div class="ttname"><a href="a02610.html#ae6151cd794841e100d8a346a0c4a46e6">TBOX::set_left</a></div><div class="ttdeci">void set_left(int x)</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00075">rect.h:75</a></div></div>
<div class="ttc" id="a02834_html"><div class="ttname"><a href="a02834.html">STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00584_source.html#l00045">strngs.h:45</a></div></div>
<div class="ttc" id="a00233_html_a74a37aa6889ec51bda0d091767c6ae46"><div class="ttname"><a href="a00233.html#a74a37aa6889ec51bda0d091767c6ae46">read_unlv_file</a></div><div class="ttdeci">bool read_unlv_file(STRING name, int32_t xsize, int32_t ysize, BLOCK_LIST *blocks)</div><div class="ttdef"><b>Definition:</b> <a href="a00233_source.html#l00034">blread.cpp:34</a></div></div>
<div class="ttc" id="a00233_html_a6d4d883ff45201c5b6166b5941cb96a2"><div class="ttname"><a href="a00233.html#a6d4d883ff45201c5b6166b5941cb96a2">FullPageBlock</a></div><div class="ttdeci">void FullPageBlock(int width, int height, BLOCK_LIST *blocks)</div><div class="ttdef"><b>Definition:</b> <a href="a00233_source.html#l00065">blread.cpp:65</a></div></div>
<div class="ttc" id="a00503_html_a93a603f4063a6b9403d81caa245a583b"><div class="ttname"><a href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a></div><div class="ttdeci">#define ASSERT_HOST(x)</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00084">errcode.h:84</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a6d7d4d8dcc0ca1987d6890f2b8b0889e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d7d4d8dcc0ca1987d6890f2b8b0889e">◆ </a></span>OrientationIdToValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00560.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> int OrientationIdToValue </td>
<td>(</td>
<td class="paramtype">const int & </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00113_source.html#l00568">568</a> of file <a class="el" href="a00113_source.html">osdetect.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  {</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  <span class="keywordflow">switch</span> (<span class="keywordtype">id</span>) {</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  <span class="keywordflow">case</span> 0:</div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>  <span class="keywordflow">case</span> 1:</div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span>  <span class="keywordflow">return</span> 270;</div><div class="line"><a name="l00574"></a><span class="lineno"> 574</span>  <span class="keywordflow">case</span> 2:</div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  <span class="keywordflow">return</span> 180;</div><div class="line"><a name="l00576"></a><span class="lineno"> 576</span>  <span class="keywordflow">case</span> 3:</div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span>  <span class="keywordflow">return</span> 90;</div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  }</div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span> }</div></div><!-- fragment -->
</div>
</div>
<a id="a93fedb9cccbbcf81d3433b95bbc46bdd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93fedb9cccbbcf81d3433b95bbc46bdd">◆ </a></span>os_detect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int os_detect </td>
<td>(</td>
<td class="paramtype">TO_BLOCK_LIST * </td>
<td class="paramname"><em>port_blocks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02266.html">OSResults</a> * </td>
<td class="paramname"><em>osr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02358.html">tesseract::Tesseract</a> * </td>
<td class="paramname"><em>tess</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00113_source.html#l00233">233</a> of file <a class="el" href="a00113_source.html">osdetect.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordtype">int</span> blobs_total = 0;</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  TO_BLOCK_IT block_it;</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  block_it.set_to_list(port_blocks);</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  BLOBNBOX_CLIST filtered_list;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  BLOBNBOX_C_IT filtered_it(&filtered_list);</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> </div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keywordflow">for</span> (block_it.mark_cycle_pt(); !block_it.cycled_list();</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  block_it.forward ()) {</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <a class="code" href="a02382.html">TO_BLOCK</a>* to_block = block_it.data();</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">if</span> (to_block-><a class="code" href="a02382.html#a16e698664028b0d6d2193db64560c16b">block</a>-><a class="code" href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">pdblk</a>.<a class="code" href="a02558.html#a87856f8400f0629dc761fec0f7a17b57">poly_block</a>() &&</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  !to_block-><a class="code" href="a02382.html#a16e698664028b0d6d2193db64560c16b">block</a>-><a class="code" href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">pdblk</a>.<a class="code" href="a02558.html#a87856f8400f0629dc761fec0f7a17b57">poly_block</a>()-><a class="code" href="a02582.html#a4eb55be5fc2ed33312e4410f5ee2cf88">IsText</a>()) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  BLOBNBOX_IT bbox_it;</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  bbox_it.set_to_list(&to_block-><a class="code" href="a02382.html#a5dd67c54162a6b60b0fd11500d4a3025">blobs</a>);</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">for</span> (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list ();</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  bbox_it.forward ()) {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <a class="code" href="a02374.html">BLOBNBOX</a>* bbox = bbox_it.data();</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob = bbox-><a class="code" href="a02374.html#a5d497fdc454feff733889db8fe604868">cblob</a>();</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <a class="code" href="a02610.html">TBOX</a> box = blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>();</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  ++blobs_total;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> </div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">// Catch illegal value of box width and avoid division by zero.</span></div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">if</span> (box.<a class="code" href="a02610.html#a70ef69630cbdc605b7b7d5434549d38c">width</a>() == 0) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="comment">// TODO: Can height and width be negative? If not, remove fabs.</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordtype">float</span> y_x = std::fabs((box.<a class="code" href="a02610.html#a72fcb736ed0ddeae95e6a51b3bf8d979">height</a>() * 1.0f) / box.<a class="code" href="a02610.html#a70ef69630cbdc605b7b7d5434549d38c">width</a>());</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordtype">float</span> x_y = 1.0f / y_x;</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="comment">// Select a >= 1.0 ratio</span></div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordtype">float</span> ratio = x_y > y_x ? x_y : y_x;</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="comment">// Blob is ambiguous</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="keywordflow">if</span> (ratio > <a class="code" href="a00113.html#ac23eec99b25d1c109fb6ee2590a331bf">kSizeRatioToReject</a>) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="keywordflow">if</span> (box.<a class="code" href="a02610.html#a72fcb736ed0ddeae95e6a51b3bf8d979">height</a>() < <a class="code" href="a00113.html#aaba53b59683a4788881c7b8281f25fac">kMinAcceptableBlobHeight</a>) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  filtered_it.add_to_end(bbox);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  }</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  }</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">return</span> <a class="code" href="a00113.html#ad5f8904fd2cc2c56563df5c6b0c6cc64">os_detect_blobs</a>(<span class="keyword">nullptr</span>, &filtered_list, osr, tess);</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span> }</div><div class="ttc" id="a02610_html"><div class="ttname"><a href="a02610.html">TBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00034">rect.h:34</a></div></div>
<div class="ttc" id="a02610_html_a70ef69630cbdc605b7b7d5434549d38c"><div class="ttname"><a href="a02610.html#a70ef69630cbdc605b7b7d5434549d38c">TBOX::width</a></div><div class="ttdeci">int16_t width() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00115">rect.h:115</a></div></div>
<div class="ttc" id="a02382_html"><div class="ttname"><a href="a02382.html">TO_BLOCK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00705">blobbox.h:705</a></div></div>
<div class="ttc" id="a02558_html_a87856f8400f0629dc761fec0f7a17b57"><div class="ttname"><a href="a02558.html#a87856f8400f0629dc761fec0f7a17b57">PDBLK::poly_block</a></div><div class="ttdeci">POLY_BLOCK * poly_block() const</div><div class="ttdef"><b>Definition:</b> <a href="a00356_source.html#l00056">pdblock.h:56</a></div></div>
<div class="ttc" id="a02582_html_a4eb55be5fc2ed33312e4410f5ee2cf88"><div class="ttname"><a href="a02582.html#a4eb55be5fc2ed33312e4410f5ee2cf88">POLY_BLOCK::IsText</a></div><div class="ttdeci">bool IsText() const</div><div class="ttdef"><b>Definition:</b> <a href="a00374_source.html#l00049">polyblk.h:49</a></div></div>
<div class="ttc" id="a00113_html_ac23eec99b25d1c109fb6ee2590a331bf"><div class="ttname"><a href="a00113.html#ac23eec99b25d1c109fb6ee2590a331bf">kSizeRatioToReject</a></div><div class="ttdeci">const float kSizeRatioToReject</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00040">osdetect.cpp:40</a></div></div>
<div class="ttc" id="a02382_html_a16e698664028b0d6d2193db64560c16b"><div class="ttname"><a href="a02382.html#a16e698664028b0d6d2193db64560c16b">TO_BLOCK::block</a></div><div class="ttdeci">BLOCK * block</div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00790">blobbox.h:790</a></div></div>
<div class="ttc" id="a02634_html"><div class="ttname"><a href="a02634.html">C_BLOB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00037">stepblob.h:37</a></div></div>
<div class="ttc" id="a02634_html_a50bd7e9c66492bebdba6aadcc806bf93"><div class="ttname"><a href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">C_BLOB::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00434_source.html#l00255">stepblob.cpp:255</a></div></div>
<div class="ttc" id="a02382_html_a5dd67c54162a6b60b0fd11500d4a3025"><div class="ttname"><a href="a02382.html#a5dd67c54162a6b60b0fd11500d4a3025">TO_BLOCK::blobs</a></div><div class="ttdeci">BLOBNBOX_LIST blobs</div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00785">blobbox.h:785</a></div></div>
<div class="ttc" id="a00113_html_aaba53b59683a4788881c7b8281f25fac"><div class="ttname"><a href="a00113.html#aaba53b59683a4788881c7b8281f25fac">kMinAcceptableBlobHeight</a></div><div class="ttdeci">const int kMinAcceptableBlobHeight</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00041">osdetect.cpp:41</a></div></div>
<div class="ttc" id="a02374_html"><div class="ttname"><a href="a02374.html">BLOBNBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00144">blobbox.h:144</a></div></div>
<div class="ttc" id="a02514_html_a9e4346e037f2cc01c3c51d888531da74"><div class="ttname"><a href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">BLOCK::pdblk</a></div><div class="ttdeci">PDBLK pdblk</div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00192">ocrblock.h:192</a></div></div>
<div class="ttc" id="a02610_html_a72fcb736ed0ddeae95e6a51b3bf8d979"><div class="ttname"><a href="a02610.html#a72fcb736ed0ddeae95e6a51b3bf8d979">TBOX::height</a></div><div class="ttdeci">int16_t height() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00108">rect.h:108</a></div></div>
<div class="ttc" id="a02374_html_a5d497fdc454feff733889db8fe604868"><div class="ttname"><a href="a02374.html#a5d497fdc454feff733889db8fe604868">BLOBNBOX::cblob</a></div><div class="ttdeci">C_BLOB * cblob() const</div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00269">blobbox.h:269</a></div></div>
<div class="ttc" id="a00113_html_ad5f8904fd2cc2c56563df5c6b0c6cc64"><div class="ttname"><a href="a00113.html#ad5f8904fd2cc2c56563df5c6b0c6cc64">os_detect_blobs</a></div><div class="ttdeci">int os_detect_blobs(const GenericVector< int > *allowed_scripts, BLOBNBOX_CLIST *blob_list, OSResults *osr, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00278">osdetect.cpp:278</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="acd67dc649eafb2a0048434366730af2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd67dc649eafb2a0048434366730af2e">◆ </a></span>os_detect_blob()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool os_detect_blob </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a02374.html">BLOBNBOX</a> * </td>
<td class="paramname"><em>bbox</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02270.html">OrientationDetector</a> * </td>
<td class="paramname"><em>o</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02274.html">ScriptDetector</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02266.html">OSResults</a> * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02358.html">tesseract::Tesseract</a> * </td>
<td class="paramname"><em>tess</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00113_source.html#l00329">329</a> of file <a class="el" href="a00113_source.html">osdetect.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  {</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  tess-><a class="code" href="a03998.html#a746dbbd1c99e99f3d213077cceedf80e">tess_cn_matching</a>.set_value(<span class="keyword">true</span>); <span class="comment">// turn it on</span></div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  tess-><a class="code" href="a03998.html#a85fcc9966cddbc38adf1014dd0cd778c">tess_bn_matching</a>.set_value(<span class="keyword">false</span>);</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob = bbox-><a class="code" href="a02374.html#a5d497fdc454feff733889db8fe604868">cblob</a>();</div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <a class="code" href="a02398.html">TBLOB</a>* tblob = <a class="code" href="a02398.html#a7b6051e1c1934265a91e1ee864bd5164">TBLOB::PolygonalCopy</a>(tess-><a class="code" href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">poly_allow_detailed_fx</a>, blob);</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <a class="code" href="a02610.html">TBOX</a> box = tblob-><a class="code" href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">bounding_box</a>();</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <a class="code" href="a02578.html">FCOORD</a> current_rotation(1.0f, 0.0f);</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <a class="code" href="a02578.html">FCOORD</a> rotation90(0.0f, 1.0f);</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  BLOB_CHOICE_LIST ratings[4];</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="comment">// Test the 4 orientations</span></div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 4; ++i) {</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <span class="comment">// Normalize the blob. Set the origin to the place we want to be the</span></div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="comment">// bottom-middle after rotation.</span></div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="comment">// Scaling is to make the rotated height the x-height.</span></div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="keywordtype">float</span> scaling = <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(<a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a>) / box.<a class="code" href="a02610.html#a72fcb736ed0ddeae95e6a51b3bf8d979">height</a>();</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordtype">float</span> x_origin = (box.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>() + box.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>()) / 2.0f;</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keywordtype">float</span> y_origin = (box.<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>() + box.<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>()) / 2.0f;</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">if</span> (i == 0 || i == 2) {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="comment">// Rotation is 0 or 180.</span></div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  y_origin = i == 0 ? box.<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>() : box.<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>();</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="comment">// Rotation is 90 or 270.</span></div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  scaling = <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(<a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a>) / box.<a class="code" href="a02610.html#a70ef69630cbdc605b7b7d5434549d38c">width</a>();</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  x_origin = i == 1 ? box.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>() : box.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>();</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  }</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  std::unique_ptr<TBLOB> rotated_blob(<span class="keyword">new</span> <a class="code" href="a02398.html">TBLOB</a>(*tblob));</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  rotated_blob->Normalize(<span class="keyword">nullptr</span>, &current_rotation, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  x_origin, y_origin, scaling, scaling,</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  0.0f, static_cast<float>(<a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>),</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keyword">false</span>, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  tess-><a class="code" href="a03998.html#ab39a42222f621c9a5f1bd1b31db3a930">AdaptiveClassifier</a>(rotated_blob.get(), ratings + i);</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  current_rotation.rotate(rotation90);</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  }</div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keyword">delete</span> tblob;</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span> </div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordtype">bool</span> stop = o-><a class="code" href="a02270.html#a7f3ad682712b5ff3bfcecca0a8a5b086">detect_blob</a>(ratings);</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  s-><a class="code" href="a02274.html#aa1626a91138960515d479a781a6b97ca">detect_blob</a>(ratings);</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keywordtype">int</span> orientation = o-><a class="code" href="a02270.html#a382b5269675f9db848485be62f35742e">get_orientation</a>();</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  stop = s-><a class="code" href="a02274.html#a951bd4d3f5b14ee234d20afc91d44585">must_stop</a>(orientation) && stop;</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="keywordflow">return</span> stop;</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span> }</div><div class="ttc" id="a02274_html_a951bd4d3f5b14ee234d20afc91d44585"><div class="ttname"><a href="a02274.html#a951bd4d3f5b14ee234d20afc91d44585">ScriptDetector::must_stop</a></div><div class="ttdeci">bool must_stop(int orientation)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00560">osdetect.cpp:560</a></div></div>
<div class="ttc" id="a02398_html_a7b6051e1c1934265a91e1ee864bd5164"><div class="ttname"><a href="a02398.html#a7b6051e1c1934265a91e1ee864bd5164">TBLOB::PolygonalCopy</a></div><div class="ttdeci">static TBLOB * PolygonalCopy(bool allow_detailed_fx, C_BLOB *src)</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00337">blobs.cpp:337</a></div></div>
<div class="ttc" id="a03998_html_a746dbbd1c99e99f3d213077cceedf80e"><div class="ttname"><a href="a03998.html#a746dbbd1c99e99f3d213077cceedf80e">tesseract::Classify::tess_cn_matching</a></div><div class="ttdeci">bool tess_cn_matching</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00448">classify.h:448</a></div></div>
<div class="ttc" id="a03998_html_ab39a42222f621c9a5f1bd1b31db3a930"><div class="ttname"><a href="a03998.html#ab39a42222f621c9a5f1bd1b31db3a930">tesseract::Classify::AdaptiveClassifier</a></div><div class="ttdeci">void AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00192">adaptmatch.cpp:192</a></div></div>
<div class="ttc" id="a02610_html"><div class="ttname"><a href="a02610.html">TBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00034">rect.h:34</a></div></div>
<div class="ttc" id="a00314_html_af974e6755e636c8bc7cbe57e3bcbdd73"><div class="ttname"><a href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a></div><div class="ttdeci">const int kBlnXHeight</div><div class="ttdef"><b>Definition:</b> <a href="a00314_source.html#l00024">normalis.h:24</a></div></div>
<div class="ttc" id="a00314_html_abe10ce41bf7240ae8a053dea471d6ed5"><div class="ttname"><a href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a></div><div class="ttdeci">const int kBlnBaselineOffset</div><div class="ttdef"><b>Definition:</b> <a href="a00314_source.html#l00025">normalis.h:25</a></div></div>
<div class="ttc" id="a02610_html_a70ef69630cbdc605b7b7d5434549d38c"><div class="ttname"><a href="a02610.html#a70ef69630cbdc605b7b7d5434549d38c">TBOX::width</a></div><div class="ttdeci">int16_t width() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00115">rect.h:115</a></div></div>
<div class="ttc" id="a02610_html_a8e9dce0d30d2213598cd4befe0028c99"><div class="ttname"><a href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">TBOX::left</a></div><div class="ttdeci">int16_t left() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00072">rect.h:72</a></div></div>
<div class="ttc" id="a02610_html_a5dc64d0677b5d65385bc07a78cf49c4d"><div class="ttname"><a href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">TBOX::top</a></div><div class="ttdeci">int16_t top() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00058">rect.h:58</a></div></div>
<div class="ttc" id="a03998_html_a85fcc9966cddbc38adf1014dd0cd778c"><div class="ttname"><a href="a03998.html#a85fcc9966cddbc38adf1014dd0cd778c">tesseract::Classify::tess_bn_matching</a></div><div class="ttdeci">bool tess_bn_matching</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00449">classify.h:449</a></div></div>
<div class="ttc" id="a02274_html_aa1626a91138960515d479a781a6b97ca"><div class="ttname"><a href="a02274.html#aa1626a91138960515d479a781a6b97ca">ScriptDetector::detect_blob</a></div><div class="ttdeci">void detect_blob(BLOB_CHOICE_LIST *scores)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00471">osdetect.cpp:471</a></div></div>
<div class="ttc" id="a02398_html_a56599f0cc0c2eb73d9c5fd490f03fc56"><div class="ttname"><a href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">TBLOB::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00478">blobs.cpp:478</a></div></div>
<div class="ttc" id="a02634_html"><div class="ttname"><a href="a02634.html">C_BLOB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00037">stepblob.h:37</a></div></div>
<div class="ttc" id="a02578_html"><div class="ttname"><a href="a02578.html">FCOORD</a></div><div class="ttdef"><b>Definition:</b> <a href="a00362_source.html#l00189">points.h:189</a></div></div>
<div class="ttc" id="a02270_html_a382b5269675f9db848485be62f35742e"><div class="ttname"><a href="a02270.html#a382b5269675f9db848485be62f35742e">OrientationDetector::get_orientation</a></div><div class="ttdeci">int get_orientation()</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00447">osdetect.cpp:447</a></div></div>
<div class="ttc" id="a02270_html_a7f3ad682712b5ff3bfcecca0a8a5b086"><div class="ttname"><a href="a02270.html#a7f3ad682712b5ff3bfcecca0a8a5b086">OrientationDetector::detect_blob</a></div><div class="ttdeci">bool detect_blob(BLOB_CHOICE_LIST *scores)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00382">osdetect.cpp:382</a></div></div>
<div class="ttc" id="a02610_html_af74fa3bf628c9426cd6f1141a87dc2e0"><div class="ttname"><a href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">TBOX::right</a></div><div class="ttdeci">int16_t right() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00079">rect.h:79</a></div></div>
<div class="ttc" id="a02398_html"><div class="ttname"><a href="a02398.html">TBLOB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00230_source.html#l00268">blobs.h:268</a></div></div>
<div class="ttc" id="a02610_html_a9fee4521e71300975cb34ebb21e3fca5"><div class="ttname"><a href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">TBOX::bottom</a></div><div class="ttdeci">int16_t bottom() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00065">rect.h:65</a></div></div>
<div class="ttc" id="a02610_html_a72fcb736ed0ddeae95e6a51b3bf8d979"><div class="ttname"><a href="a02610.html#a72fcb736ed0ddeae95e6a51b3bf8d979">TBOX::height</a></div><div class="ttdeci">int16_t height() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00108">rect.h:108</a></div></div>
<div class="ttc" id="a02374_html_a5d497fdc454feff733889db8fe604868"><div class="ttname"><a href="a02374.html#a5d497fdc454feff733889db8fe604868">BLOBNBOX::cblob</a></div><div class="ttdeci">C_BLOB * cblob() const</div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00269">blobbox.h:269</a></div></div>
<div class="ttc" id="a02358_html_ae1206c0c4b63a008cc01650004fb7b03"><div class="ttname"><a href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">tesseract::Tesseract::poly_allow_detailed_fx</a></div><div class="ttdeci">bool poly_allow_detailed_fx</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01103">tesseractclass.h:1103</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ad5f8904fd2cc2c56563df5c6b0c6cc64"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5f8904fd2cc2c56563df5c6b0c6cc64">◆ </a></span>os_detect_blobs()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int os_detect_blobs </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a02182.html">GenericVector</a>< int > * </td>
<td class="paramname"><em>allowed_scripts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">BLOBNBOX_CLIST * </td>
<td class="paramname"><em>blob_list</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02266.html">OSResults</a> * </td>
<td class="paramname"><em>osr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a02358.html">tesseract::Tesseract</a> * </td>
<td class="paramname"><em>tess</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00113_source.html#l00278">278</a> of file <a class="el" href="a00113_source.html">osdetect.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  {</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <a class="code" href="a02266.html">OSResults</a> osr_;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="keywordtype">int</span> minCharactersToTry = tess-><a class="code" href="a02358.html#ad279c29c81fe7b8c10099639d243f805">min_characters_to_try</a>;</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordtype">int</span> maxCharactersToTry = 5 * minCharactersToTry;</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keywordflow">if</span> (osr == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  osr = &osr_;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  osr-><a class="code" href="a02266.html#a78ebdae52f3c685095b56790598ad97c">unicharset</a> = &tess-><a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>;</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <a class="code" href="a02270.html">OrientationDetector</a> o(allowed_scripts, osr);</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <a class="code" href="a02274.html">ScriptDetector</a> s(allowed_scripts, osr, tess);</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> </div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  BLOBNBOX_C_IT filtered_it(blob_list);</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <span class="keywordtype">int</span> real_max = std::min(filtered_it.length(), maxCharactersToTry);</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="comment">// tprintf("Total blobs found = %d\n", blobs_total);</span></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="comment">// tprintf("Number of blobs post-filtering = %d\n", filtered_it.length());</span></div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="comment">// tprintf("Number of blobs to try = %d\n", real_max);</span></div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> </div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <span class="comment">// If there are too few characters, skip this page entirely.</span></div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keywordflow">if</span> (real_max < minCharactersToTry / 2) {</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Too few characters. Skipping this page\n"</span>);</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  }</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> </div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <a class="code" href="a02374.html">BLOBNBOX</a>** blobs = <span class="keyword">new</span> <a class="code" href="a02374.html">BLOBNBOX</a>*[filtered_it.length()];</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="keywordtype">int</span> number_of_blobs = 0;</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keywordflow">for</span> (filtered_it.mark_cycle_pt (); !filtered_it.cycled_list ();</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  filtered_it.forward ()) {</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  blobs[number_of_blobs++] = (<a class="code" href="a02374.html">BLOBNBOX</a>*)filtered_it.data();</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  }</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <a class="code" href="a02818.html">QRSequenceGenerator</a> sequence(number_of_blobs);</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordtype">int</span> num_blobs_evaluated = 0;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < real_max; ++i) {</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keywordflow">if</span> (<a class="code" href="a00113.html#a35fb2b0177ed2a774307373aeb7b13d1">os_detect_blob</a>(blobs[sequence.GetVal()], &o, &s, osr, tess)</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  && i > minCharactersToTry) {</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  }</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  ++num_blobs_evaluated;</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  }</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keyword">delete</span> [] blobs;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span> </div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="comment">// Make sure the best_result is up-to-date</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keywordtype">int</span> orientation = o.get_orientation();</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  osr-><a class="code" href="a02266.html#ab796da60cc16d39f464c03fe4047c358">update_best_script</a>(orientation);</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="keywordflow">return</span> num_blobs_evaluated;</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span> }</div><div class="ttc" id="a02266_html_a78ebdae52f3c685095b56790598ad97c"><div class="ttname"><a href="a02266.html#a78ebdae52f3c685095b56790598ad97c">OSResults::unicharset</a></div><div class="ttdeci">UNICHARSET * unicharset</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00080">osdetect.h:80</a></div></div>
<div class="ttc" id="a00113_html_a35fb2b0177ed2a774307373aeb7b13d1"><div class="ttname"><a href="a00113.html#a35fb2b0177ed2a774307373aeb7b13d1">os_detect_blob</a></div><div class="ttdeci">bool os_detect_blob(BLOBNBOX *bbox, OrientationDetector *o, ScriptDetector *s, OSResults *osr, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00329">osdetect.cpp:329</a></div></div>
<div class="ttc" id="a02266_html_ab796da60cc16d39f464c03fe4047c358"><div class="ttname"><a href="a02266.html#ab796da60cc16d39f464c03fe4047c358">OSResults::update_best_script</a></div><div class="ttdeci">void update_best_script(int orientation_id)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00089">osdetect.cpp:89</a></div></div>
<div class="ttc" id="a02818_html"><div class="ttname"><a href="a02818.html">QRSequenceGenerator</a></div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00032">qrsequence.h:32</a></div></div>
<div class="ttc" id="a02666_html_a69c5179ac5f10a24f3f97e16ca09460f"><div class="ttname"><a href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">tesseract::CCUtil::unicharset</a></div><div class="ttdeci">UNICHARSET unicharset</div><div class="ttdef"><b>Definition:</b> <a href="a00476_source.html#l00068">ccutil.h:68</a></div></div>
<div class="ttc" id="a02270_html"><div class="ttname"><a href="a02270.html">OrientationDetector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00084">osdetect.h:84</a></div></div>
<div class="ttc" id="a02358_html_ad279c29c81fe7b8c10099639d243f805"><div class="ttname"><a href="a02358.html#ad279c29c81fe7b8c10099639d243f805">tesseract::Tesseract::min_characters_to_try</a></div><div class="ttdeci">int min_characters_to_try</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01047">tesseractclass.h:1047</a></div></div>
<div class="ttc" id="a00596_html_a0c2bcd4462ec67ab0971b34a0f610f55"><div class="ttname"><a href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a></div><div class="ttdeci">DLLSYM void tprintf(const char *format,...)</div><div class="ttdef"><b>Definition:</b> <a href="a00596_source.html#l00037">tprintf.cpp:37</a></div></div>
<div class="ttc" id="a02266_html"><div class="ttname"><a href="a02266.html">OSResults</a></div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00049">osdetect.h:49</a></div></div>
<div class="ttc" id="a02374_html"><div class="ttname"><a href="a02374.html">BLOBNBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00144">blobbox.h:144</a></div></div>
<div class="ttc" id="a02274_html"><div class="ttname"><a href="a02274.html">ScriptDetector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00095">osdetect.h:95</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ab52d878a730b63bcf57d7bb3113882a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab52d878a730b63bcf57d7bb3113882a1">◆ </a></span>kMaxNumberOfScripts</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const int kMaxNumberOfScripts = 116 + 1 + 2 + 1</td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="a00116_source.html#l00038">38</a> of file <a class="el" href="a00116_source.html">osdetect.h</a>.</p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_fce9a394c0d2c636e610a0a34fe30580.html">tesseract-ocr.master</a></li><li class="navelem"><a class="el" href="dir_fd2783e80b2d56815818e17a68fc4d98.html">src</a></li><li class="navelem"><a class="el" href="dir_f676e76c9a53ee7edd5046de803da784.html">ccmain</a></li><li class="navelem"><a class="el" href="a00116.html">osdetect.h</a></li>
<li class="footer">Generated on Mon Oct 29 2018 11:03:51 for tesseract by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>