Sauvola threshold and temporary debug image