List<FontSymbolLookup> findAll( List<FontSymbol> list, ImageBinary bi, int x1, int y1, int x2, int y2) { List<FontSymbolLookup> l = new ArrayList<FontSymbolLookup>(); for (FontSymbol fs : list) { List<GPoint> ll = NCC.lookupAll(bi, x1, y1, x2, y2, fs.image, threshold); for (GPoint p : ll) l.add(new FontSymbolLookup(fs, p.x, p.y, p.g)); } return l; }
public static void main(String[] args) { BufferedImage image = Capture.load(OCRTest.class, "cyclopst1.png"); BufferedImage template = Capture.load(OCRTest.class, "cyclopst3.png"); // rgb image lookup { List<GPoint> pp = NCC.lookupAll(new ImageBinaryRGB(image), new ImageBinaryRGB(template), 0.9f); for (GPoint p : pp) { System.out.println(p); } } // grey image lookup { List<GPoint> pp = NCC.lookupAll(new ImageBinaryGrey(image), new ImageBinaryGrey(template), 0.9f); for (GPoint p : pp) { System.out.println(p); } } }