-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00023_source.html
281 lines (279 loc) · 40.8 KB
/
a00023_source.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /tesseract/include/tesseract/osdetect.h Source File</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">5.0.0-alpha-619-ge9db</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<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('a00023_source.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="headertitle">
<div class="title">osdetect.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00023.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// File: osdetect.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// Description: Orientation and script detection.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// Author: Samuel Charron</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// Ranjith Unnikrishnan</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">//</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// (C) Copyright 2008, Google Inc.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"></span> </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#ifndef TESSERACT_CCMAIN_OSDETECT_H_</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#define TESSERACT_CCMAIN_OSDETECT_H_</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="a00029.html">platform.h</a>"</span> <span class="comment">// for TESS_API</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">class </span><a class="code" href="a02666.html">BLOBNBOX</a>;</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">class </span>BLOBNBOX_CLIST;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">class </span>BLOB_CHOICE_LIST;</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">class </span><a class="code" href="a02542.html">STRING</a>;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">class </span>TO_BLOCK_LIST;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">class </span><a class="code" href="a03118.html">UNICHARSET</a>;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">class </span><a class="code" href="a02434.html">GenericVector</a>;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">namespace </span><a class="code" href="a01818.html">tesseract</a> {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">class </span>Tesseract;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> }</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// Max number of scripts in ICU + "NULL" + Japanese and Korean + Fraktur</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="a00023.html#ab52d878a730b63bcf57d7bb3113882a1"> 39</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a00023.html#ab52d878a730b63bcf57d7bb3113882a1">kMaxNumberOfScripts</a> = 116 + 1 + 2 + 1;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="a02470.html"> 41</a></span> <span class="keyword">struct </span><a class="code" href="a02470.html">OSBestResult</a> {</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="a02470.html#a516db80da6727056f92664053e6d34af"> 42</a></span>  <a class="code" href="a02470.html#a516db80da6727056f92664053e6d34af">OSBestResult</a>()</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  : <a class="code" href="a02470.html#a6dfb6826b41a81524ce867b005ba5641">orientation_id</a>(0), <a class="code" href="a02470.html#a0647ea3dc4a399a472c48ab1eacd31e1">script_id</a>(0), <a class="code" href="a02470.html#ae39a2c718b010ed27eb7f820546da6d6">sconfidence</a>(0.0), <a class="code" href="a02470.html#a67e009467e4db6c40777548ffdfe464e">oconfidence</a>(0.0) {}</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="a02470.html#a6dfb6826b41a81524ce867b005ba5641"> 44</a></span>  <span class="keywordtype">int</span> <a class="code" href="a02470.html#a6dfb6826b41a81524ce867b005ba5641">orientation_id</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="a02470.html#a0647ea3dc4a399a472c48ab1eacd31e1"> 45</a></span>  <span class="keywordtype">int</span> <a class="code" href="a02470.html#a0647ea3dc4a399a472c48ab1eacd31e1">script_id</a>;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="a02470.html#ae39a2c718b010ed27eb7f820546da6d6"> 46</a></span>  <span class="keywordtype">float</span> <a class="code" href="a02470.html#ae39a2c718b010ed27eb7f820546da6d6">sconfidence</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="a02470.html#a67e009467e4db6c40777548ffdfe464e"> 47</a></span>  <span class="keywordtype">float</span> <a class="code" href="a02470.html#a67e009467e4db6c40777548ffdfe464e">oconfidence</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> };</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a02474.html"> 50</a></span> <span class="keyword">struct </span><a class="code" href="a02474.html">OSResults</a> {</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="a02474.html#a08aa76cac72da5479bf32789dcc511dc"> 51</a></span>  <a class="code" href="a02474.html#a08aa76cac72da5479bf32789dcc511dc">OSResults</a>() : <a class="code" href="a02474.html#a78ebdae52f3c685095b56790598ad97c">unicharset</a>(nullptr) {</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 4; ++i) {</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < <a class="code" href="a00023.html#ab52d878a730b63bcf57d7bb3113882a1">kMaxNumberOfScripts</a>; ++j) <a class="code" href="a02474.html#af612cc25d8432678d5b87a5911544792">scripts_na</a>[i][j] = 0;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="a02474.html#a5fe9fa97000f89cd6f4392b55638e882">orientations</a>[i] = 0;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  }</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#af7b5cea89a2bdace52ad5825d6d5d4e6">update_best_orientation</a>();</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="comment">// Set the estimate of the orientation to the given id.</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#aa13f0e8c136d10e0af341f163951ed3d">set_best_orientation</a>(<span class="keywordtype">int</span> orientation_id);</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="comment">// Update/Compute the best estimate of the script assuming the given</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment">// orientation id.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#ab796da60cc16d39f464c03fe4047c358">update_best_script</a>(<span class="keywordtype">int</span> orientation_id);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="comment">// Return the index of the script with the highest score for this orientation.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="a00029.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <span class="keywordtype">int</span> <a class="code" href="a02474.html#ad92dc2530b0b907d6bbdafd50bc042e8">get_best_script</a>(<span class="keywordtype">int</span> orientation_id) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="comment">// Accumulate scores with given OSResults instance and update the best script.</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#a25b4edef21699b3a367d7978733595be">accumulate</a>(<span class="keyword">const</span> <a class="code" href="a02474.html">OSResults</a>& osr);</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">// Print statistics.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#ae041af033010cb111f0e46508eb5544e">print_scores</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordtype">void</span> <a class="code" href="a02474.html#ae041af033010cb111f0e46508eb5544e">print_scores</a>(<span class="keywordtype">int</span> orientation_id) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="comment">// Array holding scores for each orientation id [0,3].</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="comment">// Orientation ids [0..3] map to [0, 270, 180, 90] degree orientations of the</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="comment">// page respectively, where the values refer to the amount of clockwise</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">// rotation to be applied to the page for the text to be upright and readable.</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="a02474.html#a5fe9fa97000f89cd6f4392b55638e882"> 76</a></span>  <span class="keywordtype">float</span> <a class="code" href="a02474.html#a5fe9fa97000f89cd6f4392b55638e882">orientations</a>[4];</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="comment">// Script confidence scores for each of 4 possible orientations.</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="a02474.html#af612cc25d8432678d5b87a5911544792"> 78</a></span>  <span class="keywordtype">float</span> <a class="code" href="a02474.html#af612cc25d8432678d5b87a5911544792">scripts_na</a>[4][<a class="code" href="a00023.html#ab52d878a730b63bcf57d7bb3113882a1">kMaxNumberOfScripts</a>];</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="a02474.html#a78ebdae52f3c685095b56790598ad97c"> 80</a></span>  <a class="code" href="a03118.html">UNICHARSET</a>* <a class="code" href="a02474.html#a78ebdae52f3c685095b56790598ad97c">unicharset</a>;</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="a02474.html#a25f64011ea65c038c1ef1a6cedd10f1c"> 81</a></span>  <a class="code" href="a02470.html">OSBestResult</a> <a class="code" href="a02474.html#a25f64011ea65c038c1ef1a6cedd10f1c">best_result</a>;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> };</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="a02478.html"> 84</a></span> <span class="keyword">class </span><a class="code" href="a02478.html">OrientationDetector</a> {</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="a02478.html#a829b39f0118e0dc66ac2b06e22222f5c">OrientationDetector</a>(<span class="keyword">const</span> <a class="code" href="a02434.html">GenericVector<int></a>* allowed_scripts,</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="a02474.html">OSResults</a>* results);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordtype">bool</span> <a class="code" href="a02478.html#a7f3ad682712b5ff3bfcecca0a8a5b086">detect_blob</a>(BLOB_CHOICE_LIST* scores);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordtype">int</span> <a class="code" href="a02478.html#a382b5269675f9db848485be62f35742e">get_orientation</a>();</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="a02474.html">OSResults</a>* osr_;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">const</span> <a class="code" href="a02434.html">GenericVector<int></a>* allowed_scripts_;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> };</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  </div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="a02482.html"> 96</a></span> <span class="keyword">class </span><a class="code" href="a02482.html">ScriptDetector</a> {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="a02482.html#a79efaad57044bbfcd391efc5eb4e9fc8">ScriptDetector</a>(<span class="keyword">const</span> <a class="code" href="a02434.html">GenericVector<int></a>* allowed_scripts, <a class="code" href="a02474.html">OSResults</a>* osr,</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="a02658.html">tesseract::Tesseract</a>* tess);</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordtype">void</span> <a class="code" href="a02482.html#aa1626a91138960515d479a781a6b97ca">detect_blob</a>(BLOB_CHOICE_LIST* scores);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordtype">bool</span> <a class="code" href="a02482.html#a951bd4d3f5b14ee234d20afc91d44585">must_stop</a>(<span class="keywordtype">int</span> orientation);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="a02474.html">OSResults</a>* osr_;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* korean_script_;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* japanese_script_;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* fraktur_script_;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordtype">int</span> korean_id_;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordtype">int</span> japanese_id_;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordtype">int</span> katakana_id_;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordtype">int</span> hiragana_id_;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordtype">int</span> han_id_;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordtype">int</span> hangul_id_;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordtype">int</span> latin_id_;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordtype">int</span> fraktur_id_;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="a02658.html">tesseract::Tesseract</a>* tess_;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keyword">const</span> <a class="code" href="a02434.html">GenericVector<int></a>* allowed_scripts_;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> };</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">int</span> <a class="code" href="a00023.html#af7ea57b0e1847f524c98576cb5cace43">orientation_and_script_detection</a>(<a class="code" href="a02542.html">STRING</a>& filename, <a class="code" href="a02474.html">OSResults</a>*,</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="a02658.html">tesseract::Tesseract</a>*);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="keywordtype">int</span> <a class="code" href="a00023.html#a93fedb9cccbbcf81d3433b95bbc46bdd">os_detect</a>(TO_BLOCK_LIST* port_blocks, <a class="code" href="a02474.html">OSResults</a>* osr,</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <a class="code" href="a02658.html">tesseract::Tesseract</a>* tess);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keywordtype">int</span> <a class="code" href="a00023.html#ad5f8904fd2cc2c56563df5c6b0c6cc64">os_detect_blobs</a>(<span class="keyword">const</span> <a class="code" href="a02434.html">GenericVector<int></a>* allowed_scripts,</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  BLOBNBOX_CLIST* blob_list, <a class="code" href="a02474.html">OSResults</a>* osr,</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="a02658.html">tesseract::Tesseract</a>* tess);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  </div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="keywordtype">bool</span> <a class="code" href="a00023.html#acd67dc649eafb2a0048434366730af2e">os_detect_blob</a>(<a class="code" href="a02666.html">BLOBNBOX</a>* bbox, <a class="code" href="a02478.html">OrientationDetector</a>* o, <a class="code" href="a02482.html">ScriptDetector</a>* s,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="a02474.html">OSResults</a>*, <a class="code" href="a02658.html">tesseract::Tesseract</a>* tess);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// Helper method to convert an orientation index to its value in degrees.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// The value represents the amount of clockwise rotation in degrees that must be</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="comment">// applied for the text to be upright (readable).</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <a class="code" href="a00029.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a> <span class="keywordtype">int</span> <a class="code" href="a00023.html#a6d7d4d8dcc0ca1987d6890f2b8b0889e">OrientationIdToValue</a>(<span class="keyword">const</span> <span class="keywordtype">int</span>& <span class="keywordtype">id</span>);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="preprocessor">#endif // TESSERACT_CCMAIN_OSDETECT_H_</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa00023_html_a93fedb9cccbbcf81d3433b95bbc46bdd"><div class="ttname"><a href="a00023.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="a00158_source.html#l00233">osdetect.cpp:233</a></div></div>
<div class="ttc" id="aa00023_html_ad5f8904fd2cc2c56563df5c6b0c6cc64"><div class="ttname"><a href="a00023.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="a00158_source.html#l00278">osdetect.cpp:278</a></div></div>
<div class="ttc" id="aa02474_html_a25f64011ea65c038c1ef1a6cedd10f1c"><div class="ttname"><a href="a02474.html#a25f64011ea65c038c1ef1a6cedd10f1c">OSResults::best_result</a></div><div class="ttdeci">OSBestResult best_result</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00081">osdetect.h:81</a></div></div>
<div class="ttc" id="aa00023_html_acd67dc649eafb2a0048434366730af2e"><div class="ttname"><a href="a00023.html#acd67dc649eafb2a0048434366730af2e">os_detect_blob</a></div><div class="ttdeci">bool os_detect_blob(BLOBNBOX *bbox, OrientationDetector *o, ScriptDetector *s, OSResults *, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00329">osdetect.cpp:329</a></div></div>
<div class="ttc" id="aa02478_html"><div class="ttname"><a href="a02478.html">OrientationDetector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00084">osdetect.h:84</a></div></div>
<div class="ttc" id="aa00023_html_a6d7d4d8dcc0ca1987d6890f2b8b0889e"><div class="ttname"><a href="a00023.html#a6d7d4d8dcc0ca1987d6890f2b8b0889e">OrientationIdToValue</a></div><div class="ttdeci">TESS_API int OrientationIdToValue(const int &id)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00566">osdetect.cpp:566</a></div></div>
<div class="ttc" id="aa02470_html_a0647ea3dc4a399a472c48ab1eacd31e1"><div class="ttname"><a href="a02470.html#a0647ea3dc4a399a472c48ab1eacd31e1">OSBestResult::script_id</a></div><div class="ttdeci">int script_id</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00045">osdetect.h:45</a></div></div>
<div class="ttc" id="aa02658_html"><div class="ttname"><a href="a02658.html">tesseract::Tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00224_source.html#l00172">tesseractclass.h:172</a></div></div>
<div class="ttc" id="aa02474_html_af7b5cea89a2bdace52ad5825d6d5d4e6"><div class="ttname"><a href="a02474.html#af7b5cea89a2bdace52ad5825d6d5d4e6">OSResults::update_best_orientation</a></div><div class="ttdeci">void update_best_orientation()</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00062">osdetect.cpp:62</a></div></div>
<div class="ttc" id="aa00029_html"><div class="ttname"><a href="a00029.html">platform.h</a></div></div>
<div class="ttc" id="aa02474_html"><div class="ttname"><a href="a02474.html">OSResults</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00050">osdetect.h:50</a></div></div>
<div class="ttc" id="aa02542_html"><div class="ttname"><a href="a02542.html">STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00044_source.html#l00045">strngs.h:45</a></div></div>
<div class="ttc" id="aa00023_html_ab52d878a730b63bcf57d7bb3113882a1"><div class="ttname"><a href="a00023.html#ab52d878a730b63bcf57d7bb3113882a1">kMaxNumberOfScripts</a></div><div class="ttdeci">const int kMaxNumberOfScripts</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00039">osdetect.h:39</a></div></div>
<div class="ttc" id="aa02474_html_a78ebdae52f3c685095b56790598ad97c"><div class="ttname"><a href="a02474.html#a78ebdae52f3c685095b56790598ad97c">OSResults::unicharset</a></div><div class="ttdeci">UNICHARSET * unicharset</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00080">osdetect.h:80</a></div></div>
<div class="ttc" id="aa02474_html_ad92dc2530b0b907d6bbdafd50bc042e8"><div class="ttname"><a href="a02474.html#ad92dc2530b0b907d6bbdafd50bc042e8">OSResults::get_best_script</a></div><div class="ttdeci">TESS_API int get_best_script(int orientation_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00112">osdetect.cpp:112</a></div></div>
<div class="ttc" id="aa02474_html_ae041af033010cb111f0e46508eb5544e"><div class="ttname"><a href="a02474.html#ae041af033010cb111f0e46508eb5544e">OSResults::print_scores</a></div><div class="ttdeci">void print_scores(void) const</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00126">osdetect.cpp:126</a></div></div>
<div class="ttc" id="aa02666_html"><div class="ttname"><a href="a02666.html">BLOBNBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00254_source.html#l00142">blobbox.h:142</a></div></div>
<div class="ttc" id="aa02470_html_a516db80da6727056f92664053e6d34af"><div class="ttname"><a href="a02470.html#a516db80da6727056f92664053e6d34af">OSBestResult::OSBestResult</a></div><div class="ttdeci">OSBestResult()</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00042">osdetect.h:42</a></div></div>
<div class="ttc" id="aa02470_html_a6dfb6826b41a81524ce867b005ba5641"><div class="ttname"><a href="a02470.html#a6dfb6826b41a81524ce867b005ba5641">OSBestResult::orientation_id</a></div><div class="ttdeci">int orientation_id</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00044">osdetect.h:44</a></div></div>
<div class="ttc" id="aa02474_html_a08aa76cac72da5479bf32789dcc511dc"><div class="ttname"><a href="a02474.html#a08aa76cac72da5479bf32789dcc511dc">OSResults::OSResults</a></div><div class="ttdeci">OSResults()</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00051">osdetect.h:51</a></div></div>
<div class="ttc" id="aa02474_html_af612cc25d8432678d5b87a5911544792"><div class="ttname"><a href="a02474.html#af612cc25d8432678d5b87a5911544792">OSResults::scripts_na</a></div><div class="ttdeci">float scripts_na[4][kMaxNumberOfScripts]</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00078">osdetect.h:78</a></div></div>
<div class="ttc" id="aa02470_html_a67e009467e4db6c40777548ffdfe464e"><div class="ttname"><a href="a02470.html#a67e009467e4db6c40777548ffdfe464e">OSBestResult::oconfidence</a></div><div class="ttdeci">float oconfidence</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00047">osdetect.h:47</a></div></div>
<div class="ttc" id="aa03118_html"><div class="ttname"><a href="a03118.html">UNICHARSET</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00145">unicharset.h:145</a></div></div>
<div class="ttc" id="aa02474_html_aa13f0e8c136d10e0af341f163951ed3d"><div class="ttname"><a href="a02474.html#aa13f0e8c136d10e0af341f163951ed3d">OSResults::set_best_orientation</a></div><div class="ttdeci">void set_best_orientation(int orientation_id)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00084">osdetect.cpp:84</a></div></div>
<div class="ttc" id="aa01818_html"><div class="ttname"><a href="a01818.html">tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00065">baseapi.h:65</a></div></div>
<div class="ttc" id="aa02474_html_a5fe9fa97000f89cd6f4392b55638e882"><div class="ttname"><a href="a02474.html#a5fe9fa97000f89cd6f4392b55638e882">OSResults::orientations</a></div><div class="ttdeci">float orientations[4]</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00076">osdetect.h:76</a></div></div>
<div class="ttc" id="aa02482_html_aa1626a91138960515d479a781a6b97ca"><div class="ttname"><a href="a02482.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="a00158_source.html#l00471">osdetect.cpp:471</a></div></div>
<div class="ttc" id="aa02434_html"><div class="ttname"><a href="a02434.html">GenericVector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00040">baseapi.h:40</a></div></div>
<div class="ttc" id="aa02478_html_a829b39f0118e0dc66ac2b06e22222f5c"><div class="ttname"><a href="a02478.html#a829b39f0118e0dc66ac2b06e22222f5c">OrientationDetector::OrientationDetector</a></div><div class="ttdeci">OrientationDetector(const GenericVector< int > *allowed_scripts, OSResults *results)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00374">osdetect.cpp:374</a></div></div>
<div class="ttc" id="aa00023_html_af7ea57b0e1847f524c98576cb5cace43"><div class="ttname"><a href="a00023.html#af7ea57b0e1847f524c98576cb5cace43">orientation_and_script_detection</a></div><div class="ttdeci">int orientation_and_script_detection(STRING &filename, OSResults *, tesseract::Tesseract *)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00190">osdetect.cpp:190</a></div></div>
<div class="ttc" id="aa02474_html_ab796da60cc16d39f464c03fe4047c358"><div class="ttname"><a href="a02474.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="a00158_source.html#l00089">osdetect.cpp:89</a></div></div>
<div class="ttc" id="aa02478_html_a382b5269675f9db848485be62f35742e"><div class="ttname"><a href="a02478.html#a382b5269675f9db848485be62f35742e">OrientationDetector::get_orientation</a></div><div class="ttdeci">int get_orientation()</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00447">osdetect.cpp:447</a></div></div>
<div class="ttc" id="aa02482_html_a79efaad57044bbfcd391efc5eb4e9fc8"><div class="ttname"><a href="a02482.html#a79efaad57044bbfcd391efc5eb4e9fc8">ScriptDetector::ScriptDetector</a></div><div class="ttdeci">ScriptDetector(const GenericVector< int > *allowed_scripts, OSResults *osr, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00453">osdetect.cpp:453</a></div></div>
<div class="ttc" id="aa02482_html"><div class="ttname"><a href="a02482.html">ScriptDetector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00096">osdetect.h:96</a></div></div>
<div class="ttc" id="aa00029_html_a86e51270628c53ce7e2c23b1c2b4490e"><div class="ttname"><a href="a00029.html#a86e51270628c53ce7e2c23b1c2b4490e">TESS_API</a></div><div class="ttdeci">#define TESS_API</div><div class="ttdef"><b>Definition:</b> <a href="a00029_source.html#l00054">platform.h:54</a></div></div>
<div class="ttc" id="aa02470_html_ae39a2c718b010ed27eb7f820546da6d6"><div class="ttname"><a href="a02470.html#ae39a2c718b010ed27eb7f820546da6d6">OSBestResult::sconfidence</a></div><div class="ttdeci">float sconfidence</div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00046">osdetect.h:46</a></div></div>
<div class="ttc" id="aa02470_html"><div class="ttname"><a href="a02470.html">OSBestResult</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00041">osdetect.h:41</a></div></div>
<div class="ttc" id="aa02474_html_a25b4edef21699b3a367d7978733595be"><div class="ttname"><a href="a02474.html#a25b4edef21699b3a367d7978733595be">OSResults::accumulate</a></div><div class="ttdeci">void accumulate(const OSResults &osr)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00144">osdetect.cpp:144</a></div></div>
<div class="ttc" id="aa02478_html_a7f3ad682712b5ff3bfcecca0a8a5b086"><div class="ttname"><a href="a02478.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="a00158_source.html#l00382">osdetect.cpp:382</a></div></div>
<div class="ttc" id="aa02482_html_a951bd4d3f5b14ee234d20afc91d44585"><div class="ttname"><a href="a02482.html#a951bd4d3f5b14ee234d20afc91d44585">ScriptDetector::must_stop</a></div><div class="ttdeci">bool must_stop(int orientation)</div><div class="ttdef"><b>Definition:</b> <a href="a00158_source.html#l00558">osdetect.cpp:558</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_00200a555532e7ec3afbcddd6091e65a.html">tesseract</a></li><li class="navelem"><a class="el" href="a00023.html">osdetect.h</a></li>
<li class="footer">Generated on Thu Jan 30 2020 14:22:19 for tesseract by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li>
</ul>
</div>
</body>
</html>