svoid verifyImage2B(BWImage img, Image2B binaryImage, int threshold) { assertSameSize(img, binaryImage); int w = img.w(), h = img.h(); for y to h: for x to w: if ((img.getInt(x, y) >= threshold) != binaryImage.getBoolPixel(x, y)) fail("Wrong pixel at " + x + "/" + y); }