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).

!7

p {
  BufferedImage img = shootScreen2();
  Rect r = ocr_findTerminalBackground(new RGBImage(img));
  if (r == null) ret with print("no terminal");
  final BufferedImage terminal = clipBufferedImage(img, r);
  ocr_terminalInvert1(terminal);
  L<Rect> rects = makeGridOfRects(pointsRect(1, 1, terminal.getWidth(), terminal.getHeight()), 11, 22);
  rects = map(func(Rect r) { growRectRight(r, -1) }, rects);
  //pnl(ocr_recognizeMultiLine_scored(terminal, rects));
  new OCRRecognizeAndTeach ocr;
  BWImage bw = new BWImage(terminal);
  bw = bwAutoContrastAllRects(bw, rects, 1f);
  ocr.go(bw.getBufferedImage(), rects);
}

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: 475 / 1237
Version history: 13 change(s)
Referenced in: [show references]