| The printed circuit board is one of the most important element in modern electronic information industry,it develops towards high density, miniaturization. In the production process, if the defects is not recognized timely, the whole PCB will be scrapped.Therefore, the research of the PCB defect location and recognition is of great significance to improve the production quality. This paper conducts an in-depth research on registration technology of the standard image and the detected image, and the localization and recognition technology for PCB defect, The primary work contents and achievements are as follows:(1) Formed the PCB standard image from the Gerber file and collected and pre-processing the detected image has been realized. Because of the process of the design and drawing the PCB can make the Gerber file, parsing the Gerber file can form the PCB standard image, This method can make sure the accuracy of the defect detection template. Using the CCD camera to collect the PCB image as the detection object; In view of the noise making by the image collecting, the Gauss noise and the salt and pepper noise remove by the fast median filtering; and threshold segmentation the image, separate the primary characteristics of the image such as the PCB welding plates and lines from the background.(2) The registration method of the PCB standard and detected image has been studied. Firstly, getting the standard image feature points parameters by parsing the Gerber file; Secondly, calculating the searching range according to the standard image feature points parameters, and find the location circle by the connected domain method,get the coordinates of the location circle boundary points by Canny operator edge detection; then using the least squares fitting method to calculate the feature points parameters of the detected image accurately; Finally, correcting the size and the angle of the image by the similarity transformation, and gray level interpolating the image by the bilinear interpolation method, then cut the detected image after transformation according to the position of the no wiring box, complete the registration of the standard and the detected image accurately. The experimental result shows that this method can registration the PCB standard image and detected image accurately.(3) The PCB defects location and recognition method based on backgroundconnected domain has been proposed. The first step of the method is locating the defects; firstly, calculating the standard image after registration and the detected image by subtraction algorithm XOR operation, remove the same parts of the images, and reserve the different ones, getting the initial location map of the defect; secondly, using the morphological filtering opening operation to filter out the false defect reserved by the subtle errors of the registration, and setting the threshold to filter out the impurities in the initial location map; finally, using the axial bounding box to mark the detected image, complete the location of the defects. The second step of the method is to recognize of the PCB defects; firstly, number the marked defects one by one, in order to save the defect information in the process of recognition; secondly, first time classify the defects based on the copper detection, the detects are divided into copper excess and copper lack; finally, using the method based on background connected domain to recognition the defected, count the number of the foreground and the background of the defect domain, compare the defect domain connected domain number of the standard image with the detected image’s, to achieve the recognition of the PCB defect types.The detect experiment result shows that this method can locate and recognition the common types of the defects effectively. |