Warning: session_start(): open(/var/lib/php/sessions/sess_9tl6au5u6d8kov3aivi2gqt0pn, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static IBWIntegralImage scaledIBWIntegralImage(IBWIntegralImage img, int w) {
ret scaledIBWIntegralImage(img, w, iround(w*img.getHeight()/(double) img.getWidth()));
}
static IBWIntegralImage scaledIBWIntegralImage(IBWIntegralImage img, int w, int h) {
ret new IBWIntegralImage {
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;
}
public double getPixelAverage(int x1, int y1, int x2, int y2) {
int _x1 = x1*w1/w, _x2 = x2*w1/w;
int _y1 = y1*h1/h, _y2 = y2*h1/h;
ret img.getPixelAverage(_x1, _y1, _x2, _y2);
}
};
}