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

34
LINES

< > BotCompany Repo | #1006075 // Use "Lookup" (On-Screen OCR) For Finding Chess Board (might work, but very slow)

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

Transpiled version (835L) is out of date.

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  
p {
14  
  BufferedImage screen = loadBufferedImage("#1006074");
15  
  BufferedImage pat1 = loadBufferedImage("#1006069");
16  
  BufferedImage pat2 = loadBufferedImage("#1006072");
17  
18  
  LookupScale s = new LookupScale(0.2f, 10, 0.65f, 0.95f);
19  
20  
  ImageBinaryGreyScale si = new ImageBinaryGreyScale(screen);
21  
22  
  ImageBinaryGreyScale st1 = new ImageBinaryGreyScale(pat1);
23  
  ImageBinaryGreyScale st2 = new ImageBinaryGreyScale(pat2);
24  
25  
  print("Finding...");
26  
  List<GPoint> pp = (L) s.lookupAll(si, st1);
27  
  Collections.sort(pp, new GFirst());
28  
  for (GPoint p : pp) print(p);
29  
30  
  print("Finding...");
31  
  pp = (L) s.lookupAll(si, st2);
32  
  Collections.sort(pp, new GFirst());
33  
  for (GPoint p : pp) print(p);
34  
}

Author comment

Began life as a copy of #1003728

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006075
Snippet name: Use "Lookup" (On-Screen OCR) For Finding Chess Board (might work, but very slow)
Eternal ID of this version: #1006075/1
Text MD5: dcfe340c426624ec089f707df05aa42e
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-17 01:04:25
Source code size: 1013 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 495 / 580
Referenced in: [show references]