-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.html
67 lines (65 loc) · 1.96 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
<!doctype html>
<html>
<head>
<title>jbowen</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="/../../cbl.js"></script>
<style>
#debugPreprocessed img {
display: block;
}
.note {
margin: 0 0 15px 0;
font-weight: bold;
}
img {
margin: 5px 5px 0 0;
}
</style>
</head>
<body>
<div class="note">
Example in response to <a href="https://github.com/skotz/cbl-js/issues/32">Question #32</a>. Demonstrates exact character splitting.
</div>
<div class="main">
<div id="debugPreprocessed"></div>
<div id="debugSegmented"></div>
<div id="solution"></div>
<div id="visualizeModel"></div>
</div>
<script>
var cbl = new CBL({
preprocess: function(img) {
img.debugImage("debugPreprocessed");
img.binarize(32);
img.debugImage("debugPreprocessed");
img.colorRegions(50, true, 1);
img.debugImage("debugPreprocessed");
},
character_set: "0123456789abcdefghijklmnopqrstuvwxyz",
exact_characters: 6,
exact_characters_width: 24,
exact_characters_play: 3,
pattern_width: 24,
pattern_height: 24,
blob_min_pixels: 1,
blob_max_pixels: 10000,
allow_console_log: true,
blob_console_debug: true,
blob_debug: "debugSegmented"
});
cbl.train("555apa.jpg");
cbl.train("658d35.jpg");
cbl.train("dfdndf.jpg");
cbl.train("g2np4n.jpg");
cbl.train("mdn5m5.jpg");
cbl.train("wxenmc.jpg");
var saveModel = function() {
cbl.condenseModel();
cbl.sortModel();
cbl.visualizeModel("visualizeModel");
cbl.saveModel();
}
</script>
</body>
</html>