responseMapData[y][x] = mode.computeMatchScore(image, template, x+scanX, y+scanY, workingSpace);
responseMapData[y][x] = mode.computeMatchScore(image, template, x+scanX, y+scanY, workingSpace);
private void normCrossCorrelation(FImage imgI, FImage imgJ, FeatureList pt, FeatureList ptTracked, boolean[] status, int winsize_ncc) { for (int i = 0; i < status.length; i++) { boolean tracked = status[i]; FBNCCFeature feat = (FBNCCFeature) pt.features[i]; FBNCCFeature featTracked = (FBNCCFeature) ptTracked.features[i]; if (tracked) { feat.ncc = TemplateMatcher.Mode.NORM_SUM_SQUARED_DIFFERENCE .computeMatchScore(imgI.pixels, (int) feat.x, (int) feat.y, imgJ.pixels, (int) featTracked.x, (int) featTracked.y, winsize_ncc, winsize_ncc); } else { feat.ncc = Float.NaN; } } }
/** * * @param f1 * @param f2 * @return correlation between two patches (assumed to be the same size) * calculated using {@link TemplateMatcherMode} */ private float ncc(FImage f1, FImage f2) { final float normcorr = TemplateMatcher.Mode.NORM_CORRELATION.computeMatchScore(f1.pixels, 0, 0, f2.pixels, 0, 0, f1.width, f1.height); return normcorr; }