1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6
<title>tesseract: tesseract::ColumnFinder Class Reference</title>
8
<link href="tabs.css" rel="stylesheet" type="text/css"/>
9
<link href="doxygen.css" rel="stylesheet" type="text/css" />
10
<link href="navtree.css" rel="stylesheet" type="text/css"/>
11
<script type="text/javascript" src="jquery.js"></script>
12
<script type="text/javascript" src="resize.js"></script>
13
<script type="text/javascript" src="navtree.js"></script>
14
<script type="text/javascript">
15
$(document).ready(initResizable);
17
<link href="search/search.css" rel="stylesheet" type="text/css"/>
18
<script type="text/javascript" src="search/search.js"></script>
19
<script type="text/javascript">
20
$(document).ready(function() { searchBox.OnSelectItem(0); });
25
<div id="top"><!-- do not remove this div! -->
29
<table cellspacing="0" cellpadding="0">
31
<tr style="height: 56px;">
34
<td style="padding-left: 0.5em;">
35
<div id="projectname">tesseract
36
 <span id="projectnumber">3.03</span>
48
<!-- Generated by Doxygen 1.7.6.1 -->
49
<script type="text/javascript">
50
var searchBox = new SearchBox("searchBox", "search",false,'Search');
52
<div id="navrow1" class="tabs">
54
<li><a href="index.html"><span>Main Page</span></a></li>
55
<li><a href="pages.html"><span>Related Pages</span></a></li>
56
<li><a href="modules.html"><span>Modules</span></a></li>
57
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
58
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
59
<li><a href="files.html"><span>Files</span></a></li>
61
<div id="MSearchBox" class="MSearchBoxInactive">
63
<img id="MSearchSelect" src="search/mag_sel.png"
64
onmouseover="return searchBox.OnSearchSelectShow()"
65
onmouseout="return searchBox.OnSearchSelectHide()"
67
<input type="text" id="MSearchField" value="Search" accesskey="S"
68
onfocus="searchBox.OnSearchFieldFocus(true)"
69
onblur="searchBox.OnSearchFieldFocus(false)"
70
onkeyup="searchBox.OnSearchFieldChange(event)"/>
71
</span><span class="right">
72
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
78
<div id="navrow2" class="tabs2">
80
<li><a href="annotated.html"><span>Class List</span></a></li>
81
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
82
<li><a href="functions.html"><span>Class Members</span></a></li>
86
<div id="side-nav" class="ui-resizable side-nav-resizable">
88
<div id="nav-tree-contents">
91
<div id="splitbar" style="-moz-user-select:none;"
92
class="ui-resizable-handle">
95
<script type="text/javascript">
96
initNavTree('a00327.html','');
98
<div id="doc-content">
100
<div class="summary">
101
<a href="#pub-methods">Public Member Functions</a> </div>
102
<div class="headertitle">
103
<div class="title">tesseract::ColumnFinder Class Reference</div> </div>
105
<div class="contents">
106
<!-- doxytag: class="tesseract::ColumnFinder" --><!-- doxytag: inherits="tesseract::TabFind" -->
107
<p><code>#include <<a class="el" href="a01099_source.html">colfind.h</a>></code></p>
108
<div class="dynheader">
109
Inheritance diagram for tesseract::ColumnFinder:</div>
110
<div class="dyncontent">
112
<img src="a00327.png" usemap="#tesseract::ColumnFinder_map" alt=""/>
113
<map id="tesseract::ColumnFinder_map" name="tesseract::ColumnFinder_map">
114
<area href="a00586.html" alt="tesseract::TabFind" shape="rect" coords="0,224,432,248"/>
115
<area href="a00257.html" alt="tesseract::AlignedBlob" shape="rect" coords="0,168,432,192"/>
116
<area href="a00278.html" alt="tesseract::BlobGrid" shape="rect" coords="0,112,432,136"/>
117
<area href="a00268.html" alt="tesseract::BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT >" shape="rect" coords="0,56,432,80"/>
118
<area href="a00406.html" alt="tesseract::GridBase" shape="rect" coords="0,0,432,24"/>
122
<p><a href="a01887.html">List of all members.</a></p>
123
<table class="memberdecls">
124
<tr><td colspan="2"><h2><a name="pub-methods"></a>
125
Public Member Functions</h2></td></tr>
126
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a967bff9c0dffdb8b8c27752f41b46dbf">ColumnFinder</a> (int <a class="el" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>, const <a class="el" href="a00409.html">ICOORD</a> &<a class="el" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>, const <a class="el" href="a00409.html">ICOORD</a> &<a class="el" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>, int resolution, bool cjk_script, TabVector_LIST *vlines, TabVector_LIST *hlines, int vertical_x, int vertical_y)</td></tr>
127
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#ae74b3226f76683ca0cd1dff60c508a69">~ColumnFinder</a> ()</td></tr>
128
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00352.html">DENORM</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a2a82ccf000c1a18a89b94238c83c5525">denorm</a> () const </td></tr>
129
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00624.html">TextlineProjection</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#aa715f91e99d1002a1d64fc2d3c94f5eb">projection</a> () const </td></tr>
130
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a831ebc431728361a28b2ea33b952915d">set_cjk_script</a> (bool is_cjk)</td></tr>
131
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a6070b7972e60881ce2149b8640fa10fd">SetupAndFilterNoise</a> (Pix *photo_mask_pix, <a class="el" href="a00627.html">TO_BLOCK</a> *input_block)</td></tr>
132
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a139ed554e16d81676dd789b325320e4c">IsVerticallyAlignedText</a> (<a class="el" href="a00627.html">TO_BLOCK</a> *block, BLOBNBOX_CLIST *osd_blobs)</td></tr>
133
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#af2296f0a81a6a9b8cfe12e3b704258e7">CorrectOrientation</a> (<a class="el" href="a00627.html">TO_BLOCK</a> *block, bool vertical_text_lines, int recognition_rotation)</td></tr>
134
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a20a22e7a3eb8e3a36b3d83ebcd9f755d">FindBlocks</a> (<a class="el" href="a01265.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> pageseg_mode, Pix *scaled_color, int scaled_factor, <a class="el" href="a00627.html">TO_BLOCK</a> *block, Pix *photo_mask_pix, Pix *thresholds_pix, Pix *grey_pix, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)</td></tr>
135
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#a555d9d09320031910b79fb14b584f64e">GetDeskewVectors</a> (<a class="el" href="a00375.html">FCOORD</a> *deskew, <a class="el" href="a00375.html">FCOORD</a> *reskew)</td></tr>
136
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00327.html#aa89aa6d591e18cf2e1ab136b06ae6ef7">SetEquationDetect</a> (<a class="el" href="a00371.html">EquationDetectBase</a> *detect)</td></tr>
138
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
139
<div class="textblock">
140
<p>Definition at line <a class="el" href="a01099_source.html#l00052">52</a> of file <a class="el" href="a01099_source.html">colfind.h</a>.</p>
141
</div><hr/><h2>Constructor & Destructor Documentation</h2>
142
<a class="anchor" id="a967bff9c0dffdb8b8c27752f41b46dbf"></a><!-- doxytag: member="tesseract::ColumnFinder::ColumnFinder" ref="a967bff9c0dffdb8b8c27752f41b46dbf" args="(int gridsize, const ICOORD &bleft, const ICOORD &tright, int resolution, bool cjk_script, TabVector_LIST *vlines, TabVector_LIST *hlines, int vertical_x, int vertical_y)" -->
143
<div class="memitem">
144
<div class="memproto">
145
<table class="memname">
147
<td class="memname"><a class="el" href="a00327.html#a967bff9c0dffdb8b8c27752f41b46dbf">tesseract::ColumnFinder::ColumnFinder</a> </td>
149
<td class="paramtype">int </td>
150
<td class="paramname"><em>gridsize</em>, </td>
153
<td class="paramkey"></td>
155
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
156
<td class="paramname"><em>bleft</em>, </td>
159
<td class="paramkey"></td>
161
<td class="paramtype">const <a class="el" href="a00409.html">ICOORD</a> & </td>
162
<td class="paramname"><em>tright</em>, </td>
165
<td class="paramkey"></td>
167
<td class="paramtype">int </td>
168
<td class="paramname"><em>resolution</em>, </td>
171
<td class="paramkey"></td>
173
<td class="paramtype">bool </td>
174
<td class="paramname"><em>cjk_script</em>, </td>
177
<td class="paramkey"></td>
179
<td class="paramtype">TabVector_LIST * </td>
180
<td class="paramname"><em>vlines</em>, </td>
183
<td class="paramkey"></td>
185
<td class="paramtype">TabVector_LIST * </td>
186
<td class="paramname"><em>hlines</em>, </td>
189
<td class="paramkey"></td>
191
<td class="paramtype">int </td>
192
<td class="paramname"><em>vertical_x</em>, </td>
195
<td class="paramkey"></td>
197
<td class="paramtype">int </td>
198
<td class="paramname"><em>vertical_y</em> </td>
209
<p>Definition at line <a class="el" href="a01098_source.html#l00084">84</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
210
<div class="fragment"><pre class="fragment"> : <a class="code" href="a00586.html#aa276c6c246bbde8c13131c2b3f41a454">TabFind</a>(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>, bleft, tright, vlines, vertical_x, vertical_y,
212
cjk_script_(cjk_script),
213
min_gutter_width_(static_cast<int>(<a class="code" href="a01265.html#af587ca3f993f7a3b54bdb0fac568d620">kMinGutterWidthGrid</a> * <a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>)),
214
mean_column_gap_(tright.<a class="code" href="a00409.html#a59722a47c540007c58a539f0e35b3f33" title="access function">x</a>() - bleft.<a class="code" href="a00409.html#a59722a47c540007c58a539f0e35b3f33" title="access function">x</a>()),
215
reskew_(1.0f, 0.0f), rotation_(1.0f, 0.0f), rerotate_(1.0f, 0.0f),
216
best_columns_(NULL), stroke_width_(NULL),
217
part_grid_(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>, bleft, tright), nontext_map_(NULL),
218
projection_(resolution),
219
denorm_(NULL), input_blobs_win_(NULL), equation_detect_(NULL) {
220
TabVector_IT h_it(&horizontal_lines_);
221
h_it.add_list_after(hlines);
226
<a class="anchor" id="ae74b3226f76683ca0cd1dff60c508a69"></a><!-- doxytag: member="tesseract::ColumnFinder::~ColumnFinder" ref="ae74b3226f76683ca0cd1dff60c508a69" args="()" -->
227
<div class="memitem">
228
<div class="memproto">
229
<table class="memname">
231
<td class="memname"><a class="el" href="a00327.html#ae74b3226f76683ca0cd1dff60c508a69">tesseract::ColumnFinder::~ColumnFinder</a> </td>
233
<td class="paramname"></td><td>)</td>
234
<td><code> [virtual]</code></td>
240
<p>Definition at line <a class="el" href="a01098_source.html#l00103">103</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
241
<div class="fragment"><pre class="fragment"> {
242
column_sets_.<a class="code" href="a00403.html#a98f62dccd75224a60437c2761bd215cd">delete_data_pointers</a>();
243
<span class="keywordflow">if</span> (best_columns_ != NULL) {
244
<span class="keyword">delete</span> [] best_columns_;
246
<span class="keywordflow">if</span> (stroke_width_ != NULL)
247
<span class="keyword">delete</span> stroke_width_;
248
<span class="keyword">delete</span> input_blobs_win_;
249
pixDestroy(&nontext_map_);
250
<span class="keywordflow">while</span> (denorm_ != NULL) {
251
<a class="code" href="a00352.html">DENORM</a>* dead_denorm = denorm_;
252
denorm_ = <span class="keyword">const_cast<</span><a class="code" href="a00352.html">DENORM</a>*<span class="keyword">></span>(denorm_-><a class="code" href="a00352.html#ae2cd0142f7cba40b8195fa872881ad02">predecessor</a>());
253
<span class="keyword">delete</span> dead_denorm;
256
<span class="comment">// The ColPartitions are destroyed automatically, but any boxes in</span>
257
<span class="comment">// the noise_parts_ list are owned and need to be deleted explicitly.</span>
258
ColPartition_IT part_it(&noise_parts_);
259
<span class="keywordflow">for</span> (part_it.mark_cycle_pt(); !part_it.cycled_list(); part_it.forward()) {
260
ColPartition* part = part_it.data();
261
part->DeleteBoxes();
263
<span class="comment">// Likewise any boxes in the good_parts_ list need to be deleted.</span>
264
<span class="comment">// These are just the image parts. Text parts have already given their</span>
265
<span class="comment">// boxes on to the TO_BLOCK, and have empty lists.</span>
266
part_it.set_to_list(&good_parts_);
267
<span class="keywordflow">for</span> (part_it.mark_cycle_pt(); !part_it.cycled_list(); part_it.forward()) {
268
ColPartition* part = part_it.data();
269
part->DeleteBoxes();
271
<span class="comment">// Also, any blobs on the image_bblobs_ list need to have their cblobs</span>
272
<span class="comment">// deleted. This only happens if there has been an early return from</span>
273
<span class="comment">// FindColumns, as in a normal return, the blobs go into the grid and</span>
274
<span class="comment">// end up in noise_parts_, good_parts_ or the output blocks.</span>
275
BLOBNBOX_IT bb_it(&image_bblobs_);
276
<span class="keywordflow">for</span> (bb_it.mark_cycle_pt(); !bb_it.cycled_list(); bb_it.forward()) {
277
<a class="code" href="a00279.html">BLOBNBOX</a>* bblob = bb_it.data();
278
<span class="keyword">delete</span> bblob-><a class="code" href="a00279.html#a483f44541a4dd818f02225c92f030e07">cblob</a>();
284
<hr/><h2>Member Function Documentation</h2>
285
<a class="anchor" id="af2296f0a81a6a9b8cfe12e3b704258e7"></a><!-- doxytag: member="tesseract::ColumnFinder::CorrectOrientation" ref="af2296f0a81a6a9b8cfe12e3b704258e7" args="(TO_BLOCK *block, bool vertical_text_lines, int recognition_rotation)" -->
286
<div class="memitem">
287
<div class="memproto">
288
<table class="memname">
290
<td class="memname">void <a class="el" href="a00327.html#af2296f0a81a6a9b8cfe12e3b704258e7">tesseract::ColumnFinder::CorrectOrientation</a> </td>
292
<td class="paramtype"><a class="el" href="a00627.html">TO_BLOCK</a> * </td>
293
<td class="paramname"><em>block</em>, </td>
296
<td class="paramkey"></td>
298
<td class="paramtype">bool </td>
299
<td class="paramname"><em>vertical_text_lines</em>, </td>
302
<td class="paramkey"></td>
304
<td class="paramtype">int </td>
305
<td class="paramname"><em>recognition_rotation</em> </td>
316
<p>Definition at line <a class="el" href="a01098_source.html#l00203">203</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
317
<div class="fragment"><pre class="fragment"> {
318
<span class="keyword">const</span> <a class="code" href="a00375.html">FCOORD</a> anticlockwise90(0.0f, 1.0f);
319
<span class="keyword">const</span> <a class="code" href="a00375.html">FCOORD</a> clockwise90(0.0f, -1.0f);
320
<span class="keyword">const</span> <a class="code" href="a00375.html">FCOORD</a> rotation180(-1.0f, 0.0f);
321
<span class="keyword">const</span> <a class="code" href="a00375.html">FCOORD</a> norotation(1.0f, 0.0f);
323
text_rotation_ = norotation;
324
<span class="comment">// Rotate the page to make the text upright, as implied by</span>
325
<span class="comment">// recognition_rotation.</span>
326
rotation_ = norotation;
327
<span class="keywordflow">if</span> (recognition_rotation == 1) {
328
rotation_ = anticlockwise90;
329
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (recognition_rotation == 2) {
330
rotation_ = rotation180;
331
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (recognition_rotation == 3) {
332
rotation_ = clockwise90;
334
<span class="comment">// We infer text writing direction to be vertical if there are several</span>
335
<span class="comment">// vertical text lines detected, and horizontal if not. But if the page</span>
336
<span class="comment">// orientation was determined to be 90 or 270 degrees, the true writing</span>
337
<span class="comment">// direction is the opposite of what we inferred.</span>
338
<span class="keywordflow">if</span> (recognition_rotation & 1) {
339
vertical_text_lines = !vertical_text_lines;
341
<span class="comment">// If we still believe the writing direction is vertical, we use the</span>
342
<span class="comment">// convention of rotating the page ccw 90 degrees to make the text lines</span>
343
<span class="comment">// horizontal, and mark the blobs for rotation cw 90 degrees for</span>
344
<span class="comment">// classification so that the text order is correct after recognition.</span>
345
<span class="keywordflow">if</span> (vertical_text_lines) {
346
rotation_.<a class="code" href="a00375.html#a81ca9ea0cac4cd8c1bca0314e29bb28d">rotate</a>(anticlockwise90);
347
text_rotation_.<a class="code" href="a00375.html#a81ca9ea0cac4cd8c1bca0314e29bb28d">rotate</a>(clockwise90);
349
<span class="comment">// Set rerotate_ to the inverse of rotation_.</span>
350
rerotate_ = <a class="code" href="a00375.html">FCOORD</a>(rotation_.<a class="code" href="a00375.html#a9edadbfc357c730f62fa3c92677b0d58">x</a>(), -rotation_.<a class="code" href="a00375.html#a397f7ce997b246df18e7bd5a20cc422e">y</a>());
351
<span class="keywordflow">if</span> (rotation_.<a class="code" href="a00375.html#a9edadbfc357c730f62fa3c92677b0d58">x</a>() != 1.0f || rotation_.<a class="code" href="a00375.html#a397f7ce997b246df18e7bd5a20cc422e">y</a>() != 0.0f) {
352
<span class="comment">// Rotate all the blobs and tab vectors.</span>
353
<a class="code" href="a00586.html#a284f867e74a35ec3513f29a03bf46157">RotateBlobList</a>(rotation_, &block-><a class="code" href="a00627.html#aafe2a9baa69300ee71da42e6dc18cfee">large_blobs</a>);
354
<a class="code" href="a00586.html#a284f867e74a35ec3513f29a03bf46157">RotateBlobList</a>(rotation_, &block-><a class="code" href="a00627.html#a5dd67c54162a6b60b0fd11500d4a3025">blobs</a>);
355
<a class="code" href="a00586.html#a284f867e74a35ec3513f29a03bf46157">RotateBlobList</a>(rotation_, &block-><a class="code" href="a00627.html#ad16b1c18225b44c50674ca46841b0f5f">small_blobs</a>);
356
<a class="code" href="a00586.html#a284f867e74a35ec3513f29a03bf46157">RotateBlobList</a>(rotation_, &block-><a class="code" href="a00627.html#aa6a3757d385e79ab76f34afb6e8fc684">noise_blobs</a>);
357
<a class="code" href="a00586.html#a4dd9c8e6a4a4b669b143a8b209ab4e3d">TabFind::ResetForVerticalText</a>(rotation_, rerotate_, &horizontal_lines_,
358
&min_gutter_width_);
359
part_grid_.<a class="code" href="a00268.html#a1d2990adf323d7910fbf87b6fc3a7415">Init</a>(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>(), <a class="code" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>(), <a class="code" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>());
360
<span class="comment">// Reset all blobs to initial state and filter by size.</span>
361
<span class="comment">// Since they have rotated, the list they belong on could have changed.</span>
362
block-><a class="code" href="a00627.html#a9b17e51cab6a0a8b6d8220443a2e9aa7">ReSetAndReFilterBlobs</a>();
363
<a class="code" href="a00586.html#a933d26eedcaa45e623f33559cbe69aa6">SetBlockRuleEdges</a>(block);
364
stroke_width_-><a class="code" href="a00561.html#a35f8ebba3622b6777da414ce6679158d">CorrectForRotation</a>(rerotate_, &part_grid_);
366
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
367
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Vertical=%d, orientation=%d, final rotation=(%f, %f)+(%f,%f)\n"</span>,
368
vertical_text_lines, recognition_rotation,
369
rotation_.<a class="code" href="a00375.html#a9edadbfc357c730f62fa3c92677b0d58">x</a>(), rotation_.<a class="code" href="a00375.html#a397f7ce997b246df18e7bd5a20cc422e">y</a>(),
370
text_rotation_.<a class="code" href="a00375.html#a9edadbfc357c730f62fa3c92677b0d58">x</a>(), text_rotation_.<a class="code" href="a00375.html#a397f7ce997b246df18e7bd5a20cc422e">y</a>());
372
<span class="comment">// Setup the denormalization.</span>
373
<a class="code" href="a00823.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(denorm_ == NULL);
374
denorm_ = <span class="keyword">new</span> <a class="code" href="a00352.html">DENORM</a>;
375
denorm_-><a class="code" href="a00352.html#ac94eaa8655afedfbb5f47dee47c7b28c">SetupNormalization</a>(NULL, &rotation_, NULL,
376
0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
381
<a class="anchor" id="a2a82ccf000c1a18a89b94238c83c5525"></a><!-- doxytag: member="tesseract::ColumnFinder::denorm" ref="a2a82ccf000c1a18a89b94238c83c5525" args="() const " -->
382
<div class="memitem">
383
<div class="memproto">
384
<table class="memname">
386
<td class="memname">const <a class="el" href="a00352.html">DENORM</a>* <a class="el" href="a00327.html#a2a82ccf000c1a18a89b94238c83c5525">tesseract::ColumnFinder::denorm</a> </td>
388
<td class="paramname"></td><td>)</td>
389
<td> const<code> [inline]</code></td>
395
<p>Definition at line <a class="el" href="a01099_source.html#l00066">66</a> of file <a class="el" href="a01099_source.html">colfind.h</a>.</p>
396
<div class="fragment"><pre class="fragment"> {
397
<span class="keywordflow">return</span> denorm_;
402
<a class="anchor" id="a20a22e7a3eb8e3a36b3d83ebcd9f755d"></a><!-- doxytag: member="tesseract::ColumnFinder::FindBlocks" ref="a20a22e7a3eb8e3a36b3d83ebcd9f755d" args="(PageSegMode pageseg_mode, Pix *scaled_color, int scaled_factor, TO_BLOCK *block, Pix *photo_mask_pix, Pix *thresholds_pix, Pix *grey_pix, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks)" -->
403
<div class="memitem">
404
<div class="memproto">
405
<table class="memname">
407
<td class="memname">int <a class="el" href="a00327.html#a20a22e7a3eb8e3a36b3d83ebcd9f755d">tesseract::ColumnFinder::FindBlocks</a> </td>
409
<td class="paramtype"><a class="el" href="a01265.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> </td>
410
<td class="paramname"><em>pageseg_mode</em>, </td>
413
<td class="paramkey"></td>
415
<td class="paramtype">Pix * </td>
416
<td class="paramname"><em>scaled_color</em>, </td>
419
<td class="paramkey"></td>
421
<td class="paramtype">int </td>
422
<td class="paramname"><em>scaled_factor</em>, </td>
425
<td class="paramkey"></td>
427
<td class="paramtype"><a class="el" href="a00627.html">TO_BLOCK</a> * </td>
428
<td class="paramname"><em>block</em>, </td>
431
<td class="paramkey"></td>
433
<td class="paramtype">Pix * </td>
434
<td class="paramname"><em>photo_mask_pix</em>, </td>
437
<td class="paramkey"></td>
439
<td class="paramtype">Pix * </td>
440
<td class="paramname"><em>thresholds_pix</em>, </td>
443
<td class="paramkey"></td>
445
<td class="paramtype">Pix * </td>
446
<td class="paramname"><em>grey_pix</em>, </td>
449
<td class="paramkey"></td>
451
<td class="paramtype">BLOCK_LIST * </td>
452
<td class="paramname"><em>blocks</em>, </td>
455
<td class="paramkey"></td>
457
<td class="paramtype">TO_BLOCK_LIST * </td>
458
<td class="paramname"><em>to_blocks</em> </td>
469
<p>Definition at line <a class="el" href="a01098_source.html#l00287">287</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
470
<div class="fragment"><pre class="fragment"> {
471
pixOr(photo_mask_pix, photo_mask_pix, nontext_map_);
472
stroke_width_-><a class="code" href="a00561.html#a8418b53298a0a6b71b8d4c804d48980e">FindLeaderPartitions</a>(input_block, &part_grid_);
473
stroke_width_-><a class="code" href="a00561.html#a726e68e695eceafbf22602ba8c563c4a">RemoveLineResidue</a>(&big_parts_);
474
<a class="code" href="a00586.html#a0e13b8acb7aefd346628fd4c88f82d47">FindInitialTabVectors</a>(NULL, min_gutter_width_, input_block);
475
<a class="code" href="a00586.html#a933d26eedcaa45e623f33559cbe69aa6">SetBlockRuleEdges</a>(input_block);
476
stroke_width_-><a class="code" href="a00561.html#a451efd159b76fddddaedbe4f0736d650">GradeBlobsIntoPartitions</a>(rerotate_, input_block, nontext_map_,
477
denorm_, cjk_script_, &projection_,
478
&part_grid_, &big_parts_);
479
<span class="keywordflow">if</span> (!<a class="code" href="a00781.html#a3040b5473ea4c79ff3feab8e9588b21f">PSM_SPARSE</a>(pageseg_mode)) {
480
<a class="code" href="a00413.html#aa45bf8c2f6ca0dc31e8f1ef08ffea700">ImageFind::FindImagePartitions</a>(photo_mask_pix, rotation_, rerotate_,
481
input_block, <span class="keyword">this</span>, &part_grid_, &big_parts_);
482
<a class="code" href="a00413.html#af98436ea599236937f5c013853f437df">ImageFind::TransferImagePartsToImageMask</a>(rerotate_, &part_grid_,
484
<a class="code" href="a00413.html#aa45bf8c2f6ca0dc31e8f1ef08ffea700">ImageFind::FindImagePartitions</a>(photo_mask_pix, rotation_, rerotate_,
485
input_block, <span class="keyword">this</span>, &part_grid_, &big_parts_);
487
part_grid_.<a class="code" href="a00324.html#aecd8e56c6111338a9f7a42ce00d3636f">ReTypeBlobs</a>(&image_bblobs_);
488
<a class="code" href="a00586.html#a7e49edde7f5fdadc93ee731676e9f860">TidyBlobs</a>(input_block);
489
<a class="code" href="a00586.html#af6d774ed654a3708b6941707eaa357e7">Reset</a>();
490
<span class="comment">// TODO(rays) need to properly handle big_parts_.</span>
491
ColPartition_IT p_it(&big_parts_);
492
<span class="keywordflow">for</span> (p_it.mark_cycle_pt(); !p_it.cycled_list(); p_it.forward())
493
p_it.data()->DisownBoxesNoAssert();
495
<span class="keyword">delete</span> stroke_width_;
496
stroke_width_ = NULL;
497
<span class="comment">// Compute the edge offsets whether or not there is a grey_pix. It is done</span>
498
<span class="comment">// here as the c_blobs haven't been touched by rotation or anything yet,</span>
499
<span class="comment">// so no denorm is required, yet the text has been separated from image, so</span>
500
<span class="comment">// no time is wasted running it on image blobs.</span>
501
input_block->ComputeEdgeOffsets(thresholds_pix, grey_pix);
503
<span class="comment">// A note about handling right-to-left scripts (Hebrew/Arabic):</span>
504
<span class="comment">// The columns must be reversed and come out in right-to-left instead of</span>
505
<span class="comment">// the normal left-to-right order. Because the left-to-right ordering</span>
506
<span class="comment">// is implicit in many data structures, it is simpler to fool the algorithms</span>
507
<span class="comment">// into thinking they are dealing with left-to-right text.</span>
508
<span class="comment">// To do this, we reflect the needed data in the y-axis and then reflect</span>
509
<span class="comment">// the blocks back after they have been created. This is a temporary</span>
510
<span class="comment">// arrangment that is confined to this function only, so the reflection</span>
511
<span class="comment">// is completely invisible in the output blocks.</span>
512
<span class="comment">// The only objects reflected are:</span>
513
<span class="comment">// The vertical separator lines that have already been found;</span>
514
<span class="comment">// The bounding boxes of all BLOBNBOXES on all lists on the input_block</span>
515
<span class="comment">// plus the image_bblobs. The outlines are not touched, since they are</span>
516
<span class="comment">// not looked at.</span>
517
<span class="keywordtype">bool</span> input_is_rtl = input_block->block->right_to_left();
518
<span class="keywordflow">if</span> (input_is_rtl) {
519
<span class="comment">// Reflect the vertical separator lines (member of TabFind).</span>
520
<a class="code" href="a00586.html#a7796b29f26b5411d648a546567251352">ReflectInYAxis</a>();
521
<span class="comment">// Reflect the blob boxes.</span>
522
ReflectForRtl(input_block, &image_bblobs_);
523
part_grid_.<a class="code" href="a00324.html#a423a93040be0e2075dce35597ab30d3a">ReflectInYAxis</a>();
526
<span class="keywordflow">if</span> (!<a class="code" href="a00781.html#a3040b5473ea4c79ff3feab8e9588b21f">PSM_SPARSE</a>(pageseg_mode)) {
527
<span class="keywordflow">if</span> (!<a class="code" href="a00781.html#acdfaf983e9b264a248ba758043508b88">PSM_COL_FIND_ENABLED</a>(pageseg_mode)) {
528
<span class="comment">// No tab stops needed. Just the grid that FindTabVectors makes.</span>
529
<a class="code" href="a00586.html#a55483b344fcfd80beece6b81772fdbd2">DontFindTabVectors</a>(&image_bblobs_, input_block, &deskew_, &reskew_);
530
} <span class="keywordflow">else</span> {
531
<a class="code" href="a00586.html#a933d26eedcaa45e623f33559cbe69aa6">SetBlockRuleEdges</a>(input_block);
532
<span class="comment">// Find the tab stops, estimate skew, and deskew the tabs, blobs and</span>
533
<span class="comment">// part_grid_.</span>
534
<a class="code" href="a00586.html#a558d35cc39d58e0a30138438c2af2fab">FindTabVectors</a>(&horizontal_lines_, &image_bblobs_, input_block,
535
min_gutter_width_, &part_grid_, &deskew_, &reskew_);
536
<span class="comment">// Add the deskew to the denorm_.</span>
537
<a class="code" href="a00352.html">DENORM</a>* new_denorm = <span class="keyword">new</span> <a class="code" href="a00352.html">DENORM</a>;
538
new_denorm-><a class="code" href="a00352.html#ac94eaa8655afedfbb5f47dee47c7b28c">SetupNormalization</a>(NULL, &deskew_, denorm_,
539
0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f);
540
denorm_ = new_denorm;
542
<a class="code" href="a00586.html#a933d26eedcaa45e623f33559cbe69aa6">SetBlockRuleEdges</a>(input_block);
543
part_grid_.<a class="code" href="a00324.html#a40b0e4db617400d53951521ab11b5b8a">SetTabStops</a>(<span class="keyword">this</span>);
545
<span class="comment">// Make the column_sets_.</span>
546
<span class="keywordflow">if</span> (!MakeColumns(<span class="keyword">false</span>)) {
547
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Empty page!!\n"</span>);
548
part_grid_.<a class="code" href="a00324.html#a274c6b7670b91545b63dd8f44c79782e">DeleteParts</a>();
549
<span class="keywordflow">return</span> 0; <span class="comment">// This is an empty page.</span>
552
<span class="comment">// Refill the grid using rectangular spreading, and get the benefit</span>
553
<span class="comment">// of the completed tab vectors marking the rule edges of each blob.</span>
554
<a class="code" href="a00268.html#a0b373075bdfda41719d6fb9a64bcfee0">Clear</a>();
555
<span class="preprocessor"> #ifndef GRAPHICS_DISABLED</span>
556
<span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="a01265.html#ae45f6b2309e389cbb5b789832b521eef">textord_tabfind_show_reject_blobs</a>) {
557
<a class="code" href="a00532.html">ScrollView</a>* rej_win = <a class="code" href="a00268.html#aa716f76c7f04f7112abfc10a3f8c63e0">MakeWindow</a>(500, 300, <span class="stringliteral">"Rejected blobs"</span>);
558
input_block->plot_graded_blobs(rej_win);
560
<span class="preprocessor"> #endif // GRAPHICS_DISABLED</span>
561
<span class="preprocessor"></span> <a class="code" href="a00586.html#a3e55aec0e623b421d2d309cafc1ccfd4">InsertBlobsToGrid</a>(<span class="keyword">false</span>, <span class="keyword">false</span>, &image_bblobs_, <span class="keyword">this</span>);
562
<a class="code" href="a00586.html#a3e55aec0e623b421d2d309cafc1ccfd4">InsertBlobsToGrid</a>(<span class="keyword">true</span>, <span class="keyword">true</span>, &input_block->blobs, <span class="keyword">this</span>);
564
part_grid_.<a class="code" href="a00324.html#a6840942249ec02a7c24c051a6f51f14c">GridFindMargins</a>(best_columns_);
565
<span class="comment">// Split and merge the partitions by looking at local neighbours.</span>
566
GridSplitPartitions();
567
<span class="comment">// Resolve unknown partitions by adding to an existing partition, fixing</span>
568
<span class="comment">// the type, or declaring them noise.</span>
569
part_grid_.<a class="code" href="a00324.html#a6840942249ec02a7c24c051a6f51f14c">GridFindMargins</a>(best_columns_);
570
GridMergePartitions();
571
<span class="comment">// Insert any unused noise blobs that are close enough to an appropriate</span>
572
<span class="comment">// partition.</span>
573
InsertRemainingNoise(input_block);
574
<span class="comment">// Add horizontal line separators as partitions.</span>
575
GridInsertHLinePartitions();
576
GridInsertVLinePartitions();
577
<span class="comment">// Recompute margins based on a local neighbourhood search.</span>
578
part_grid_.<a class="code" href="a00324.html#a6840942249ec02a7c24c051a6f51f14c">GridFindMargins</a>(best_columns_);
581
<span class="keywordflow">if</span> (<a class="code" href="a01265.html#a94221b005e975f4dc032aaa2600294e6">textord_tabfind_show_initial_partitions</a>) {
582
<a class="code" href="a00532.html">ScrollView</a>* part_win = <a class="code" href="a00268.html#aa716f76c7f04f7112abfc10a3f8c63e0">MakeWindow</a>(100, 300, <span class="stringliteral">"InitialPartitions"</span>);
583
part_grid_.<a class="code" href="a00268.html#a01e56b692125ef3220a23695e2c4821f">DisplayBoxes</a>(part_win);
584
<a class="code" href="a00586.html#afae5bc37f0ba24f67e7b75bc44039cd4">DisplayTabVectors</a>(part_win);
587
<span class="keywordflow">if</span> (!<a class="code" href="a00781.html#a3040b5473ea4c79ff3feab8e9588b21f">PSM_SPARSE</a>(pageseg_mode)) {
588
<span class="keywordflow">if</span> (equation_detect_) {
589
equation_detect_-><a class="code" href="a00371.html#a4f11f002edacf57f9e8b10103e0288a7">FindEquationParts</a>(&part_grid_, best_columns_);
591
<span class="keywordflow">if</span> (<a class="code" href="a01265.html#a2e322446536328d1e9867188ed9a68e5">textord_tabfind_find_tables</a>) {
592
TableFinder table_finder;
593
table_finder.Init(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>(), <a class="code" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>(), <a class="code" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>());
594
table_finder.set_resolution(<a class="code" href="a00586.html#a6faf609de59b4e4fd6baf0c3f19efbaf">resolution_</a>);
595
table_finder.set_left_to_right_language(
596
!input_block->block->right_to_left());
597
<span class="comment">// Copy cleaned partitions from part_grid_ to clean_part_grid_ and</span>
598
<span class="comment">// insert dot-like noise into period_grid_</span>
599
table_finder.InsertCleanPartitions(&part_grid_, input_block);
600
<span class="comment">// Get Table Regions</span>
601
table_finder.LocateTables(&part_grid_, best_columns_, <a class="code" href="a00586.html#a580534816073eb4327fbe24611499a5c">WidthCB</a>(), reskew_);
603
GridRemoveUnderlinePartitions();
604
part_grid_.<a class="code" href="a00324.html#ab4756f20467daf31de174d0da440a279">DeleteUnknownParts</a>(input_block);
606
<span class="comment">// Build the partitions into chains that belong in the same block and</span>
607
<span class="comment">// refine into one-to-one links, then smooth the types within each chain.</span>
608
part_grid_.<a class="code" href="a00324.html#a7ed32c7b4717fc000dd55796f6bf86d7">FindPartitionPartners</a>();
609
part_grid_.<a class="code" href="a00324.html#ae99dfe01a80478cc1ef370aa74b79773">FindFigureCaptions</a>();
610
part_grid_.<a class="code" href="a00324.html#a4781167f958ee8cc47549d8b39b9f1b5">RefinePartitionPartners</a>(<span class="keyword">true</span>);
613
<span class="preprocessor"> #ifndef GRAPHICS_DISABLED</span>
614
<span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="a01265.html#abcbdee203f43728127ef849268be5a56">textord_tabfind_show_partitions</a>) {
615
<a class="code" href="a00532.html">ScrollView</a>* window = <a class="code" href="a00268.html#aa716f76c7f04f7112abfc10a3f8c63e0">MakeWindow</a>(400, 300, <span class="stringliteral">"Partitions"</span>);
616
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#aa41ec04738a4db16aac9b42faff5b857">textord_debug_images</a>)
617
window-><a class="code" href="a00532.html#a45881e629322d82c9fc0c5f926a76f16">Image</a>(<a class="code" href="a00257.html#a03ba43124d00badef61e1da6b06ffc2a">AlignedBlob::textord_debug_pix</a>().<span class="keywordtype">string</span>(),
618
<a class="code" href="a00586.html#abd2f6921aa546135c38150769d90b1c2">image_origin</a>().x(), <a class="code" href="a00586.html#abd2f6921aa546135c38150769d90b1c2">image_origin</a>().y());
619
part_grid_.<a class="code" href="a00268.html#a01e56b692125ef3220a23695e2c4821f">DisplayBoxes</a>(window);
620
<span class="keywordflow">if</span> (!<a class="code" href="a01084.html#acbc402f58f1dd3b0eee25a5d3e3cf2d6">textord_debug_printable</a>)
621
<a class="code" href="a00586.html#afae5bc37f0ba24f67e7b75bc44039cd4">DisplayTabVectors</a>(window);
622
<span class="keywordflow">if</span> (window != NULL && <a class="code" href="a01265.html#abcbdee203f43728127ef849268be5a56">textord_tabfind_show_partitions</a> > 1) {
623
<span class="keyword">delete</span> window-><a class="code" href="a00532.html#a0b820b3fe7a2ce083da0784e9339a1ad">AwaitEvent</a>(<a class="code" href="a01203.html#a3688a0cf2f95d10a57e095222ccfe9a0adbe9fb2ca110dbf1b838d845d32a89e7">SVET_DESTROY</a>);
626
<span class="preprocessor"> #endif // GRAPHICS_DISABLED</span>
627
<span class="preprocessor"></span> part_grid_.<a class="code" href="a00268.html#a19df7a0ef4d8204b5d6fa36765011114">AssertNoDuplicates</a>();
629
<span class="comment">// Ownership of the ColPartitions moves from part_sets_ to part_grid_ here,</span>
630
<span class="comment">// and ownership of the BLOBNBOXes moves to the ColPartitions.</span>
631
<span class="comment">// (They were previously owned by the block or the image_bblobs list.)</span>
632
ReleaseBlobsAndCleanupUnused(input_block);
633
<span class="comment">// Ownership of the ColPartitions moves from part_grid_ to good_parts_ and</span>
634
<span class="comment">// noise_parts_ here. In text blocks, ownership of the BLOBNBOXes moves</span>
635
<span class="comment">// from the ColPartitions to the output TO_BLOCK. In non-text, the</span>
636
<span class="comment">// BLOBNBOXes stay with the ColPartitions and get deleted in the destructor.</span>
637
<span class="keywordflow">if</span> (<a class="code" href="a00781.html#a3040b5473ea4c79ff3feab8e9588b21f">PSM_SPARSE</a>(pageseg_mode))
638
part_grid_.<a class="code" href="a00324.html#a340a41a02be925abaed397a99ce58bde">ExtractPartitionsAsBlocks</a>(blocks, to_blocks);
639
<span class="keywordflow">else</span>
640
TransformToBlocks(blocks, to_blocks);
641
<span class="keywordflow">if</span> (<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>) {
642
<a class="code" href="a00860.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Found %d blocks, %d to_blocks\n"</span>,
643
blocks->length(), to_blocks->length());
646
DisplayBlocks(blocks);
647
RotateAndReskewBlocks(input_is_rtl, to_blocks);
648
<span class="keywordtype">int</span> result = 0;
649
<span class="preprocessor"> #ifndef GRAPHICS_DISABLED</span>
650
<span class="preprocessor"></span> <span class="keywordflow">if</span> (blocks_win_ != NULL) {
651
<span class="keywordtype">bool</span> waiting = <span class="keyword">false</span>;
652
<span class="keywordflow">do</span> {
653
waiting = <span class="keyword">false</span>;
654
<a class="code" href="a00566.html">SVEvent</a>* <span class="keyword">event</span> = blocks_win_-><a class="code" href="a00532.html#a0b820b3fe7a2ce083da0784e9339a1ad">AwaitEvent</a>(<a class="code" href="a01203.html#a3688a0cf2f95d10a57e095222ccfe9a0a6eec81ed585bda7ff47ec38918cb2a0e">SVET_ANY</a>);
655
<span class="keywordflow">if</span> (event->type == <a class="code" href="a01203.html#a3688a0cf2f95d10a57e095222ccfe9a0aee5f6202613f111d11fc310ccba2fa25">SVET_INPUT</a> && event->parameter != NULL) {
656
<span class="keywordflow">if</span> (*event->parameter == <span class="charliteral">'d'</span>)
658
<span class="keywordflow">else</span>
660
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event->type == <a class="code" href="a01203.html#a3688a0cf2f95d10a57e095222ccfe9a0adbe9fb2ca110dbf1b838d845d32a89e7">SVET_DESTROY</a>) {
662
} <span class="keywordflow">else</span> {
663
waiting = <span class="keyword">true</span>;
665
<span class="keyword">delete</span> event;
666
} <span class="keywordflow">while</span> (waiting);
668
<span class="preprocessor"> #endif // GRAPHICS_DISABLED</span>
669
<span class="preprocessor"></span> <span class="keywordflow">return</span> result;
674
<a class="anchor" id="a555d9d09320031910b79fb14b584f64e"></a><!-- doxytag: member="tesseract::ColumnFinder::GetDeskewVectors" ref="a555d9d09320031910b79fb14b584f64e" args="(FCOORD *deskew, FCOORD *reskew)" -->
675
<div class="memitem">
676
<div class="memproto">
677
<table class="memname">
679
<td class="memname">void <a class="el" href="a00327.html#a555d9d09320031910b79fb14b584f64e">tesseract::ColumnFinder::GetDeskewVectors</a> </td>
681
<td class="paramtype"><a class="el" href="a00375.html">FCOORD</a> * </td>
682
<td class="paramname"><em>deskew</em>, </td>
685
<td class="paramkey"></td>
687
<td class="paramtype"><a class="el" href="a00375.html">FCOORD</a> * </td>
688
<td class="paramname"><em>reskew</em> </td>
699
<p>Definition at line <a class="el" href="a01098_source.html#l00494">494</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
700
<div class="fragment"><pre class="fragment"> {
703
deskew-><a class="code" href="a00375.html#ad1e9f0d2a1f054f70b6f3036db6afcc0" title="rewrite function">set_y</a>(-deskew-><a class="code" href="a00375.html#a397f7ce997b246df18e7bd5a20cc422e">y</a>());
708
<a class="anchor" id="a139ed554e16d81676dd789b325320e4c"></a><!-- doxytag: member="tesseract::ColumnFinder::IsVerticallyAlignedText" ref="a139ed554e16d81676dd789b325320e4c" args="(TO_BLOCK *block, BLOBNBOX_CLIST *osd_blobs)" -->
709
<div class="memitem">
710
<div class="memproto">
711
<table class="memname">
713
<td class="memname">bool <a class="el" href="a00327.html#a139ed554e16d81676dd789b325320e4c">tesseract::ColumnFinder::IsVerticallyAlignedText</a> </td>
715
<td class="paramtype"><a class="el" href="a00627.html">TO_BLOCK</a> * </td>
716
<td class="paramname"><em>block</em>, </td>
719
<td class="paramkey"></td>
721
<td class="paramtype">BLOBNBOX_CLIST * </td>
722
<td class="paramname"><em>osd_blobs</em> </td>
733
<p>Definition at line <a class="el" href="a01098_source.html#l00187">187</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
734
<div class="fragment"><pre class="fragment"> {
735
<span class="keywordflow">return</span> stroke_width_-><a class="code" href="a00561.html#a2db693b25f867e5ac21177353f6abcac">TestVerticalTextDirection</a>(block, osd_blobs);
740
<a class="anchor" id="aa715f91e99d1002a1d64fc2d3c94f5eb"></a><!-- doxytag: member="tesseract::ColumnFinder::projection" ref="aa715f91e99d1002a1d64fc2d3c94f5eb" args="() const " -->
741
<div class="memitem">
742
<div class="memproto">
743
<table class="memname">
745
<td class="memname">const <a class="el" href="a00624.html">TextlineProjection</a>* <a class="el" href="a00327.html#aa715f91e99d1002a1d64fc2d3c94f5eb">tesseract::ColumnFinder::projection</a> </td>
747
<td class="paramname"></td><td>)</td>
748
<td> const<code> [inline]</code></td>
754
<p>Definition at line <a class="el" href="a01099_source.html#l00069">69</a> of file <a class="el" href="a01099_source.html">colfind.h</a>.</p>
755
<div class="fragment"><pre class="fragment"> {
756
<span class="keywordflow">return</span> &projection_;
761
<a class="anchor" id="a831ebc431728361a28b2ea33b952915d"></a><!-- doxytag: member="tesseract::ColumnFinder::set_cjk_script" ref="a831ebc431728361a28b2ea33b952915d" args="(bool is_cjk)" -->
762
<div class="memitem">
763
<div class="memproto">
764
<table class="memname">
766
<td class="memname">void <a class="el" href="a00327.html#a831ebc431728361a28b2ea33b952915d">tesseract::ColumnFinder::set_cjk_script</a> </td>
768
<td class="paramtype">bool </td>
769
<td class="paramname"><em>is_cjk</em></td><td>)</td>
770
<td><code> [inline]</code></td>
776
<p>Definition at line <a class="el" href="a01099_source.html#l00072">72</a> of file <a class="el" href="a01099_source.html">colfind.h</a>.</p>
777
<div class="fragment"><pre class="fragment"> {
778
cjk_script_ = is_cjk;
783
<a class="anchor" id="aa89aa6d591e18cf2e1ab136b06ae6ef7"></a><!-- doxytag: member="tesseract::ColumnFinder::SetEquationDetect" ref="aa89aa6d591e18cf2e1ab136b06ae6ef7" args="(EquationDetectBase *detect)" -->
784
<div class="memitem">
785
<div class="memproto">
786
<table class="memname">
788
<td class="memname">void <a class="el" href="a00327.html#aa89aa6d591e18cf2e1ab136b06ae6ef7">tesseract::ColumnFinder::SetEquationDetect</a> </td>
790
<td class="paramtype"><a class="el" href="a00371.html">EquationDetectBase</a> * </td>
791
<td class="paramname"><em>detect</em></td><td>)</td>
798
<p>Definition at line <a class="el" href="a01098_source.html#l00500">500</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
799
<div class="fragment"><pre class="fragment"> {
800
equation_detect_ = detect;
805
<a class="anchor" id="a6070b7972e60881ce2149b8640fa10fd"></a><!-- doxytag: member="tesseract::ColumnFinder::SetupAndFilterNoise" ref="a6070b7972e60881ce2149b8640fa10fd" args="(Pix *photo_mask_pix, TO_BLOCK *input_block)" -->
806
<div class="memitem">
807
<div class="memproto">
808
<table class="memname">
810
<td class="memname">void <a class="el" href="a00327.html#a6070b7972e60881ce2149b8640fa10fd">tesseract::ColumnFinder::SetupAndFilterNoise</a> </td>
812
<td class="paramtype">Pix * </td>
813
<td class="paramname"><em>photo_mask_pix</em>, </td>
816
<td class="paramkey"></td>
818
<td class="paramtype"><a class="el" href="a00627.html">TO_BLOCK</a> * </td>
819
<td class="paramname"><em>input_block</em> </td>
830
<p>Definition at line <a class="el" href="a01098_source.html#l00151">151</a> of file <a class="el" href="a01098_source.html">colfind.cpp</a>.</p>
831
<div class="fragment"><pre class="fragment"> {
832
part_grid_.<a class="code" href="a00268.html#a1d2990adf323d7910fbf87b6fc3a7415">Init</a>(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>(), <a class="code" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>(), <a class="code" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>());
833
<span class="keywordflow">if</span> (stroke_width_ != NULL)
834
<span class="keyword">delete</span> stroke_width_;
835
stroke_width_ = <span class="keyword">new</span> StrokeWidth(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>(), <a class="code" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>(), <a class="code" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>());
836
min_gutter_width_ = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a01265.html#af587ca3f993f7a3b54bdb0fac568d620">kMinGutterWidthGrid</a> * <a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>());
837
input_block-><a class="code" href="a00627.html#a9b17e51cab6a0a8b6d8220443a2e9aa7">ReSetAndReFilterBlobs</a>();
838
<span class="preprocessor"> #ifndef GRAPHICS_DISABLED</span>
839
<span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="a01265.html#a2cf06f05891f0dd3da71052588e05baf">textord_tabfind_show_blocks</a>) {
840
input_blobs_win_ = <a class="code" href="a00268.html#aa716f76c7f04f7112abfc10a3f8c63e0">MakeWindow</a>(0, 0, <span class="stringliteral">"Filtered Input Blobs"</span>);
841
input_block-><a class="code" href="a00627.html#afd0504ca5c8fa605fbea3dbca2d8ee2e">plot_graded_blobs</a>(input_blobs_win_);
843
<span class="preprocessor"> #endif // GRAPHICS_DISABLED</span>
844
<span class="preprocessor"></span> <a class="code" href="a00586.html#a933d26eedcaa45e623f33559cbe69aa6">SetBlockRuleEdges</a>(input_block);
845
pixDestroy(&nontext_map_);
846
<span class="comment">// Run a preliminary strokewidth neighbour detection on the medium blobs.</span>
847
stroke_width_-><a class="code" href="a00561.html#a8273b43eb6170be582f30d5049aec523">SetNeighboursOnMediumBlobs</a>(input_block);
848
CCNonTextDetect nontext_detect(<a class="code" href="a00406.html#afff2cee730084711205977b5fcb4901e">gridsize</a>(), <a class="code" href="a00406.html#ad20b2cb8eb2bf52871d5260c04949cce">bleft</a>(), <a class="code" href="a00406.html#aa94e147841b6a4fae0b28e7e872685a5">tright</a>());
849
<span class="comment">// Remove obvious noise and make the initial non-text map.</span>
850
nontext_map_ = nontext_detect.ComputeNonTextMask(<a class="code" href="a01084.html#ace3f88c2ebef0843236018cd170eea14">textord_debug_tabfind</a>,
851
photo_mask_pix, input_block);
852
stroke_width_-><a class="code" href="a00561.html#aadfc985b5ed12df5ac545b344a304326">FindTextlineDirectionAndFixBrokenCJK</a>(cjk_script_, input_block);
853
<span class="comment">// Clear the strokewidth grid ready for rotation or leader finding.</span>
854
stroke_width_-><a class="code" href="a00268.html#a0b373075bdfda41719d6fb9a64bcfee0">Clear</a>();
859
<hr/>The documentation for this class was generated from the following files:<ul>
860
<li>/usr/local/google/home/jbreiden/tesseract-ocr-read-only/textord/<a class="el" href="a01099_source.html">colfind.h</a></li>
861
<li>/usr/local/google/home/jbreiden/tesseract-ocr-read-only/textord/<a class="el" href="a01098_source.html">colfind.cpp</a></li>
863
</div><!-- contents -->
865
<!-- window showing the filter options -->
866
<div id="MSearchSelectWindow"
867
onmouseover="return searchBox.OnSearchSelectShow()"
868
onmouseout="return searchBox.OnSearchSelectHide()"
869
onkeydown="return searchBox.OnSearchSelectKey(event)">
870
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Defines</a></div>
872
<!-- iframe showing the search results (closed by default) -->
873
<div id="MSearchResultsWindow">
874
<iframe src="javascript:void(0)" frameborder="0"
875
name="MSearchResults" id="MSearchResults">
879
<div id="nav-path" class="navpath">
881
<li class="navelem"><a class="el" href="a01265.html">tesseract</a> </li>
882
<li class="navelem"><a class="el" href="a00327.html">ColumnFinder</a> </li>
884
<li class="footer">Generated on Mon Feb 3 2014 10:59:22 for tesseract by
885
<a href="http://www.doxygen.org/index.html">
886
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>