static float autoCropOfBWImage_blackBG_threshold = 0.2f;
static Rect autoCropOfBWImage_blackBG(BWImage img) {
ret autoCropOfBWImage(img, new Rect(0, 0, img.getWidth(), img
.getHeight()));
static Rect autoCropOfBWImage_blackBG(BWImage img, Rect r) {
ret autoCropOfBWImage(img, r, autoCropOfBWImage_blackBG_threshold
);
static Rect autoCropOfBWImage_blackBG(BWImage img, Rect r, float
threshold) {
int x1 = r.x, y1 = r.y, x2 = r.x2(), y2 = r.y2();
for (int y = y1; y < y2; y++)
if (img.getPixel(x1, y) >= threshold)