Abstract:For the poor accuracy and complicated process of auto-focusing method in vision measuring, an auto-focusing method by using weighted least squares criterion is proposed in this paper. First, according to the evaluation characteristics of different types of image-clarity evaluation function, the image-clarity evaluation function used in the process of auto-focusing is selected. Secondly, on the basis of the selected image-clarity evaluation function, there are two stage of auto-focusing, namely rough and fine auto-focusing; then, the principle of determining the weighted coefficient in the weighted least square criterion is analyzed, and the specific method of the weighting coefficient is given. Finally, the value of image-clarity evaluation function of fine auto-focusing stage is normalized. and the weighted least squares is used to obtain the extreme point of Gaussian curve fitting, and the position of extreme point is regard as the ultimately positive focal plane. Experimental result shows that under the condition of step distance of 0.1mm, compared with the existing curve fitting method such as Lorentz curve fitting and Gaussian curve fitting, the proposed method can reduce the focus error from 0.05mm to 0.02mm, and effectively improve the focusing accuracy of existing curve fitting method.