The proposal of World Health Organization (WHO) for a basic and preliminary technique of diagnosing tuberculosis disease is based upon visual examination in microscopic image sequences of sputum samples stained with ZN-stain procedure. This examination which requires spending considerable time for specialists causes a significant increase in laboratorians' workload, misdiagnosis and loss of time. Therefore, in this paper a new method for automatic detection of TB bacteria from microscopic images is proposed. RGB color distribution of bacterial regions which is sampled in training period is performed to learning by using multi dimensional Gaussian distribution function. The Mahalanobis distances of training samples in multi dimensional color space are taking into account and noisy data in distribution space is removed from training set. After the image segmentation in testing images based on trained distribution function, image is restorated with morphological image processing. Then artificial neural network model is used for shape-based recognition. The performance of system is evaluated using some criteria.