Capturing of the best-focused image using focus measure function (FMF) from a stack of images acquired at different focus distances is a crucial step in automatic microscopy development. Detection of bacilli present in Ziehl-Neelsen (ZN) stained sputum smears conventional microscope (CM) images is critical to disease diagnosis. Studies have revealed that the performances of FMFs are sensitive to image contents and background noise. In this article, 24 diverse FMFs were implemented on 31 stacks of CM's field of view images acquired from three different microscopes to determine the best-focused one. Seven FMFs achieved the accuracies of greater than 90%. Accuracy, focus error, and false maxima were calculated for each FMF, and overall score and ranking were also calculated for better interpretation. Preprocessing techniques such as filtering and image distortions (noise, contrast, saturation, illumination, etc.) were performed to evaluate the robustness of every FMF. Gaussian derivative, steerable filters, Tenengrad, and Hemli and Scherer's mean FMFs were identified as the most robust and accurate functions with the accuracy >90%. These FMFs have a relatively less focus error and false maxima rate. Full widths at half maximum of these four FMFs were also computed to determine their efficacy for the optimization process. These four FMFs can be implemented for automated capturing of the image from ZN-stained sputum smear slide. Gaussian derivative FMF can also be used effectively for both CM and fluorescence microscope's field of view image stacks to determine the best-focused one from each stack. © 2017 International Society for Advancement of Cytometry.