Fecal microscopic examination is a routine examination item to determine whether the digestive system is normal by analyzing formed elements. Traditional method is that doctor uses microscope eyepiece to observe sample smears. The efficiency is low, and examination results depend on doctor's experience level. Therefore, intelligent identification of formed elements is the main development direction of current fully automated fecal instruments. Unlike blood or urine samples, human fecal samples contain a lot of impurities, and sample stratification phenomenon is serious. So image quality assessment methods are difficult to find the sharpest image, affecting effectiveness of intelligent identification algorithm. In this paper, the microscopic image autofocus technology for human fecal samples is studied and divided into two parts: location and photographing. In location process, we use SMD algorithm to determine sample photographing interval. In photographing process, microscope platform zigzagged move in the interval to obtain each view's successively image sequences of different focal lengths. In order to accurately find the sharpest image in image sequence, we compared the difference between human eyes with 31 types of no-reference image quality assessment methods based on entropy, gradient, color, edge, contrast, similarity, and transform domain. Finally an improved Local TV algorithm was chose. Experimental results show that the improved Local TV algorithm is insensitive to changes in sample concentration with good robustness, and the accuracy rate can reach 94.26%. Our experimental results have some reference value for other focusing problems of complex microscopic images.