1 | static S ocr_terminalContents() { |
2 | new L<S> lines; |
3 | |
4 | BufferedImage img = shootScreen2(); |
5 | Rect r = ocr_findTerminalBackground(new RGBImage(img)); |
6 | if (r == null) null; |
7 | final BufferedImage terminal = clipBufferedImage(img, r); |
8 | ocr_terminalInvert1(terminal); |
9 | LL<Rect> rects = ocr_makeTerminalGrid(terminal); |
10 | BWImage bw = new BWImage(terminal); |
11 | bw = bwAutoContrastAllRects(bw, concatLists(rects), 1f); |
12 | for (L<Rect> row : rects) { |
13 | L<S> chars = ocr_recognizeMultiLine(bw, row); |
14 | new StringBuilder buf; |
15 | for (S s : chars) |
16 | buf.append(empty(s) ? " " : l(s) == 1 ? s : ocr_unknownCharacterPlaceholder()); |
17 | lines.add(str(buf)); |
18 | } |
19 | ret lines(lines); |
20 | } |
Began life as a copy of #1015503
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: | #1015513 |
Snippet name: | ocr_terminalContents |
Eternal ID of this version: | #1015513/5 |
Text MD5: | 442bed6b6c750dfed6bfb1aeb0b7def9 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-15 04:28:54 |
Source code size: | 699 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 345 / 382 |
Version history: | 4 change(s) |
Referenced in: | [show references] |