static FoundImg bwImageSearch_best_virtualBig(IBWImage big, BWImage pat, float similarity) { new Best best; int wp = pat.getWidth(), hp = pat.getHeight(); int w = big.getWidth(), h = big.getHeight(); float maxError = (1f-similarity)*wp*hp; bigloop: for (int y = 0; y < h-hp; y++) for (int x = 0; x < w-wp; x++) { float diff = bwImageSectionsSimilarity_firstVirtual(big, pat, x, y, maxError); if (diff <= maxError && best.isNewBest(-diff)) { maxError = diff; Rect r = new Rect(x, y, wp, hp); best.put(r, -diff); ping(); if (diff == 0) break bigloop; } } ret !best.has() ? null : new FoundImg(best!, 1-(-(float) best.bestScore())/(wp*hp)); }