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

21
LINES

< > BotCompany Repo | #1010722 // thingsOnScreenMap

JavaX fragment (include)

1  
static Set<S> thingsOnScreenMap_md5s;
2  
3  
static MultiMap<S, Rect> thingsOnScreenMap() {
4  
  ret thingsOnScreenMap(shootScreenBW());
5  
}
6  
  
7  
static MultiMap<S, Rect> thingsOnScreenMap(BWImage bwScreenShot) {
8  
  SS comments = thingsOnScreenDefinitions();
9  
  L<Rect> segments = autoSegment(bwScreenShot);
10  
  new MultiMap<S, Rect> map;
11  
  new HashSet<S> md5s;
12  
  for (Rect r : segments) {
13  
    RGBImage clip = bwScreenShot.clip(r).toRGB();
14  
    S md5 = rgbMD5(clip);
15  
    md5s.add(md5);
16  
    S text = comments.get(md5);
17  
    if (nempty(text)) map.put(text, r);
18  
  }
19  
  thingsOnScreenMap_md5s = md5s;
20  
  ret map;
21  
}

Author comment

Began life as a copy of #1010713

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: #1010722
Snippet name: thingsOnScreenMap
Eternal ID of this version: #1010722/7
Text MD5: 06d7afb918009fc1d33634c207139eba
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-08 15:05:30
Source code size: 609 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 416 / 503
Version history: 6 change(s)
Referenced in: [show references]