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

24
LINES

< > BotCompany Repo | #1015346 // getLearnedCharacters2 v1 (reads all clips)

JavaX fragment (include)

static Map<S, BWImage> getLearnedCharacters2() {
  new Matches m;
  new HashSet<S> md5s;
  for (S s : scanLog_iterator(glyphTeachLog()))
    if (find3("the images *", afterSquareBracketStuff(s), m))
      md5s.addAll(splitAtSpace($1));
  //print("MD5s we're looking for: " + struct(md5s));
  
  new HashMap<S, BWImage> md5ToImage;
  for (S md5, File f : screenClipFiles()) {
    BWImage img = loadBWImage(f);
    if (md5s.contains(md5))
      md5ToImage.put(md5, img);
    for (BWImage cImg : horizontalAutoSplitToImages(img)) {
      S cMD5 = ocrMD5OfBWImage(cImg);
      if (md5s.contains(cMD5))
        md5ToImage.put(cMD5, cImg);
    }
  }
  
  int found = l(md5ToImage);
  print("Found character images: " + found + "/" + l(md5s));
  ret md5ToImage;
}

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: #1015346
Snippet name: getLearnedCharacters2 v1 (reads all clips)
Eternal ID of this version: #1015346/1
Text MD5: f94e4d23480212cdc037afc9ac70695f
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-13 12:31:17
Source code size: 779 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 258 / 291
Referenced in: [show references]