CN-121391760-B - AOI-based PCB bare board blind hole defect detection method and system
Abstract
The invention relates to the technical field of image data processing, in particular to an AOI-based PCB bare board blind hole defect detection method and system, comprising the steps of obtaining a PCB bare board blind hole image to be detected and a standard PCB bare board blind hole image; and matching the blind hole image of the PCB to be detected with the blind hole image of the standard PCB by using an improved normalized cross-correlation matching algorithm so as to obtain the maximum normalized cross-correlation coefficient of each pixel point position in the blind hole image of the PCB to be detected, and judging that the blind hole image of the PCB to be detected has defects if the maximum normalized cross-correlation coefficient is smaller than a set threshold value. The method solves the problem that the detection accuracy is not high when the existing algorithm faces complex noise.
Inventors
- WANG HUI
Assignees
- 江西弘高科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251016
Claims (6)
- 1. The PCB bare board blind hole defect detection method based on AOI is characterized by comprising the following steps: acquiring a blind hole image of a PCB bare board to be detected and a blind hole image of a standard PCB bare board; matching the blind hole image of the PCB to be detected with the blind hole image of the standard PCB by utilizing an improved normalized cross-correlation matching algorithm to obtain the maximum normalized cross-correlation coefficient of each pixel point position in the blind hole image of the PCB to be detected, and judging that the blind hole image of the PCB to be detected has defects if the maximum normalized cross-correlation coefficient is smaller than a set threshold value; The improved normalized cross-correlation matching algorithm comprises the steps of calculating gray values of all pixel points in a blind hole image of a PCB bare board to be detected, wherein the gray values are products of initial gray values and distortion weights The method comprises the following steps: , To be with natural constant As a function of the base of the exponentiation, Is pixel point #) ) Gray scale distortion index at; The gray level distortion index is the product of the local gradient entropy of each pixel point position and the neighborhood contrast factor of each pixel point position; Local gradient entropy The method comprises the following steps: , is pixel point #) ) The first place The gradient amplitude is divided into pixel points ) The ratio of all gradient magnitudes within the set neighborhood radius is centered, Expressed as pixel points [ ] ) Setting the total number of gradient amplitude values in a neighborhood radius by taking the position as the center; Neighborhood contrast factor The method comprises the following steps: , To be pixel points The gray average value of all pixel points in the neighborhood radius is set for the center first, To be pixel points The gray average value of all pixel points in the neighborhood radius is set for the center second, The method comprises the steps of presetting super parameters; the second set neighborhood radius is greater than the first set neighborhood radius.
- 2. The method for detecting the blind hole defects of the PCB bare board based on the AOI according to claim 1, wherein the obtaining the blind hole images of the PCB bare board to be detected comprises the steps of carrying out high-resolution imaging on the PCB bare board by using an industrial CCD camera and carrying out uniform illumination by using an annular or oblique incidence LED light source so as to obtain the blind hole images of the PCB bare board to be detected, which are suitable for normalized cross-correlation matching.
- 3. The AOI-based blind hole defect detection method for a PCB (printed circuit board) according to claim 1, wherein the first set neighborhood radius is 5 5。
- 4. The AOI-based blind hole defect detection method of PCB bare board according to claim 1, wherein the set threshold is 0.8.
- 5. The AOI-based blind hole defect detection method for the PCB, according to claim 1, further comprising performing Gaussian smoothing on blind hole images of the PCB to be detected.
- 6. The AOI-based blind hole defect detection system for the PCB bare board is characterized by comprising a memory and a processor, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the AOI-based blind hole defect detection method for the PCB bare board is realized.
Description
AOI-based PCB bare board blind hole defect detection method and system Technical Field The invention relates to the technical field of image data processing. More particularly, the invention relates to an AOI-based PCB bare board blind hole defect detection method and system. Background In the modern PCB (printed circuit board) manufacturing process, the quality of blind holes of a multilayer board is directly related to the electrical connection performance between different layers, which is a key link for ensuring the circuit function and reliability. Along with the development of electronic products to high density and miniaturization, higher requirements are put forward on the detection precision and efficiency of PCB blind holes. The traditional manual detection method is low in efficiency, is easily influenced by experience of operators, and is difficult to meet the requirement of mass production. Therefore, automatic Optical Inspection (AOI) systems are becoming the dominant solution. The AOI system collects PCB surface images through a high-speed camera and combines image processing and a pattern recognition algorithm to realize automatic recognition of blind hole defects, so that the detection speed and stability are remarkably improved. The normalized cross-correlation (NCC) matching algorithm has stronger insensitivity to global brightness and contrast variation, and can effectively identify the target form, so that the method is applied to positioning of PCB blind holes and defect detection. The algorithm calculates the similarity between a preset standard hole template and each region of the image to be detected so as to determine the precise position and morphological integrity of the blind hole. However, existing NCC-based detection methods still have significant limitations in practical industrial environments. The NCC algorithm depends on the stability of gray statistical characteristics in a template and an image area to be detected, and the core assumption is that the image is under uniform and ideal illumination condition during acquisition. In practice, PCB production lines run at high speeds and the environmental conditions are complex, resulting in image gray scale distributions often deviating from ideal. The method comprises the specific steps of local uneven illumination caused by aging or angle deviation of a light source, residual liquid medicine, local oxidation, slight scratch or pollution in the PCB surface processing technology, and local high light or dark spots caused by plate textures or surface reflection. These factors can locally form nonlinear gray scale disturbance, so that the pixel mean value and standard deviation of an image deviate, the statistic basis of NCC matching is destroyed, and the problem of low detection accuracy when the existing algorithm faces complex noise is caused. Disclosure of Invention In order to solve the problem of insufficient adaptability of the existing algorithm proposed in the background art to complex noise, the present invention provides solutions in the following aspects. In a first aspect, the invention provides an AOI-based PCB bare board blind hole defect detection method, which comprises the steps of obtaining a PCB bare board blind hole image to be detected and a standard PCB bare board blind hole image, utilizing an improved normalized cross-correlation matching algorithm to match the PCB bare board blind hole image to be detected and the standard PCB bare board blind hole image to obtain a maximum normalized cross-correlation coefficient of each pixel point position in the PCB bare board blind hole image to be detected, judging that the PCB bare board blind hole image to be detected has defects if the maximum normalized cross-correlation coefficient is smaller than a set threshold value, wherein the improved normalized cross-correlation matching algorithm comprises gray values of each pixel point in the PCB bare board blind hole image to be detected, the gray values are products of initial gray values and distortion weights, the distortion weights are inversely related to gray scale distortion indexes of each pixel point position, the gray scale distortion indexes are products of local gradient entropy of each pixel point position and neighborhood factors of each pixel point position, the local gradient entropy represents the mutation degree of each pixel point, and the contrast neighborhood factors are positive and negative-phase gray scale average values of all pixels in a first neighborhood radius setting center of each pixel point, and all gray average values of all pixel point center-scale average values of all pixel point setting center and all gray average values of all pixel point average values in the neighborhood center to all pixel center to be positive-phase gray average value and all pixel average gray average value. According to the technical scheme, the gray level distortion self-adaptive weight mechanism is int