Abstract:How to realize the auto!focusing rapidly and efficiently is a focus in the measurement of images. The key problem is to select the auto !focusing evaluation function for images. In this paper, some well !known auto!focusing and edge detection algorithms were compared and investigated, then the auto !focusing evaluation function of the Roberts gradient was proposed. In order to eliminate the influence of noise, the problem of threshold was studied carefully, and a threshold parameter was introduced. After detailed experiments, some focused forms for several auto !focusing algorithms were drown,and at one time,the results were analyzed and compared carefully,and show that the Roberts algorithms have the characteristics of the threshold parameter unbiased, powerful single apex and high sensitive and so on, and are more accurate, stable and reliable.