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

21
LINES

< > BotCompany Repo | #1007158 // Screen Lens with nanoAutoSegment [WORKS]

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

Uses 3874K of libraries. Click here for Pure Java version (7939L/56K/195K).

1  
!7
2  
3  
static ScreenLens lens;
4  
static volatile L<Rect> segments;
5  
static BufferedImage imageForSegments;
6  
static int zoom = 3; // can also choose 2
7  
8  
p-substance {
9  
  lens = new ScreenLens;
10  
  lens.w = lens.h = 100;
11  
  lens.postProcess = func(BufferedImage img) {
12  
    //BWImage bw = bwImageTo2Bit(new BWImage(img), 0.5f);
13  
    BWImage bw = bwResizeSmooth(new BWImage(img), img.getWidth()*zoom);
14  
    img = bw.getBufferedImage();
15  
    segments = autoSegment(bw, 3);
16  
    imageForSegments = img;
17  
    drawBoxes(img, rectsToRectangles(segments), Color.red, 0.8f);
18  
    ret img;
19  
  };
20  
  lens.start();
21  
}

Author comment

Began life as a copy of #1006558

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: #1007158
Snippet name: Screen Lens with nanoAutoSegment [WORKS]
Eternal ID of this version: #1007158/6
Text MD5: 02ea508befec2d9f0132050968c31f2b
Transpilation MD5: 433407d02e601f926ce3da2d37b3236b
Author: stefan
Category: javax / gui / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-06 00:55:51
Source code size: 602 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 392 / 487
Version history: 5 change(s)
Referenced in: [show references]