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

36
LINES

< > BotCompany Repo | #1003732 // Try Finding Peppermint Logo On Screen

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 1092K of libraries. Click here for Pure Java version (340L/3K/10K).

1  
!752
2  
3  
lib 1003721 // lookup
4  
lib 1003724 // commons io
5  
lib 1003727 // commons lang
6  
lib 1003729 // jhlabs filters
7  
8  
import com.github.axet.lookup.*;
9  
import com.github.axet.lookup.common.GFirst;
10  
import com.github.axet.lookup.common.GPoint;
11  
import com.github.axet.lookup.common.ImageBinaryGreyScale;
12  
13  
static double scale = 1 /*0.5*/; // make images smaller to speed up search
14  
15  
p {
16  
  BufferedImage template = loadBufferedImage("#1003730");
17  
  
18  
  LookupScale s = new LookupScale(0.2f, 10, 0.65f, 0.95f);
19  
20  
  BufferedImage image;
21  
  ImageBinaryGreyScale si, st;
22  
  
23  
  time {
24  
    image = shootScreen2();
25  
    si = new ImageBinaryGreyScale(scaleImage(image, scale));
26  
    st = new ImageBinaryGreyScale(scaleImage(template, scale));
27  
  }
28  
29  
  twice { time {
30  
    print("Searching for logo...");
31  
    
32  
    L<GPoint> pp = (L) s.lookupAll(si, st);
33  
    Collections.sort(pp, new GFirst);
34  
    for (GPoint p : pp) print(p);
35  
  }}
36  
}

Author comment

Began life as a copy of #1003728

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003732
Snippet name: Try Finding Peppermint Logo On Screen
Eternal ID of this version: #1003732/1
Text MD5: 4ae05a30a66fc81b982aeeaf1d06a3a5
Transpilation MD5: e26b679c9c373f2680d19f8e7dff845f
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-26 17:40:17
Source code size: 938 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 577 / 670
Referenced in: [show references]