Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1015230 // getLearnedCharacters2 - OLD

JavaX fragment (include)

1  
static Map<S, BWImage> getLearnedCharacters2() {
2  
  Concepts in = new Concepts("#1006104").safeLoad();
3  
  L<S> lines = (L) cget(first(list(in, "RecogInfo")), "lines");
4  
  new HashSet<S> md5s;
5  
  new Matches m;
6  
  for (S s : lines)
7  
    if (matchStart("the images *", s, m))
8  
      md5s.addAll(splitAtSpace($1));
9  
  //print("MD5s we're looking for: " + struct(md5s));
10  
  
11  
  Concepts in2 = new Concepts("#1005951").load();
12  
  new HashMap<S, BWImage> md5ToImage;
13  
  for (GrabbedImage gi : list(in2, GrabbedImage)) {
14  
    if (md5s.contains(gi.md5))
15  
      md5ToImage.put(gi.md5, gi.image);
16  
    for (BWImage cImg : horizontalAutoSplitToImages(gi.image)) {
17  
      S md5 = md5OfBWImage(cImg);
18  
      if (md5s.contains(md5))
19  
        md5ToImage.put(md5, cImg);
20  
    }
21  
  }
22  
  
23  
  int found = 0;
24  
  for (S md5 : md5s) {
25  
    BWImage img = md5ToImage.get(md5);
26  
    if (img != null) ++found;
27  
  }
28  
  //print("Found: " + found + "/" + l(md5s));
29  
  ret md5ToImage;
30  
}

Author comment

Began life as a copy of #1006193

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1015230
Snippet name: getLearnedCharacters2 - OLD
Eternal ID of this version: #1015230/1
Text MD5: 2fe0e367f98c45463512e49b8cc1fc66
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-10 21:50:39
Source code size: 957 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 371 / 388
Referenced in: [show references]