| With the rapid development of semiconductor technology,the integration and complexity of electronic components on printed circuit boards are increasing,meanwhile the sizes of electronic components are decreasing.Therefore,it is becoming more and more important to use computer vision system instead of traditional manual way to avoid the unreliability and inefficiency of manual work.It is very important for the practical engineering requirements to avoid the influence of nonuniform illumination problem and the distortion and defect of printed circuit boards' circular mark on the positioning process and improve the positioning accuracy.This paper aims at the problem of locating defective circular mark on printed circuit boards under uneven illumination.It is mainly divided into the following parts:1.To reduce the influence of nonuniform illumination on image segmentation,the improved homomorphic filtering and gamma transform are firstly introduced to improve the image quality.Then,the method which uses class uncertainty and region stability to construct an energy function to search for the threshold is introduced to achieve good segmentation effect.2.On the basis of recognizing and roughly locating the circular mark in the image by the template matching,the edges of the image are detected and are divided into equal-length segments.Based on the angle characteristics of each segment,the regular edges are preserved,and the seriously deformed edges and noisy edges are removed.Then,on the basis of the retained edges,a preliminary ellipse fitting is performed by the least square method.3.Sub-pixel edge points of the original image is detected,and the sub-pixel edge points in the neighborhood of the fitted ellipse are retained.And then the least square method is used to fit an ellipse again to get more accurate positioning results.In the experiment,the following three groups of experiments are finished:1.At the simulation level,this method is used to locate the defective circular image with known central coordinates,and the effect of circle fitting and location error are analyzed;2.This method is compared with Hough transform and least squares method based on sub-pixel edge points.Firstly,the three methods are used to locate the simulated images,and the fitting effect and location results are compared and analyzed.Then,the three methods are used to locate the circular mark images of printed circuit boards,and the results are compared;3.The circular calibration board is used to test the accuracy of this method.Experimental results show that the method proposed in this paper has a high accuracy in locating circular mark on printed circuit boards.Compared with other methods,it greatly avoids the influence of nonuniform illumination and the deformation and defect of the mark on the locating results. |