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