-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbinarize__reg_8c_source.html
319 lines (313 loc) · 29.5 KB
/
binarize__reg_8c_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<!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"/>
<title>Leptonica: prog/binarize_reg.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
function addClass(ele,cls) {
if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
function removeClass(ele,cls) {
if (hasClass(ele,cls)) {
var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
ele.className=ele.className.replace(reg,' ');
}
}
function toggleVisibility(linkObj) {
var base = linkObj.getAttribute('id');
var summary = document.getElementById(base + '-summary');
var content = document.getElementById(base + '-content');
var trigger = document.getElementById(base + '-trigger');
if ( hasClass(linkObj,'closed') ) {
summary.style.display = 'none';
content.style.display = 'block';
trigger.src = 'open.png';
removeClass(linkObj,'closed');
addClass(linkObj,'opened');
} else if ( hasClass(linkObj,'opened') ) {
summary.style.display = 'block';
content.style.display = 'none';
trigger.src = 'closed.png';
removeClass(linkObj,'opened');
addClass(linkObj,'closed');
}
return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="moller52-tiny.jpg"></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Leptonica <span id="projectnumber">1.68</span></div>
<div id="projectbrief">C Image Processing Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('binarize__reg_8c.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<h1>binarize_reg.c</h1> </div>
</div>
<div class="contents">
<a href="binarize__reg_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*====================================================================*</span>
<a name="l00002"></a>00002 <span class="comment"> - Copyright (C) 2001 Leptonica. All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment"> - This software is distributed in the hope that it will be</span>
<a name="l00004"></a>00004 <span class="comment"> - useful, but with NO WARRANTY OF ANY KIND.</span>
<a name="l00005"></a>00005 <span class="comment"> - No author or distributor accepts responsibility to anyone for the</span>
<a name="l00006"></a>00006 <span class="comment"> - consequences of using this software, or for whether it serves any</span>
<a name="l00007"></a>00007 <span class="comment"> - particular purpose or works at all, unless he or she says so in</span>
<a name="l00008"></a>00008 <span class="comment"> - writing. Everyone is granted permission to copy, modify and</span>
<a name="l00009"></a>00009 <span class="comment"> - redistribute this source code, for commercial or non-commercial</span>
<a name="l00010"></a>00010 <span class="comment"> - purposes, with the following restrictions: (1) the origin of this</span>
<a name="l00011"></a>00011 <span class="comment"> - source code must not be misrepresented; (2) modified versions must</span>
<a name="l00012"></a>00012 <span class="comment"> - be plainly marked as such; and (3) this notice may not be removed</span>
<a name="l00013"></a>00013 <span class="comment"> - or altered from any source or modified source distribution.</span>
<a name="l00014"></a>00014 <span class="comment"> *====================================================================*/</span>
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="comment">/*</span>
<a name="l00017"></a>00017 <span class="comment"> * binarize_reg.c</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * Tests Sauvola local binarization and variants</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="preprocessor">#include "allheaders.h"</span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <a class="code" href="struct_pix.html">PIX</a> *<a class="code" href="binarize__reg_8c.html#ae7aaef8bc345a2c20e61e280f650af4d">PixTest1</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>, <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor, <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp);
<a name="l00025"></a>00025 <a class="code" href="struct_pix.html">PIX</a> *<a class="code" href="binarize__reg_8c.html#a9b4e8e7462b3f287e8065d73d67011c8">PixTest2</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>, <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa4374004b101d3331b46aeef4a143df0">nx</a>,
<a name="l00026"></a>00026 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa550651119730c08ba0d3ceb1f7c6b5f">ny</a>, <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp);
<a name="l00027"></a>00027 <span class="keywordtype">void</span> <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>, <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor,
<a name="l00028"></a>00028 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa4374004b101d3331b46aeef4a143df0">nx</a>, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa550651119730c08ba0d3ceb1f7c6b5f">ny</a>, <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> paircount, <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp);
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="binarize__reg_8c.html#a5ea466849f21e6c2be4ef9b2eb8868d3">00030</a> <a class="code" href="src_2endiantest_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc,
<a name="l00031"></a>00031 <span class="keywordtype">char</span> **argv)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <a class="code" href="struct_pix.html">PIX</a> *pixs, *pixt1, *pixt2;
<a name="l00034"></a>00034 <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp;
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordflow">if</span> (<a class="code" href="leptprotos_8h.html#ae0217b9c267e3898440aaf6a026efb8d">regTestSetup</a>(argc, argv, &rp))
<a name="l00037"></a>00037 <span class="keywordflow">return</span> 1;
<a name="l00038"></a>00038
<a name="l00039"></a>00039 pixs = <a class="code" href="leptprotos_8h.html#a84634846cbb5e01df667d6e9241dfc53">pixRead</a>(<span class="stringliteral">"w91frag.jpg"</span>);
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(pixs, 3, 0.20, 2, 3, 0, rp);
<a name="l00042"></a>00042 <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(pixs, 6, 0.20, 100, 100, 1, rp);
<a name="l00043"></a>00043 <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(pixs, 10, 0.40, 10, 10, 2, rp);
<a name="l00044"></a>00044 <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(pixs, 10, 0.40, 20, 20, 3, rp);
<a name="l00045"></a>00045 <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(pixs, 20, 0.34, 30, 30, 4, rp);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 pixt1 = <a class="code" href="binarize__reg_8c.html#ae7aaef8bc345a2c20e61e280f650af4d">PixTest1</a>(pixs, 7, 0.34, rp);
<a name="l00048"></a>00048 pixt2 = <a class="code" href="binarize__reg_8c.html#a9b4e8e7462b3f287e8065d73d67011c8">PixTest2</a>(pixs, 7, 0.34, 4, 4, rp);
<a name="l00049"></a>00049 <a class="code" href="leptprotos_8h.html#a3908fc7dae17785821ec232dca3a6c06">regTestComparePix</a>(rp, pixt1, pixt2);
<a name="l00050"></a>00050 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt1);
<a name="l00051"></a>00051 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt2);
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="comment">/* Do combination of contrast norm and sauvola */</span>
<a name="l00054"></a>00054 pixt1 = <a class="code" href="adaptmap_8c.html#a502604211c3a2d99257c5e1fe0b1990b">pixContrastNorm</a>(<a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, pixs, 100, 100, 55, 1, 1);
<a name="l00055"></a>00055 <a class="code" href="binarize_8c.html#a29c6c3ef62cd152b51b0de1b41194f01">pixSauvolaBinarizeTiled</a>(pixt1, 8, 0.34, 1, 1, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, &pixt2);
<a name="l00056"></a>00056 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixt1, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635a2ec77ead70eea85c6d7cc7372ea7394e">IFF_PNG</a>);
<a name="l00057"></a>00057 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixt2, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635a2ec77ead70eea85c6d7cc7372ea7394e">IFF_PNG</a>);
<a name="l00058"></a>00058 <a class="code" href="leptprotos_8h.html#abfdb7bca89ec16e69b7f9748823cf7aa">pixDisplayWithTitle</a>(pixt1, 100, 500, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, rp-><a class="code" href="struct_l___reg_params.html#a6907e4514a9014ba21bb23e5faf85923">display</a>);
<a name="l00059"></a>00059 <a class="code" href="leptprotos_8h.html#abfdb7bca89ec16e69b7f9748823cf7aa">pixDisplayWithTitle</a>(pixt2, 700, 500, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, rp-><a class="code" href="struct_l___reg_params.html#a6907e4514a9014ba21bb23e5faf85923">display</a>);
<a name="l00060"></a>00060 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt1);
<a name="l00061"></a>00061 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt2);
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <a class="code" href="leptprotos_8h.html#aaa96f119e2744e286fdb1cab5562673a">regTestCleanup</a>(rp);
<a name="l00064"></a>00064 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixs);
<a name="l00065"></a>00065 <span class="keywordflow">return</span> 0;
<a name="l00066"></a>00066 }
<a name="l00067"></a>00067
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <a class="code" href="struct_pix.html">PIX</a> *
<a name="l00070"></a><a class="code" href="binarize__reg_8c.html#ae7aaef8bc345a2c20e61e280f650af4d">00070</a> <a class="code" href="binarize__reg_8c.html#ae7aaef8bc345a2c20e61e280f650af4d">PixTest1</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs,
<a name="l00071"></a>00071 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>,
<a name="l00072"></a>00072 <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor,
<a name="l00073"></a>00073 <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp)
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> w, h;
<a name="l00076"></a>00076 <a class="code" href="struct_pix.html">PIX</a> *pixm, *pixsd, *pixth, *pixd, *pixt;
<a name="l00077"></a>00077 <a class="code" href="struct_pixa.html">PIXA</a> *pixa;
<a name="l00078"></a>00078
<a name="l00079"></a>00079 pixm = pixsd = pixth = pixd = <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00080"></a>00080 <a class="code" href="leptprotos_8h.html#a11b8bc890f3872b0a19307f4c5a9b41e">pixGetDimensions</a>(pixs, &w, &h, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>);
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="comment">/* Get speed */</span>
<a name="l00083"></a>00083 <a class="code" href="leptprotos_8h.html#a3b58105731ea14395c2e99707cb53bd6">startTimer</a>();
<a name="l00084"></a>00084 <a class="code" href="binarize_8c.html#a4879910917d9f3fc56f14b358bbff5f2">pixSauvolaBinarize</a>(pixs, size, factor, 1, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, &pixd);
<a name="l00085"></a>00085 fprintf(stderr, <span class="stringliteral">"\nSpeed: 1 tile, %7.3f Mpix/sec\n"</span>,
<a name="l00086"></a>00086 (w * h / 1000000.) / <a class="code" href="leptprotos_8h.html#a5b08ca0bdebf5dc30d27676baa5a82ba">stopTimer</a>());
<a name="l00087"></a>00087 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixd);
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="comment">/* Get results */</span>
<a name="l00090"></a>00090 <a class="code" href="binarize_8c.html#a4879910917d9f3fc56f14b358bbff5f2">pixSauvolaBinarize</a>(pixs, size, factor, 1, &pixm, &pixsd, &pixth, &pixd);
<a name="l00091"></a>00091 pixa = <a class="code" href="leptprotos_8h.html#a7a6d1b9b5457c3dc9bc8f77a39a81147">pixaCreate</a>(0);
<a name="l00092"></a>00092 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixm, pixa, 1, 1, 30, 8);
<a name="l00093"></a>00093 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixsd, pixa, 1, 0, 30, 8);
<a name="l00094"></a>00094 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixth, pixa, 1, 1, 30, 8);
<a name="l00095"></a>00095 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixd, pixa, 1, 0, 30, 8);
<a name="l00096"></a>00096 pixt = <a class="code" href="leptprotos_8h.html#a6535561de2a8024c72d75babe15131a9">pixaDisplay</a>(pixa, 0, 0);
<a name="l00097"></a>00097 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixt, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635af0d248e8c70ac2d66a436f0967d6663e">IFF_JFIF_JPEG</a>);
<a name="l00098"></a>00098 <span class="keywordflow">if</span> (rp-><a class="code" href="struct_l___reg_params.html#a6fa45512d6be2dfca4fd0621f3527b08">index</a> < 5)
<a name="l00099"></a>00099 <a class="code" href="leptprotos_8h.html#abfdb7bca89ec16e69b7f9748823cf7aa">pixDisplayWithTitle</a>(pixt, 100, 100, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, rp-><a class="code" href="struct_l___reg_params.html#a6907e4514a9014ba21bb23e5faf85923">display</a>);
<a name="l00100"></a>00100 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixd, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635a2ec77ead70eea85c6d7cc7372ea7394e">IFF_PNG</a>);
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <a class="code" href="leptprotos_8h.html#a6775cff91fdef2336a3f3037f7bb55f3">pixaDestroy</a>(&pixa);
<a name="l00103"></a>00103 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixm);
<a name="l00104"></a>00104 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixsd);
<a name="l00105"></a>00105 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixth);
<a name="l00106"></a>00106 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt);
<a name="l00107"></a>00107 <span class="keywordflow">return</span> pixd;
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <a class="code" href="struct_pix.html">PIX</a> *
<a name="l00112"></a><a class="code" href="binarize__reg_8c.html#a9b4e8e7462b3f287e8065d73d67011c8">00112</a> <a class="code" href="binarize__reg_8c.html#a9b4e8e7462b3f287e8065d73d67011c8">PixTest2</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs,
<a name="l00113"></a>00113 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>,
<a name="l00114"></a>00114 <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor,
<a name="l00115"></a>00115 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa4374004b101d3331b46aeef4a143df0">nx</a>,
<a name="l00116"></a>00116 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa550651119730c08ba0d3ceb1f7c6b5f">ny</a>,
<a name="l00117"></a>00117 <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp)
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> w, h;
<a name="l00120"></a>00120 <a class="code" href="struct_pix.html">PIX</a> *pixth, *pixd, *pixt;
<a name="l00121"></a>00121 <a class="code" href="struct_pixa.html">PIXA</a> *pixa;
<a name="l00122"></a>00122
<a name="l00123"></a>00123 pixth = pixd = <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00124"></a>00124 <a class="code" href="leptprotos_8h.html#a11b8bc890f3872b0a19307f4c5a9b41e">pixGetDimensions</a>(pixs, &w, &h, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>);
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">/* Get speed */</span>
<a name="l00127"></a>00127 <a class="code" href="leptprotos_8h.html#a3b58105731ea14395c2e99707cb53bd6">startTimer</a>();
<a name="l00128"></a>00128 <a class="code" href="binarize_8c.html#a29c6c3ef62cd152b51b0de1b41194f01">pixSauvolaBinarizeTiled</a>(pixs, size, factor, nx, ny, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, &pixd);
<a name="l00129"></a>00129 fprintf(stderr, <span class="stringliteral">"Speed: %d x %d tiles, %7.3f Mpix/sec\n"</span>,
<a name="l00130"></a>00130 nx, ny, (w * h / 1000000.) / <a class="code" href="leptprotos_8h.html#a5b08ca0bdebf5dc30d27676baa5a82ba">stopTimer</a>());
<a name="l00131"></a>00131 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixd);
<a name="l00132"></a>00132
<a name="l00133"></a>00133 <span class="comment">/* Get results */</span>
<a name="l00134"></a>00134 <a class="code" href="binarize_8c.html#a29c6c3ef62cd152b51b0de1b41194f01">pixSauvolaBinarizeTiled</a>(pixs, size, factor, nx, ny, &pixth, &pixd);
<a name="l00135"></a>00135 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixth, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635af0d248e8c70ac2d66a436f0967d6663e">IFF_JFIF_JPEG</a>);
<a name="l00136"></a>00136 <a class="code" href="leptprotos_8h.html#a97c8ca0f6272805d6679e683c1073600">regTestWritePixAndCheck</a>(rp, pixd, <a class="code" href="imageio_8h.html#a726ca809ffd3d67ab4b8476646f26635a2ec77ead70eea85c6d7cc7372ea7394e">IFF_PNG</a>);
<a name="l00137"></a>00137 <span class="keywordflow">if</span> (rp-><a class="code" href="struct_l___reg_params.html#a6fa45512d6be2dfca4fd0621f3527b08">index</a> < 5 && rp-><a class="code" href="struct_l___reg_params.html#a6907e4514a9014ba21bb23e5faf85923">display</a>) {
<a name="l00138"></a>00138 pixa = <a class="code" href="leptprotos_8h.html#a7a6d1b9b5457c3dc9bc8f77a39a81147">pixaCreate</a>(0);
<a name="l00139"></a>00139 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixth, pixa, 1, 1, 30, 8);
<a name="l00140"></a>00140 <a class="code" href="leptprotos_8h.html#a5bdc8398d337c9a8a7495421d34b8f2d">pixSaveTiled</a>(pixd, pixa, 1, 0, 30, 8);
<a name="l00141"></a>00141 pixt = <a class="code" href="leptprotos_8h.html#a6535561de2a8024c72d75babe15131a9">pixaDisplay</a>(pixa, 0, 0);
<a name="l00142"></a>00142 <a class="code" href="leptprotos_8h.html#abfdb7bca89ec16e69b7f9748823cf7aa">pixDisplayWithTitle</a>(pixt, 100, 400, <a class="code" href="environ_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, rp-><a class="code" href="struct_l___reg_params.html#a6907e4514a9014ba21bb23e5faf85923">display</a>);
<a name="l00143"></a>00143 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt);
<a name="l00144"></a>00144 <a class="code" href="leptprotos_8h.html#a6775cff91fdef2336a3f3037f7bb55f3">pixaDestroy</a>(&pixa);
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixth);
<a name="l00148"></a>00148 <span class="keywordflow">return</span> pixd;
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <span class="keywordtype">void</span>
<a name="l00153"></a><a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">00153</a> <a class="code" href="binarize__reg_8c.html#a49f2604324f5b7975ace465dc5cc929e">PixTest3</a>(<a class="code" href="struct_pix.html">PIX</a> *pixs,
<a name="l00154"></a>00154 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="warper__reg_8c.html#a711275dc7bbe85bb6fa721bc60b8637c">size</a>,
<a name="l00155"></a>00155 <a class="code" href="environ_8h.html#af59419416d96ecf5fca70c8d05adb456">l_float32</a> factor,
<a name="l00156"></a>00156 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa4374004b101d3331b46aeef4a143df0">nx</a>,
<a name="l00157"></a>00157 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> <a class="code" href="pixaatest_8c.html#aa550651119730c08ba0d3ceb1f7c6b5f">ny</a>,
<a name="l00158"></a>00158 <a class="code" href="environ_8h.html#a9085c7874153c280a4171244aa052e4e">l_int32</a> paircount,
<a name="l00159"></a>00159 <a class="code" href="struct_l___reg_params.html">L_REGPARAMS</a> *rp)
<a name="l00160"></a>00160 {
<a name="l00161"></a>00161 <a class="code" href="struct_pix.html">PIX</a> *pixt1, *pixt2;
<a name="l00162"></a>00162
<a name="l00163"></a>00163 pixt1 = <a class="code" href="binarize__reg_8c.html#ae7aaef8bc345a2c20e61e280f650af4d">PixTest1</a>(pixs, size, factor, rp);
<a name="l00164"></a>00164 pixt2 = <a class="code" href="binarize__reg_8c.html#a9b4e8e7462b3f287e8065d73d67011c8">PixTest2</a>(pixs, size, factor, nx, ny, rp);
<a name="l00165"></a>00165 <a class="code" href="leptprotos_8h.html#a3908fc7dae17785821ec232dca3a6c06">regTestComparePix</a>(rp, pixt1, pixt2);
<a name="l00166"></a>00166 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt1);
<a name="l00167"></a>00167 <a class="code" href="leptprotos_8h.html#a1b238e61b64e4e5c62f44849cddb9658">pixDestroy</a>(&pixt2);
<a name="l00168"></a>00168 <span class="keywordflow">return</span>;
<a name="l00169"></a>00169 }
<a name="l00170"></a>00170
</pre></div></div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="binarize__reg_8c.html">binarize_reg.c</a> </li>
<li class="footer">Generated by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<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>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</body>
</html>