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

38
LINES

< > BotCompany Repo | #1013701 // Test SWTTextDetector [OK, but bad results]

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

Uses 19809K of libraries. Click here for Pure Java version (8658L/59K/208K).

1  
!7
2  
3  
lib 1010061 // OpenIMAJ feature extraction (1.3.5)
4  
lib 1013703 // commons math
5  
lib 1009074 // trove
6  
7  
import org.openimaj.image.segmentation.*;
8  
import org.openimaj.image.text.extraction.swt.*;
9  
import org.openimaj.image.pixel.*;
10  
11  
static float sigma = 0.5f;
12  
static float k = 2500f / 255f;
13  
static int minSize = 20;
14  
15  
static float scale = 1f; // scale image
16  
static int repetitions = 1; // Test HotSpot
17  
18  
p-subst {
19  
  hideConsole();
20  
  sleep(500);
21  
  time "Make MBFImage" {
22  
    BufferedImage screen = shootScreen2();
23  
    MBFImage image = readMBF(scaleImage(screen, scale));
24  
  }
25  
  showConsole();
26  
  for (int i = 0; i < repetitions; i++) {
27  
    time "Segment" {
28  
      FImage monoImage = image.getBand(0);
29  
      new SWTTextDetector segmenter;
30  
      segmenter.analyseImage(monoImage);
31  
    }
32  
    
33  
    if (i == 0) {
34  
      L<org.openimaj.math.geometry.shape.Rectangle> rects = mapMethod('getRegularBoundingBox, segmenter.getLines());
35  
      showImageWithSelections(screen, openImajToRects(rects));
36  
    }
37  
  } 
38  
}

Author comment

Began life as a copy of #1010064

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013701
Snippet name: Test SWTTextDetector [OK, but bad results]
Eternal ID of this version: #1013701/10
Text MD5: ef82752acc143ba527b1e221e3c4c700
Transpilation MD5: 45947e2709d0cee958335668520c6a88
Author: stefan
Category: javax / imaging
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-25 13:42:22
Source code size: 1030 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 359 / 486
Version history: 9 change(s)
Referenced in: [show references]