-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·301 lines (275 loc) · 10.9 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<title>Citra App</title>
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="styles/range.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css">
<!-- TODO add manifest here -->
<style>
.ct-series-a .ct-bar {
stroke-width: 1px;
}
.xred .ct-series-a .ct-bar{
stroke: red;
}
.xgreen .ct-series-a .ct-bar{
stroke: green;
}
.xblue .ct-series-a .ct-bar{
stroke: blue;
}
.xgrey .ct-series-a .ct-bar{
stroke: grey;
}
.ct-series-a .ct-point {
stroke-width: 1px;
}
.xred .ct-series-a .ct-point {
stroke: red;
}
.xgreen .ct-series-a .ct-point {
stroke: green;
}
.xblue .ct-series-a .ct-point {
stroke: blue;
}
.xgrey .ct-series-a .ct-point {
stroke: gray;
}
</style>
</head>
<body>
<nav class="blue darken-2" role="navigation">
<div class="nav-wrapper container" style="width:95%">
<a id="logo-container" href="#" class="brand-logo left">Citra</a>
<ul class="right">
<li><a id="butCamera"><i class="material-icons">camera_alt</i></a></li>
<li><a id="butGallery"><i class="material-icons">image</i></a></li>
</div>
</nav>
<input id="inputImageCamera" type="file" accept="image/*" capture hidden>
<input id="inputImageGallery" type="file" accept="image/*" hidden>
<div class="row" style="margin-bottom:3px; margin-top:15px">
<div class="col s12">
<div class="input-field col s12" style="margin-bottom:5px">
<select id="app-mode">
<option value="equalization">Histogram Equalization</option>
<option value="specification">Histogram Match (Specification)</option>
<option value="ocr">Character Detection (Chain Code)</option>
<option value="thinning">Character Thinning</option>
<option value="thinning-ocr">Character Detection</option>
<option value="filter">Image Filter</option>
<option value="face-detection">Face Detection</option>
</select>
<label>Select mode:</label>
</div>
</div>
</div>
<div class="container" style="width:100%">
<div class="row valign-wrapper">
<div class="col s6">
<div class="card">
<div class="card-image">
<img id="imgBefore" src="images/empty.png" style='height: auto; width: 100%'>
</div>
</div>
</div>
<div class="col s6">
<div class="card">
<div class="card-image">
<img id="imgAfter" src="images/empty.png" style='height: auto; width: 100%'>
</div>
</div>
</div>
</div>
</div>
<span id="filterInputOptionsView" hidden>
<div class="row" style="margin-bottom:3px; margin-top:15px">
<div class="col s12">
<div class="input-field col s12" style="margin-bottom:5px">
<select id="filter-mode">
<option value="median-filter">Median Filter</option>
<option value="gradient-filter">Gradient Filter</option>
<option value="difference-filter">Difference Filter</option>
<option value="prewitt-filter">Prewitt Filter</option>
<option value="sobel-filter">Sobel Filter</option>
<option value="roberts-filter">Roberts Filter</option>
<option value="freichen-filter">Freichen Filter</option>
<option value="custom-filter">Custom Filter</option>
</select>
<label>Select filter:</label>
</div>
</div>
</div>
<span id="customFilterInput" hidden>
<div class="row center">
<div class="col s2 offset-s3 center">
<input placeholder="1" id="filter_1" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_2" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_3" type="number" class="center" value="1">
</div>
</div>
<div class="row center">
<div class="col s2 offset-s3 center">
<input placeholder="1" id="filter_4" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_5" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_6" type="number" class="center" value="1">
</div>
</div>
<div class="row center">
<div class="col s2 offset-s3 center">
<input placeholder="1" id="filter_7" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_8" type="number" class="center" value="1">
</div>
<div class="col s2 center">
<input placeholder="1" id="filter_9" type="number" class="center" value="1">
</div>
</div>
</span>
<div class="row">
<div class="col s12 center">
<a class="waves-effect waves-light btn blue darken-1" id="btnProcessFilter" style="width:100%">Process</a>
</div>
</div>
</span>
<hr>
<span id="inputHistogram" hidden>
<div class="row center" style="margin-bottom:0px">
<div class="col s12">
<small>Set desired histogram:</small>
</div>
<div class="col s2 center" style="height: 70px; margin-top:50px">
<input id="slider-0" class='range vertical-heighest-first round' type='range' min='0' max='100' step='1' value='1'>
</div>
<div class="col s2 center" style="height: 70px; margin-top:50px">
<input id="slider-1" class='range vertical-heighest-first round' type='range' min='0' max='100' step='1' value='1'>
</div>
<div class="col s2 center" style="height: 70px; margin-top:50px">
<input id="slider-2" class='range vertical-heighest-first round' type='range' min='0' max='100' step='1' value='1'>
</div>
<div class="col s2 center" style="height: 70px; margin-top:50px">
<input id="slider-3" class='range vertical-heighest-first round' type='range' min='0' max='100' step='1' value='1'>
</div>
<div class="col s2 center" style="height: 70px; margin-top:50px">
<input id="slider-4" class='range vertical-heighest-first round' type='range' min='0' max='100' step='1' value='1'>
</div>
</div>
<div class="row">
<div class="col s2" style="padding:0px">
<small id="value-slider-0" class="right">10</small>
</div>
<div class="col s2" style="padding:0px">
<small id="value-slider-1" class="right">50</small>
</div>
<div class="col s2" style="padding:0px">
<small id="value-slider-2" class="right">90</small>
</div>
<div class="col s2" style="padding:0px">
<small id="value-slider-3" class="right">50</small>
</div>
<div class="col s2" style="padding:0px">
<small id="value-slider-4" class="right">10</small>
</div>
</div>
<div class="row">
<div class="col s12 center">
<a class="waves-effect waves-light btn blue darken-1" id="btnProcessSpecification" style="width:100%">Process</a>
</div>
</div>
<hr>
</span>
<canvas id="myCanvas" width="250" height="300" style="border:1px solid #d3d3d3;"></canvas>
<span id="viewHistogram" hidden>
<div id="viewDesiredHistogram" class="row" style="margin-bottom: -10px" hidden>
<div class="col s6 offset-s3 center">
<small>Desired Histogram</small>
<div id="histDesired" class="ct-chart ct-perfect-fourth xblue"></div>
</div>
</div>
<div class="row">
<div class="col s6 center">
<small id="titleHistRed">Red Before</small>
<div id="histRed" class="ct-chart ct-perfect-fourth xred"></div>
</div>
<div class="col s6 center">
<small id="titleCumRed">Red After</small>
<div id="cumRed" class="ct-chart ct-perfect-fourth xred"></div>
</div>
<div class="col s6 center">
<small id="titleHistGreen">Green Before</small>
<div id="histGreen" class="ct-chart ct-perfect-fourth xgreen"></div>
</div>
<div class="col s6 center">
<small id="titleCumGreen">Green After</small>
<div id="cumGreen" class="ct-chart ct-perfect-fourth xgreen"></div>
</div>
<div class="col s6 center">
<small id="titleHistBlue">Blue Before</small>
<div id="histBlue" class="ct-chart ct-perfect-fourth xblue"></div>
</div>
<div class="col s6 center">
<small id="titleCumBlue">Blue After</small>
<div id="cumBlue" class="ct-chart ct-perfect-fourth xblue"></div>
</div>
<div class="col s6 center">
<small id="titleHistGrey">Grey Before</small>
<div id="histGrey" class="ct-chart ct-perfect-fourth xgrey"></div>
</div>
<div class="col s6 center">
<small id="titleCumGrey">Grey After</small>
<div id="cumGrey" class="ct-chart ct-perfect-fourth xgrey"></div>
</div>
<div class="col s12 center" hidden>
<canvas id="canvasHist" width="300" height="250" style="border: 1px solid black">Your browser does not have support for Canvas.</canvas>
</div>
</div>
<hr>
</span>
<span id="predictionResultView" hidden>
<div class="row">
<div class="col s12 center">
<p>Predicted Character:</p>
<h3 id="predictedChar">1</h3>
<small id="predictedASCII">[ASCII=49]</small>
</div>
<div class="col s12 center">
<small id="chainCodeResult" hidden>
Boundary square: (19,12) (39,93)<br>
#Chain code 0 : 25 <br>
#Chain code 1 : 3 <br>
#Chain code 2 : 32 <br>
#Chain code 3 : 7 <br>
#Chain code 4 : 25 <br>
#Chain code 5 : 3 <br>
#Chain code 6 : 12 <br>
#Chain code 7 : 28 <br>
</small>
</div>
</div>
<hr>
</span>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/js/materialize.min.js"></script>
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script src="scripts/regression.js" async></script>
<script src="scripts/main.js"></script>
</body>
</html>