Accurate Localization of Defective Circular PCB Mark Based on Sub-Pixel Edge Detection and Least Square Fitting

High-precision positioning of PCB Mark plays an important role in the production of PCB. This paper proposes a high-accuracy method to recognize and locate the defective circular PCB Mark. Firstly, the template matching is used to extract the interested Mark region. And then Canny operator which has good noise resistance is used to detect the edges of the Mark. On the basis of angle features analysis of each small edge, the regular and similar edges are retained and the deformed or noisy edges are removed, which is the key process to reduce the influence of the defective edges. After that, the retained edges are used to fit an ellipse by least square method. Finally, the sub-pixel edge points near the ellipse are used to fit an ellipse again more accurately. The experimental results indicate that the positioning error of our method is small. And when processing the deformed or noisy Mark images, our method is robust and can achieve better results than Hough transform and the least square fitting based on sub-pixel edge points.