Warning: session_start(): open(/var/lib/php/sessions/sess_q6nu1vlmo0gdh1mhk7i5nss1me, 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
srecord noeq MinimalRecognizer(BufferedImage inputImage) {
IIntegralImage mainImage;
interface IIntegralImage {
double integralValue(int x, int y);
}
class IntegralImage implements IIntegralImage {
int w, h;
int[] data;
*(BufferedImage img) {
w = img.getWidth();
h = img.getHeight();
if (longMul(w, h) > 8000000) fail("Image too big: " + w + "*" + h);
int[] pixels = pixelsOfBufferedImage(img);
data = new int[w*h*3];
int i = 0, j = 0, sumR = 0, sumG = 0, sumB = 0;
for x to w: {
int rgb = pixels[j++];
data[i++] = (sumR += (rgb >> 16) & 0xFF);
data[i++] = (sumG += (rgb >> 8) & 0xFF);
data[i++] = (sumB += rgb & 0xFF);
}
for (int y = 1; y < h; y++) {
sumR = sumG = sumB = 0;
for x to w: {
int rgb = pixels[j++];
sumR += (rgb >> 16) & 0xFF;
sumG += (rgb >> 8) & 0xFF;
sumB += rgb & 0xFF;
data[i] = sumR + data[i-w*3];
data[i+1] = sumG + data[i-w*3+1];
data[i+2] = sumB + data[i-w*3+2];
i += 3;
}
}
}
public double integralValue(int x, int y, int channel) {
ret x < 0 || y < 0 ? 0
: data[(min(y, h-1)*w+min(x, w-1))*3+channel];
}
}
run {
mainImage = new IntegralImage(inputImage);
inputImage = null; // save space
}
}