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

16
LINES

< > BotCompany Repo | #1015503 // Find terminal, recognize & teach

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

Download Jar. Libraryless. Click here for Pure Java version (12294L/87K).

1  
!7
2  
3  
p {
4  
  BufferedImage img = shootScreen2();
5  
  Rect r = ocr_findTerminalBackground(new RGBImage(img));
6  
  if (r == null) ret with print("no terminal");
7  
  final BufferedImage terminal = clipBufferedImage(img, r);
8  
  ocr_terminalInvert1(terminal);
9  
  L<Rect> rects = makeGridOfRects(pointsRect(1, 1, terminal.getWidth(), terminal.getHeight()), 11, 22);
10  
  rects = map(func(Rect r) { growRectRight(r, -1) }, rects);
11  
  //pnl(ocr_recognizeMultiLine_scored(terminal, rects));
12  
  new OCRRecognizeAndTeach ocr;
13  
  BWImage bw = new BWImage(terminal);
14  
  bw = bwAutoContrastAllRects(bw, rects, 1f);
15  
  ocr.go(bw.getBufferedImage(), rects);
16  
}

Author comment

Began life as a copy of #1015497

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: #1015503
Snippet name: Find terminal, recognize & teach
Eternal ID of this version: #1015503/14
Text MD5: a487a926ddc1d293efe07900b5ebbb11
Transpilation MD5: d71d232e834242ce9b01164fb2f8011d
Author: stefan
Category: javax / imaging
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-15 12:20:21
Source code size: 639 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 476 / 1238
Version history: 13 change(s)
Referenced in: [show references]