Statistics for Image segmentation and object classification for automatic detection of tuberculosis in sputum smears