Libraryless. Click here for Pure Java version (5931L/38K/136K).
1 | !752 |
2 | |
3 | concepts. |
4 | |
5 | concept Result { |
6 | BWImage inputImage; |
7 | float horizontalSplitThreshold; |
8 | L<BWImage> characters; |
9 | S text; |
10 | } |
11 | |
12 | static new MultiMap<S, S> md5ToChar; |
13 | |
14 | p-awt { |
15 | L<L> data = getData(); |
16 | JTable table = showTableWithImages("Taught Characters", splitAtSpace("Image MD5 Character"), data); |
17 | table.setRowHeight(25); |
18 | } |
19 | |
20 | static L<L> getData() { |
21 | Concepts in = new Concepts("#1005726").load(); |
22 | |
23 | new L<L> data; |
24 | for (Result r : in.list(Result)) { |
25 | S text = contains(r.text, "[") ? "" : r.text; |
26 | for (int i = 0; i < l(r.characters); i++) { |
27 | BWImage clip = autoCroppedBWImage(r.characters.get(i)); |
28 | S md5 = md5OfBWImage(clip); |
29 | S c = substring(text, i, i+1); |
30 | S s = or2(c, "?"); |
31 | if (nempty(c)) |
32 | md5ToChar.setPut(md5, c); |
33 | data.add(ll(clip.getBufferedImage(), md5, s)); |
34 | } |
35 | } |
36 | sortByIndex(data, 2); |
37 | ret data; |
38 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005947 |
Snippet name: | Take learned characters from #1005726 |
Eternal ID of this version: | #1005947/1 |
Text MD5: | b6750c6e2e001c2f4f2a7ba3c9024561 |
Transpilation MD5: | 6ad8b28b923291102a5446b12f9a4176 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-13 04:12:12 |
Source code size: | 908 bytes / 38 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 442 / 793 |
Referenced in: | [show references] |