// assumes coordinates are in range static int ii_getPixel(IntegralImage img, int x, int y) { if (img == null) ret 0; int r = iround(img.rectSum(x, y, x+1, y+1, 0)); int g = iround(img.rectSum(x, y, x+1, y+1, 1)); int b = iround(img.rectSum(x, y, x+1, y+1, 2)); ret rgbInt(r, g, b); }