static IIntegralImage iiPad(IIntegralImage etc inner, int left, int top, int right, int bottom) { int[] padColor = {0, 0, 0}; // black IIntegralImage img = inner; // add top border if (top > 0) img = IIVerticalSplit(IISingleColor(img.getWidth(), top, padColor), img); // add bottom border if (bottom > 0) img = IIVerticalSplit(img, IISingleColor(img.getWidth(), bottom, padColor)); // add left border if (left > 0) img = IIHorizontalSplit(IISingleColor(left, img.getHeight(), padColor), img); // add right border if (right > 0) img = IIHorizontalSplit(img, IISingleColor(right, img.getHeight(), padColor)); ret img; }