/** * Calculate the sum of squared pixels in the image used for constructing * this SAT within the given rectangle * * @param r * rectangle * @return sum of pixels in given rectangle */ public float calculateSqSumArea(Rectangle r) { return calculateSqSumArea(Math.round(r.x), Math.round(r.y), Math.round(r.x + r.width), Math.round(r.y + r.height)); }
/** * Calculate the sum of pixels in the image used for constructing this SAT * within the given rectangle * * @param r * rectangle * @return sum of pixels in given rectangle */ public float calculateSumArea(Rectangle r) { return calculateSumArea(Math.round(r.x), Math.round(r.y), Math.round(r.x + r.width), Math.round(r.y + r.height)); }
@Override public void analyseImage(FImage image) { computeTable(image); } }
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndMean2 = 0, wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double num = pix[y][x]; double t = sum.calculateSumArea(x, y, x+template.width, y+template.height); double wndMean2 = t * t * invArea; num -= t * templateMean; double wndSum2 = sum.calculateSqSumArea(x, y, x+template.width, y+template.height);
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndMean2 = 0, wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double num = pix[y][x]; double t = sum.calculateSumArea(x, y, x+template.width, y+template.height); double wndMean2 = t * t * invArea; num -= t * templateMean; double wndSum2 = sum.calculateSqSumArea(x, y, x+template.width, y+template.height);
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndMean2 = 0, wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;
@Override public void analyseImage(FImage image) { computeTable(image); } }
/** * Calculate the sum of squared pixels in the image used for constructing * this SAT within the given rectangle * * @param r * rectangle * @return sum of pixels in given rectangle */ public float calculateSqSumArea(Rectangle r) { return calculateSqSumArea(Math.round(r.x), Math.round(r.y), Math.round(r.x + r.width), Math.round(r.y + r.height)); }
/** * Calculate the sum of pixels in the image used for constructing this SAT * within the given rectangle * * @param r * rectangle * @return sum of pixels in given rectangle */ public float calculateSumArea(Rectangle r) { return calculateSumArea(Math.round(r.x), Math.round(r.y), Math.round(r.x + r.width), Math.round(r.y + r.height)); }
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndMean2 = 0, wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;
/** * Construct a SAT from the provided image * * @param image * the image */ public SummedSqAreaTable(FImage image) { computeTable(image); }
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;
/** * Construct a SAT from the provided image * * @param image * the image */ public SummedSqAreaTable(FImage image) { computeTable(image); }
@Override public void processCorrelationMap(FImage img, FImage template, FImage corr) { SummedSqAreaTable sum = new SummedSqAreaTable(); img.analyseWith(sum); double wndSum2 = 0; double t = sum.calculateSqSumArea(x, y, x+template.width, y+template.height); wndSum2 += t;