static IIntegralImage scaledIntegralImage(IIntegralImage img, int w) { ret scaledIntegralImage(img, w, iround(w*img.getHeight()/(double) img.getWidth())); } static IIntegralImage scaledIntegralImage(IIntegralImage img, int w, int h) { ret new IIntegralImage { int w1 = img.getWidth(), h1 = img.getHeight(); double factorX = doubleRatio(w1, w); double factorY = doubleRatio(h1, h); double areaCorrection = 1/(factorX*factorY); public int getWidth() { ret w; } public int getHeight() { ret h; } // get value for 1 channel // normal range [0; pixelCount*256) // TODO: test public double getIntegralValue(int x, int y, int channel) { ret img.getIntegralValue(x*factorX, y*factorY, channel)*areaCorrection; } }; }