String processInternal(FImage img, String separator, int... pattern) throws Exception { final List<NumberOccurance> occurances = new ArrayList<NumberOccurance>(); int num = 0; for (final int i : pattern) num += i; for (int i = 0; i < 10; i++) { templates[i].analyseImage(img); final FValuePixel[] resp = templates[i].getBestResponses(num); for (final FValuePixel pt : resp) { if (pt.value > 0.95) { occurances.add(new NumberOccurance(pt.x, i)); } } } if (occurances.size() != num) throw new Exception(); Collections.sort(occurances); String result = ""; int i = 0, j = 0; for (final NumberOccurance no : occurances) { if (pattern[i] == j) { j = 0; i++; result += separator; } result += no.value; j++; } return result; }
matcher.analyseImage(I); FImage res = matcher.getResponseMap();
matcher.analyseImage(I); FImage res = matcher.getResponseMap();
matcher.analyseImage(prev.frame); final FValuePixel[] responses = matcher.getBestResponses(1); final FValuePixel firstBest = responses[0];
matcher.analyseImage(prev.frame); final FValuePixel[] responses = matcher.getBestResponses(1); final FValuePixel firstBest = responses[0];