-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00095_source.html
145 lines (143 loc) · 57.2 KB
/
a00095_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
<!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/fixxht.cpp 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">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('a00095_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">fixxht.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00095.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">/**********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * File: fixxht.cpp (Formerly fixxht.c)</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Description: Improve x_ht and look out for case inconsistencies</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Author: Phil Cheatle</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Created: Thu Aug 5 14:11:08 BST 1993</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 1992, Hewlett-Packard Ltd.</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="l00018"></a><span class="lineno"> 18</span> <span class="comment"> **********************************************************************/</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <algorithm></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <cstring></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <cctype></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="a00557.html">params.h</a>"</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="a00695.html">float2int.h</a>"</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="a00191.html">tesseractclass.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">namespace </span><a class="code" href="a01629.html">tesseract</a> {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// Fixxht overview.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">// Premise: Initial estimate of x-height is adequate most of the time, but</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// occasionally it is incorrect. Most notable causes of failure are:</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">// 1. Small caps, where the top of the caps is the same as the body text</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// xheight. For small caps words the xheight needs to be reduced to correctly</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// recognize the caps in the small caps word.</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// 2. All xheight lines, such as summer. Here the initial estimate will have</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// guessed that the blob tops are caps and will have placed the xheight too low.</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// 3. Noise/logos beside words, or changes in font size on a line. Such</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// things can blow the statistics and cause an incorrect estimate.</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// 4. Incorrect baseline. Can happen when 2 columns are incorrectly merged.</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// In this case the x-height is often still correct.</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">//</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// Algorithm.</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Compare the vertical position (top only) of alphnumerics in a word with</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// the range of positions in training data (in the unicharset).</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// See CountMisfitTops. If any characters disagree sufficiently with the</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment">// initial xheight estimate, then recalculate the xheight, re-run OCR on</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// the word, and if the number of vertical misfits goes down, along with</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// either the word rating or certainty, then keep the new xheight.</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// The new xheight is calculated as follows:ComputeCompatibleXHeight</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="comment">// For each alphanumeric character that has a vertically misplaced top</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// (a misfit), yet its bottom is within the acceptable range (ie it is not</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="comment">// likely a sub-or super-script) calculate the range of acceptable xheight</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// positions from its range of tops, and give each value in the range a</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment">// number of votes equal to the distance of its top from its acceptance range.</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment">// The x-height position with the median of the votes becomes the new</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// x-height. This assumes that most characters will be correctly recognized</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// even if the x-height is incorrect. This is not a terrible assumption, but</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// it is not great. An improvement would be to use a classifier that does</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// not care about vertical position or scaling at all.</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// Separately collect stats on shifted baselines and apply the same logic to</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// computing a best-fit shift to fix the error. If the baseline needs to be</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// shifted, but the x-height is OK, returns the original x-height along with</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// the baseline shift to indicate that recognition needs to re-run.</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// If the max-min top of a unicharset char is bigger than kMaxCharTopRange</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// then the char top cannot be used to judge misfits or suggest a new top.</span></div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a01629.html#af2e2357e43916a53259c2ac0d7954eaf"> 67</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#af2e2357e43916a53259c2ac0d7954eaf">kMaxCharTopRange</a> = 48;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// Returns the number of misfit blob tops in this word.</span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="a02358.html#acf64fde8187041f90359fb507242bbb0"> 70</a></span> <span class="keywordtype">int</span> <a class="code" href="a02358.html#acf64fde8187041f90359fb507242bbb0">Tesseract::CountMisfitTops</a>(<a class="code" href="a02542.html">WERD_RES</a> *word_res) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordtype">int</span> bad_blobs = 0;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordtype">int</span> num_blobs = word_res-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#a0d5347723ece084faf8f3d0dba6dd219">NumBlobs</a>();</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> blob_id = 0; blob_id < num_blobs; ++blob_id) {</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="a02398.html">TBLOB</a>* blob = word_res-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#a52fba22521039a79d8c1c8182f602dcc">blobs</a>[blob_id];</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a> class_id = word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(blob_id);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">if</span> (<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a620c3ec802c8ddf9401a6940f542618e">get_isalpha</a>(class_id) || <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a98079b3ce062183388c653eee9838e3c">get_isdigit</a>(class_id)) {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordtype">int</span> top = blob-><a class="code" href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">bounding_box</a>().<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>();</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordflow">if</span> (top >= <a class="code" href="a00695.html#ae30a299d1150890d3f3606094fbf1169">INT_FEAT_RANGE</a>)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  top = <a class="code" href="a00695.html#ae30a299d1150890d3f3606094fbf1169">INT_FEAT_RANGE</a> - 1;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keywordtype">int</span> min_bottom, max_bottom, min_top, max_top;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#af299fffe9261cc732b15b4a2fc6b099a">get_top_bottom</a>(class_id, &min_bottom, &max_bottom,</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  &min_top, &max_top);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> (max_top - min_top > <a class="code" href="a01629.html#af2e2357e43916a53259c2ac0d7954eaf">kMaxCharTopRange</a>)</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">bool</span> bad = top < min_top - <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a> ||</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  top > max_top + <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a>;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">if</span> (bad)</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  ++bad_blobs;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 1) {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Class %s is %s with top %d vs limits of %d->%d, +/-%d\n"</span>,</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#aa19fb595808fe4688c580334937dfa45">id_to_unichar</a>(class_id),</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  bad ? <span class="stringliteral">"Misfit"</span> : <span class="stringliteral">"OK"</span>, top, min_top, max_top,</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a>));</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"> 96</span>  }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">return</span> bad_blobs;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> }</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment">// Returns a new x-height maximally compatible with the result in word_res.</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// See comment above for overall algorithm.</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc"> 102</a></span> <span class="keywordtype">float</span> <a class="code" href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc">Tesseract::ComputeCompatibleXheight</a>(<a class="code" href="a02542.html">WERD_RES</a> *word_res,</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordtype">float</span>* baseline_shift) {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="a02630.html">STATS</a> top_stats(0, UINT8_MAX);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="a02630.html">STATS</a> shift_stats(-UINT8_MAX, UINT8_MAX);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordtype">int</span> bottom_shift = 0;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">int</span> num_blobs = word_res-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#a0d5347723ece084faf8f3d0dba6dd219">NumBlobs</a>();</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  top_stats.<a class="code" href="a02630.html#a28e9fd9515ea3b35e3f66ed078e285a6">clear</a>();</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  shift_stats.<a class="code" href="a02630.html#a28e9fd9515ea3b35e3f66ed078e285a6">clear</a>();</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> blob_id = 0; blob_id < num_blobs; ++blob_id) {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="a02398.html">TBLOB</a>* blob = word_res-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#a52fba22521039a79d8c1c8182f602dcc">blobs</a>[blob_id];</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a> class_id = word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(blob_id);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">if</span> (<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a620c3ec802c8ddf9401a6940f542618e">get_isalpha</a>(class_id) ||</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a98079b3ce062183388c653eee9838e3c">get_isdigit</a>(class_id)) {</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordtype">int</span> top = blob-><a class="code" href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">bounding_box</a>().<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>() + bottom_shift;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// Clip the top to the limit of normalized feature space.</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">if</span> (top >= <a class="code" href="a00695.html#ae30a299d1150890d3f3606094fbf1169">INT_FEAT_RANGE</a>)</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  top = <a class="code" href="a00695.html#ae30a299d1150890d3f3606094fbf1169">INT_FEAT_RANGE</a> - 1;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordtype">int</span> bottom = blob-><a class="code" href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">bounding_box</a>().<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>() + bottom_shift;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordtype">int</span> min_bottom, max_bottom, min_top, max_top;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#af299fffe9261cc732b15b4a2fc6b099a">get_top_bottom</a>(class_id, &min_bottom, &max_bottom,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  &min_top, &max_top);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="comment">// Chars with a wild top range would mess up the result so ignore them.</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">if</span> (max_top - min_top > <a class="code" href="a01629.html#af2e2357e43916a53259c2ac0d7954eaf">kMaxCharTopRange</a>)</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordtype">int</span> misfit_dist = std::max((min_top - <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a>) - top,</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  top - (max_top + <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a>));</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">int</span> height = top - <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Class %s: height=%d, bottom=%d,%d top=%d,%d, actual=%d,%d: "</span>,</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#aa19fb595808fe4688c580334937dfa45">id_to_unichar</a>(class_id),</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  height, min_bottom, max_bottom, min_top, max_top,</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  bottom, top);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="comment">// Use only chars that fit in the expected bottom range, and where</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="comment">// the range of tops is sensibly near the xheight.</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">if</span> (min_bottom <= bottom + <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a> &&</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  bottom - <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a> <= max_bottom &&</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  min_top > <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a> &&</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  max_top - <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a> >= <a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a> &&</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  misfit_dist > 0) {</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="comment">// Compute the x-height position using proportionality between the</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="comment">// actual height and expected height.</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordtype">int</span> min_xht = <a class="code" href="a00527.html#a29e9efc11d2c7cdfa4c30881e82999dc">DivRounded</a>(height * <a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a>,</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  max_top - <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordtype">int</span> max_xht = <a class="code" href="a00527.html#a29e9efc11d2c7cdfa4c30881e82999dc">DivRounded</a>(height * <a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a>,</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  min_top - <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" xht range min=%d, max=%d\n"</span>, min_xht, max_xht);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="comment">// The range of expected heights gets a vote equal to the distance</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="comment">// of the actual top from the expected top.</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> y = min_xht; y <= max_xht; ++y)</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  top_stats.<a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a>(y, misfit_dist);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((min_bottom > bottom + <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a> ||</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  bottom - <a class="code" href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">x_ht_acceptance_tolerance</a> > max_bottom) &&</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  bottom_shift == 0) {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="comment">// Get the range of required bottom shift.</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordtype">int</span> min_shift = min_bottom - bottom;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordtype">int</span> max_shift = max_bottom - bottom;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" bottom shift min=%d, max=%d\n"</span>, min_shift, max_shift);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  }</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="comment">// The range of expected shifts gets a vote equal to the min distance</span></div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="comment">// of the actual bottom from the expected bottom, spread over the</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="comment">// range of its acceptance.</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordtype">int</span> misfit_weight = abs(min_shift);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">if</span> (max_shift > min_shift)</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  misfit_weight /= max_shift - min_shift;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> y = min_shift; y <= max_shift; ++y)</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  shift_stats.<a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a>(y, misfit_weight);</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> (bottom_shift == 0) {</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="comment">// Things with bottoms that are already ok need to say so, on the</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="comment">// 1st iteration only.</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  shift_stats.<a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a>(0, <a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>);</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" already OK\n"</span>);</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  }</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  }</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">if</span> (shift_stats.<a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a>() > top_stats.<a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a>()) {</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  bottom_shift = <a class="code" href="a00527.html#ab60e4f82956a1f5fdb54d0d8303e95b7">IntCastRounded</a>(shift_stats.<a class="code" href="a02630.html#a71ed5c12a693aeeb90346239c03e288d">median</a>());</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Applying bottom shift=%d\n"</span>, bottom_shift);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  }</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  }</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  } <span class="keywordflow">while</span> (bottom_shift != 0 &&</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  top_stats.<a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a>() < shift_stats.<a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a>());</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="comment">// Baseline shift is opposite sign to the bottom shift.</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  *baseline_shift = -bottom_shift / word_res-><a class="code" href="a02542.html#a202d9d5d2a462d84012011c689e16605">denorm</a>.<a class="code" href="a02510.html#aaa8b03dcd0096f380be5b94ff58dcdf8">y_scale</a>();</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"baseline shift=%g\n"</span>, *baseline_shift);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">if</span> (top_stats.<a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a>() == 0)</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keywordflow">return</span> bottom_shift != 0 ? word_res-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> : 0.0f;</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="comment">// The new xheight is just the median vote, which is then scaled out</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="comment">// of BLN space back to pixel space to get the x-height in pixel space.</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordtype">float</span> new_xht = top_stats.<a class="code" href="a02630.html#a71ed5c12a693aeeb90346239c03e288d">median</a>();</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 2) {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Median xht=%f\n"</span>, new_xht);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Mode20:A: New x-height = %f (norm), %f (orig)\n"</span>,</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  new_xht, new_xht / word_res-><a class="code" href="a02542.html#a202d9d5d2a462d84012011c689e16605">denorm</a>.<a class="code" href="a02510.html#aaa8b03dcd0096f380be5b94ff58dcdf8">y_scale</a>());</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  }</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="comment">// The xheight must change by at least x_ht_min_change to be used.</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">if</span> (fabs(new_xht - <a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a>) >= <a class="code" href="a02358.html#a6bb923a466994f686f55e199e12bbbd1">x_ht_min_change</a>)</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keywordflow">return</span> new_xht / word_res-><a class="code" href="a02542.html#a202d9d5d2a462d84012011c689e16605">denorm</a>.<a class="code" href="a02510.html#aaa8b03dcd0096f380be5b94ff58dcdf8">y_scale</a>();</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">return</span> bottom_shift != 0 ? word_res-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> : 0.0f;</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> }</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span> </div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> } <span class="comment">// namespace tesseract</span></div><div class="ttc" id="a02542_html_a211ab5c5a13123ee7bdc7459d3363f9d"><div class="ttname"><a href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">WERD_RES::rebuild_word</a></div><div class="ttdeci">TWERD * rebuild_word</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00260">pageres.h:260</a></div></div>
<div class="ttc" id="a00605_html_afedceee7ea132dae3d224db2cf8b5618"><div class="ttname"><a href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a></div><div class="ttdeci">int UNICHAR_ID</div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00035">unichar.h:35</a></div></div>
<div class="ttc" id="a02358_html_a212233fdf73096abefa2fa48b8ada3fc"><div class="ttname"><a href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc">tesseract::Tesseract::ComputeCompatibleXheight</a></div><div class="ttdeci">float ComputeCompatibleXheight(WERD_RES *word_res, float *baseline_shift)</div><div class="ttdef"><b>Definition:</b> <a href="a00095_source.html#l00102">fixxht.cpp:102</a></div></div>
<div class="ttc" id="a02630_html_a28e9fd9515ea3b35e3f66ed078e285a6"><div class="ttname"><a href="a02630.html#a28e9fd9515ea3b35e3f66ed078e285a6">STATS::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00082">statistc.cpp:82</a></div></div>
<div class="ttc" id="a00191_html"><div class="ttname"><a href="a00191.html">tesseractclass.h</a></div></div>
<div class="ttc" id="a02402_html_a0d5347723ece084faf8f3d0dba6dd219"><div class="ttname"><a href="a02402.html#a0d5347723ece084faf8f3d0dba6dd219">TWERD::NumBlobs</a></div><div class="ttdeci">int NumBlobs() const</div><div class="ttdef"><b>Definition:</b> <a href="a00230_source.html#l00432">blobs.h:432</a></div></div>
<div class="ttc" id="a02510_html_aaa8b03dcd0096f380be5b94ff58dcdf8"><div class="ttname"><a href="a02510.html#aaa8b03dcd0096f380be5b94ff58dcdf8">DENORM::y_scale</a></div><div class="ttdeci">float y_scale() const</div><div class="ttdef"><b>Definition:</b> <a href="a00314_source.html#l00270">normalis.h:270</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="a02542_html"><div class="ttname"><a href="a02542.html">WERD_RES</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00169">pageres.h:169</a></div></div>
<div class="ttc" id="a03950_html_a620c3ec802c8ddf9401a6940f542618e"><div class="ttname"><a href="a03950.html#a620c3ec802c8ddf9401a6940f542618e">UNICHARSET::get_isalpha</a></div><div class="ttdeci">bool get_isalpha(UNICHAR_ID unichar_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00486">unicharset.h:486</a></div></div>
<div class="ttc" id="a02630_html"><div class="ttname"><a href="a02630.html">STATS</a></div><div class="ttdef"><b>Definition:</b> <a href="a00431_source.html#l00033">statistc.h:33</a></div></div>
<div class="ttc" id="a02358_html_a6bb923a466994f686f55e199e12bbbd1"><div class="ttname"><a href="a02358.html#a6bb923a466994f686f55e199e12bbbd1">tesseract::Tesseract::x_ht_min_change</a></div><div class="ttdeci">int x_ht_min_change</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01012">tesseractclass.h:1012</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="a02542_html_a202d9d5d2a462d84012011c689e16605"><div class="ttname"><a href="a02542.html#a202d9d5d2a462d84012011c689e16605">WERD_RES::denorm</a></div><div class="ttdeci">DENORM denorm</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00204">pageres.h:204</a></div></div>
<div class="ttc" id="a03950_html_a98079b3ce062183388c653eee9838e3c"><div class="ttname"><a href="a03950.html#a98079b3ce062183388c653eee9838e3c">UNICHARSET::get_isdigit</a></div><div class="ttdeci">bool get_isdigit(UNICHAR_ID unichar_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00507">unicharset.h:507</a></div></div>
<div class="ttc" id="a02630_html_a71ed5c12a693aeeb90346239c03e288d"><div class="ttname"><a href="a02630.html#a71ed5c12a693aeeb90346239c03e288d">STATS::median</a></div><div class="ttdeci">double median() const</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00238">statistc.cpp:238</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="a03950_html_af299fffe9261cc732b15b4a2fc6b099a"><div class="ttname"><a href="a03950.html#af299fffe9261cc732b15b4a2fc6b099a">UNICHARSET::get_top_bottom</a></div><div class="ttdeci">void get_top_bottom(UNICHAR_ID unichar_id, int *min_bottom, int *max_bottom, int *min_top, int *max_top) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00563">unicharset.h:563</a></div></div>
<div class="ttc" id="a00695_html"><div class="ttname"><a href="a00695.html">float2int.h</a></div></div>
<div class="ttc" id="a00527_html_ab60e4f82956a1f5fdb54d0d8303e95b7"><div class="ttname"><a href="a00527.html#ab60e4f82956a1f5fdb54d0d8303e95b7">IntCastRounded</a></div><div class="ttdeci">int IntCastRounded(double x)</div><div class="ttdef"><b>Definition:</b> <a href="a00527_source.html#l00168">helpers.h:168</a></div></div>
<div class="ttc" id="a02358_html_abcefdada877f6fa25c95baf4e1fad9c4"><div class="ttname"><a href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">tesseract::Tesseract::debug_x_ht_level</a></div><div class="ttdeci">int debug_x_ht_level</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00900">tesseractclass.h:900</a></div></div>
<div class="ttc" id="a02606_html_a76b18095a88a05db299aa84451a5f52c"><div class="ttname"><a href="a02606.html#a76b18095a88a05db299aa84451a5f52c">WERD_CHOICE::unichar_id</a></div><div class="ttdeci">UNICHAR_ID unichar_id(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00315">ratngs.h:315</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="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="a01629_html"><div class="ttname"><a href="a01629.html">tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00094">baseapi.cpp:94</a></div></div>
<div class="ttc" id="a02630_html_a5ce26a26c81c69a3e27616669998abe2"><div class="ttname"><a href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">STATS::add</a></div><div class="ttdeci">void add(int32_t value, int32_t count)</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00100">statistc.cpp:100</a></div></div>
<div class="ttc" id="a02402_html_a52fba22521039a79d8c1c8182f602dcc"><div class="ttname"><a href="a02402.html#a52fba22521039a79d8c1c8182f602dcc">TWERD::blobs</a></div><div class="ttdeci">GenericVector< TBLOB * > blobs</div><div class="ttdef"><b>Definition:</b> <a href="a00230_source.html#l00443">blobs.h:443</a></div></div>
<div class="ttc" id="a02542_html_a42ec9dbb998f7da714ace13ee30cb86e"><div class="ttname"><a href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">WERD_RES::x_height</a></div><div class="ttdeci">float x_height</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00311">pageres.h:311</a></div></div>
<div class="ttc" id="a00557_html"><div class="ttname"><a href="a00557.html">params.h</a></div></div>
<div class="ttc" id="a02358_html_acf64fde8187041f90359fb507242bbb0"><div class="ttname"><a href="a02358.html#acf64fde8187041f90359fb507242bbb0">tesseract::Tesseract::CountMisfitTops</a></div><div class="ttdeci">int CountMisfitTops(WERD_RES *word_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00095_source.html#l00070">fixxht.cpp:70</a></div></div>
<div class="ttc" id="a03950_html_aa19fb595808fe4688c580334937dfa45"><div class="ttname"><a href="a03950.html#aa19fb595808fe4688c580334937dfa45">UNICHARSET::id_to_unichar</a></div><div class="ttdeci">const char * id_to_unichar(UNICHAR_ID id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00620_source.html#l00290">unicharset.cpp:290</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="a00527_html_a29e9efc11d2c7cdfa4c30881e82999dc"><div class="ttname"><a href="a00527.html#a29e9efc11d2c7cdfa4c30881e82999dc">DivRounded</a></div><div class="ttdeci">int DivRounded(int a, int b)</div><div class="ttdef"><b>Definition:</b> <a href="a00527_source.html#l00162">helpers.h:162</a></div></div>
<div class="ttc" id="a01629_html_af2e2357e43916a53259c2ac0d7954eaf"><div class="ttname"><a href="a01629.html#af2e2357e43916a53259c2ac0d7954eaf">tesseract::kMaxCharTopRange</a></div><div class="ttdeci">const int kMaxCharTopRange</div><div class="ttdef"><b>Definition:</b> <a href="a00095_source.html#l00067">fixxht.cpp:67</a></div></div>
<div class="ttc" id="a00695_html_ae30a299d1150890d3f3606094fbf1169"><div class="ttname"><a href="a00695.html#ae30a299d1150890d3f3606094fbf1169">INT_FEAT_RANGE</a></div><div class="ttdeci">#define INT_FEAT_RANGE</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l00027">float2int.h:27</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="a02542_html_a3d42ac7ec121263e757c9b7160dfd50d"><div class="ttname"><a href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">WERD_RES::best_choice</a></div><div class="ttdeci">WERD_CHOICE * best_choice</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00235">pageres.h:235</a></div></div>
<div class="ttc" id="a02630_html_a92ab39b34f7a99ff3272e614a946513c"><div class="ttname"><a href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">STATS::get_total</a></div><div class="ttdeci">int32_t get_total() const</div><div class="ttdef"><b>Definition:</b> <a href="a00431_source.html#l00086">statistc.h:86</a></div></div>
<div class="ttc" id="a02358_html_a2e893426c98ebee2c6a2d89ff42429ee"><div class="ttname"><a href="a02358.html#a2e893426c98ebee2c6a2d89ff42429ee">tesseract::Tesseract::x_ht_acceptance_tolerance</a></div><div class="ttdeci">int x_ht_acceptance_tolerance</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01011">tesseractclass.h:1011</a></div></div>
</div><!-- fragment --></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="a00095.html">fixxht.cpp</a></li>
<li class="footer">Generated on Mon Oct 29 2018 11:03:43 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>