// TODO: can use more cores than coresToUse() static IBWIntegralImage stripedBWIntegralImage(ThreadPoolExecutor executor default null, int stripes, BufferedImage img) { int minPixelsToSplit = 16384; int w = img.getWidth(), h = img.getHeight(); if (stripes <= 1 || w*h <= minPixelsToSplit) ret BWIntegralImage(img); else ret BWIntegralImage_twoParts(executor, img, (img2, idx) -> stripedBWIntegralImage(executor, (stripes+idx) >> 1, img2)); }