!7 lib 1010061 // OpenIMAJ feature extraction (1.3.5) lib 1013703 // commons math lib 1009074 // trove import org.openimaj.image.segmentation.*; import org.openimaj.image.text.extraction.swt.*; import org.openimaj.image.pixel.*; static float sigma = 0.5f; static float k = 2500f / 255f; static int minSize = 20; static float scale = 1f; // scale image static int repetitions = 1; // Test HotSpot p-subst { hideConsole(); sleep(500); time "Make MBFImage" { BufferedImage screen = shootScreen2(); MBFImage image = readMBF(scaleImage(screen, scale)); } showConsole(); for (int i = 0; i < repetitions; i++) { time "Segment" { FImage monoImage = image.getBand(0); new SWTTextDetector segmenter; segmenter.analyseImage(monoImage); } if (i == 0) { L rects = mapMethod('getRegularBoundingBox, segmenter.getLines()); showImageWithSelections(screen, openImajToRects(rects)); } } }