/** * 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)); }
/** * 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)); }
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 num = pix[y][x]; double t = sum.calculateSumArea(x, y, x+template.width, y+template.height); double wndMean2 = t * t * invArea; num -= t * templateMean;