Circuit board production detection method and system based on machine vision and medium

Through machine vision-based detection methods, X-ray and virtual slice technology are used to obtain the internal structure images of the HDI board, and combined with image preprocessing and feature analysis, a residual copper feature recognition model is constructed, which solves the problem that traditional detection methods are difficult to identify residual copper inside the HDI board, and achieves a high-precision and non-destructive detection effect.

CN119715630AActive Publication Date: 2025-03-28SHENZHEN HENGXUTONG CIRCUIT CO LTD

Patent Information

Application Number
CN202411752439.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-28
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

Traditional circuit board detection methods are difficult to effectively identify residual copper defects in buried holes and blind holes inside HDI boards, and probe detection requires physical contact, which can easily damage the circuit board.

Method used

Using a detection method based on machine vision, the images of the internal structure of the HDI plate are obtained by using the penetration of X-rays, and the three-dimensional structure is converted into two-dimensional image sequences through virtual slicing technology. Combined with image preprocessing, pore structure mask processing and morphological operations, the hole area is extracted and feature analysis is performed, and a residual copper feature recognition model is constructed for automatic detection.

Benefits of technology

High-precision detection of residual copper defects inside HDI boards is achieved, which avoids damage caused by physical contact, improves the accuracy and efficiency of detection, reduces the risk of manual misjudgment, and shortens the production cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119715630A_ABST
    Figure CN119715630A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of production detection, in particular to a circuit board production detection method and system based on machine vision and a medium. The method comprises the following steps: carrying out circuit board scanning on a to-be-detected high-density interconnection circuit board to obtain original X-ray image sequence data of the circuit board; performing image preprocessing on the original X-ray image sequence data of the circuit board to obtain preprocessed circuit board detection image data; performing image hole structure mask processing on the preprocessed circuit board detection image data to obtain hole structure mask data; performing hole feature analysis on the preprocessed circuit board detection image data through the hole structure mask data to obtain hole feature vector data; constructing a residual copper feature recognition model; and performing residual copper detection on the hole feature vector data by using a residual copper feature recognition model to obtain residual copper detection result data. Nondestructive testing of the internal structure of the circuit board is achieved through X-ray imaging, and the accuracy and efficiency of production detection are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of production detection technology, and in particular to a circuit board production detection method, system and medium based on machine vision. Background Art

[0002] As a high-performance, high-density printed circuit board, high-density circuit boards (HDI boards) are widely used in smart phones, tablets, wearable devices, automotive electronics and other fields because of their advantages such as lightness, thinness and dense functions. The design of HDI boards usually adopts multi-layer interconnection structures such as buried vias and blind vias to achieve higher wiring density and more complex electrical performance. Residual copper refers to the excess copper material remaining on the inner wall or bottom of buried or blind vias during the manufacturing process of circuit boards due to incomplete drilling, uneven chemical copper plating or defects in the electroplating process. These residual copper problems lead to the degradation of electrical performance, such as short circuits, signal interference or unstable conduction, which affects the overall performance of HDI boards and even causes product failure. Traditional circuit board inspection methods mainly include probe inspection and optical inspection. Although probe inspection can simply verify the electrical performance of circuit boards, it is difficult to effectively identify residual copper problems in the internal structure of buried and blind vias. In addition, probe inspection requires physical contact, which is easy to damage the fragile circuits of HDI boards, causing misjudgments or even directly causing the boards to be scrapped, causing great economic losses to manufacturers. Optical detection methods mainly rely on visible light or infrared light, which is more effective for detecting surface defects of circuit boards. However, since light cannot penetrate the inside of the circuit board, it is impossible to detect buried vias and blind vias, and therefore cannot meet the needs of residual copper detection inside HDI boards. Summary of the invention

[0003] Based on this, the present invention provides a circuit board production detection method, system and medium based on machine vision to solve at least one of the above technical problems.

[0004] To achieve the above purpose, a circuit board production detection method based on machine vision includes the following steps:

[0005] Step S1: extracting circuit board parameters of the high-density interconnection circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnection circuit board to be inspected by using a visual sensor to generate original X-ray detection image data;

[0006] Step S2: Based on the original X-ray detection image data, virtual slicing is performed along a direction perpendicular to the high-density interconnection circuit board to be detected to obtain original X-ray image sequence data of the circuit board; image preprocessing is performed on the original X-ray image sequence data of the circuit board to obtain preprocessed circuit board detection image data;

[0007] Step S3: performing image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; performing morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and performing image hole region extraction to obtain hole region image data; performing hole feature analysis on the hole region image data to obtain hole feature vector data;

[0008] Step S4: Obtain sample data of the hole image of the circuit board; train a residual copper classification model based on the sample data of the hole image of the circuit board to construct a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area based on the hole structure mask data to obtain residual copper detection result data.

[0009] The present invention utilizes the strong penetrability of X-rays to obtain clear images of the internal structure of the HDI board, and converts the three-dimensional structure into a two-dimensional image sequence through virtual slicing technology, so that the residual copper defects of internal structures such as buried holes and blind holes can be intuitively presented, avoiding damage caused by physical contact, and realizing true non-destructive testing. Through image preprocessing technology, noise interference is effectively suppressed, image quality is improved, and the foundation for subsequent feature extraction and analysis is laid. Then, the hole area is accurately extracted by image hole structure mask processing and morphological expansion operation, and the feature vector data that can accurately identify the residual copper defects is constructed in combination with the hole feature analysis. Finally, the hole feature vector data is intelligently analyzed by using the residual copper feature recognition model, and the automatic recognition and positioning of the residual copper defects are realized, which greatly improves the accuracy and efficiency of detection, reduces the risk of manual misjudgment, and shortens the production cycle. Through the feature analysis of the hole area image data, a variety of feature parameters related to the residual copper defects, such as the residual copper area, shape, position, etc., are extracted, and the corresponding feature vector data are constructed. These quantitative indicators can objectively reflect the severity of the residual copper defects and provide a scientific basis for the quality control of the production process. At the same time, residual copper detection based on the residual copper feature recognition model can accurately locate the residual copper area, provide guidance for subsequent repair or scrapping, and avoid unnecessary waste of resources. By early detection and elimination of HDI boards with residual copper defects, functional failures and product scrapping in the subsequent assembly process can be effectively avoided, reducing repair costs and after-sales service costs. At the same time, accurate residual copper detection can guide the improvement of production processes, optimize production processes, reduce the generation of defects, and thus improve the overall yield and reliability of HDI boards.

[0010] Therefore, the present invention uses a machine vision-based circuit board production inspection method to obtain the internal image of the circuit board using high-precision X-ray imaging, converts the three-dimensional image into a two-dimensional image sequence through virtual slicing processing, and image preprocessing ensures image quality. The hole area is accurately extracted through hole structure mask processing and morphological operations, and then the hole area is feature analyzed to construct a feature vector, and the feature vector is analyzed using a machine learning model to achieve automatic detection of defects such as residual copper, thereby achieving high-precision detection of the internal structure of a high-density interconnected circuit board.

[0011] Preferably, step S1 comprises the following steps:

[0012] Step S11: extracting circuit board parameters from the high-density interconnection circuit board to be detected to obtain monitoring circuit board parameters;

[0013] Step S12: using a visual sensor to identify the circuit board positioning feature points of the high-density interconnection circuit board to be inspected, and adjusting the circuit board posture to obtain the circuit board positioning posture data;

[0014] Step S13: Scanning parameters of the monitoring circuit board are read through a preset scanning database to obtain scanning parameter configuration data;

[0015] Step S14: performing multi-angle scanning path planning on the high-density interconnection circuit board to be inspected based on the scanning parameter configuration data and the circuit board positioning posture data to generate scanning path planning data;

[0016] Step S15: controlling the X-ray source to scan the high-density interconnection circuit board to be inspected according to the scanning path planning data and the scanning parameter configuration data, and using the detector to receive the X-rays to obtain multi-angle X-ray transmission data;

[0017] Step S16: performing X-ray signal conversion on the multi-angle X-ray transmission data, and reconstructing the image data to generate original X-ray detection image data.

[0018] The present invention realizes accurate positioning and posture adjustment of the circuit board by extracting the circuit board parameters and automatically identifying the positioning feature points, thereby avoiding the errors and inefficiency caused by manual operation. At the same time, based on the preset scanning database and circuit board parameters, the intelligent configuration of the scanning parameters is realized, and the scanning parameters can be automatically adjusted according to different types of circuit boards without manual intervention, thereby improving the flexibility and efficiency of detection. Through multi-angle scanning path planning, the transmission images of the HDI board at different angles can be obtained, effectively avoiding missed detection and false detection caused by the complex internal structure of the circuit board or defect occlusion. Compared with the traditional single-angle scanning, multi-angle scanning can more comprehensively reflect the real situation of the internal structure of the circuit board and improve the reliability of defect detection. Through accurate scanning parameter configuration and circuit board positioning, the optimal relative position between the X-ray source and the detector can be guaranteed, thereby obtaining high-quality X-ray transmission data. At the same time, multi-angle scanning can make up for the shortcomings of single-angle scanning, obtain more comprehensive information, and help improve the accuracy and reliability of image reconstruction. The method can adapt to the detection needs of HDI boards of different types and specifications, and only needs to update the scanning database and adjust the corresponding parameters.

[0019] Preferably, step S2 comprises the following steps:

[0020] Step S21: performing virtual slicing processing along a direction perpendicular to the high-density interconnection circuit board to be inspected based on the original X-ray inspection image data to obtain original X-ray image sequence data of the circuit board;

[0021] Step S22: performing non-local mean filtering to reduce noise on the original X-ray image sequence data of the circuit board to obtain primary noise-reduced image sequence data;

[0022] Step S23: calculating the distortion parameters of the imaging system according to the pre-shot chessboard calibration plate image to obtain distortion correction parameter data;

[0023] Step S24: performing image geometric distortion correction on the primary denoised image sequence data using the distortion correction parameter data to obtain geometrically corrected image sequence data;

[0024] Step S25: performing wavelet transform artifact removal according to the geometrically corrected image sequence data, and performing inverse wavelet transform to reconstruct the image, thereby obtaining pre-processed circuit board inspection image data.

[0025] During the X-ray imaging process of the present invention, due to the characteristics of the equipment itself and the influence of environmental factors, the image often has noise interference. This scheme adopts a non-local mean filtering algorithm to perform noise reduction processing on the original image sequence data. The algorithm can effectively retain the edge and detail information of the image, while suppressing noise, and obtain clearer initial noise reduction image sequence data. In the X-ray imaging system, factors such as lens distortion can cause geometric deformation of the image, affecting the positioning and size measurement accuracy of the defect. This scheme calculates the distortion parameters of the imaging system by pre-shooting the chessboard calibration plate image, and uses the parameters to perform geometric correction on the image sequence data after the initial noise reduction, effectively eliminating the geometric deformation of the image and restoring the true geometric shape of the image. The wavelet transform is used to remove artifacts from the geometrically corrected image sequence data, and the image is decomposed into different scale spaces by wavelet decomposition, the frequency components where the artifacts are located are identified and suppressed, and then the image is reconstructed by inverse wavelet transform, thereby obtaining pre-processed circuit board detection image data with fewer artifacts and clearer details.

[0026] Preferably, step S3 comprises the following steps:

[0027] Step S31: using the preset hole structure element data to perform a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data to obtain Top-Hat transformed image data;

[0028] Step S32: Calculate the Hessian matrix eigenvalues ​​based on the Top-Hat transformation image data, and determine the hole edge pixel points to obtain the hole edge pixel points and other pixel points respectively;

[0029] Step S33: setting the maximum grayscale value for the pixel points at the edge of the hole, and keeping the grayscale values ​​of other pixel points unchanged, thereby obtaining hole edge enhanced image data;

[0030] Step S34: performing image hole structure mask processing on the hole edge enhanced image data to obtain hole structure mask data;

[0031] Step S35: performing a morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and extracting the image hole area to obtain hole area image data;

[0032] Step S36: Perform hole feature analysis on the hole area image data to obtain hole feature vector data.

[0033] The present invention adopts multi-scale Top-Hat transformation, which can effectively extract tiny details and contrast differences in the image, thereby enhancing the response of the hole edge and making it more prominent in the image. Then, the Hessian matrix eigenvalue calculation is performed based on the Top-Hat transformation image data, and the hole edge pixel point judgment is performed, the hole edge is further accurately located, and the maximum grayscale value of the hole edge pixel point is set, so as to obtain the hole edge enhancement image data with sharp and clear hole edge. By performing image hole structure mask processing on the hole edge enhancement image data, the hole structure mask data is obtained, and the mask data can accurately identify the position and shape of the hole. Then, the hole structure mask data is used to perform a morphological expansion operation on the pre-processed circuit board detection image data, effectively separate the hole area from the background, and perform image hole area extraction to obtain the hole area image data containing only hole information. This segmentation method based on the hole structure mask avoids the problem of over-segmentation or under-segmentation that is easy to occur in the traditional segmentation method, and improves the accuracy and robustness of segmentation. The extracted hole area image data is subjected to hole feature analysis to extract a series of feature parameters that can reflect the hole shape, size, position and texture information, such as hole area, circumference, roundness, aspect ratio, grayscale mean, grayscale variance, etc., and construct the corresponding hole feature vector data.

[0034] Preferably, step S34 includes the following steps:

[0035] Step S341: Adaptively binarize and segment the hole edge enhanced image data to obtain binary detection image data;

[0036] Step S342: performing anisotropic diffusion filtering according to the binary detection image data, and performing sub-pixel edge positioning to generate sub-pixel edge detection data;

[0037] Step S343: performing a fracture edge hole contour connection process based on the sub-pixel edge detection data to generate initial hole contour data;

[0038] Step S344: ellipse fitting optimization is performed on the initial hole contour data, and morphological opening operation is performed to obtain the buried hole / blind hole contour data of the circuit board;

[0039] Step S345: performing image hole structure mask processing according to the buried hole / blind hole contour data of the circuit board to obtain hole structure mask data.

[0040] The present invention adopts an adaptive binary segmentation method, which can automatically adjust the threshold according to the local grayscale features of the image, effectively overcomes the influence of uneven illumination and noise, and thus obtains more accurate binary detection image data. On the basis of binary segmentation, anisotropic diffusion filtering is used to smooth the binary detection image data, while protecting the edge details, and then sub-pixel edge positioning is performed to generate sub-pixel edge detection data, thereby improving the edge positioning accuracy to the sub-pixel level, effectively suppressing the influence of noise and discretization errors, and improving the accuracy and stability of edge extraction. Based on the sub-pixel edge detection data, the broken edge hole contour connection processing is performed to generate initial hole contour data, and then the initial hole contour data is optimized by ellipse fitting, and the geometric characteristics of the ellipse are used to smooth and repair the hole contour to make it closer to the actual hole shape, and a morphological opening operation is performed to remove burrs and small noise points in the hole contour, thereby obtaining accurate and complete circuit board buried hole / blind hole contour data. Image hole structure mask processing is performed based on the buried / blind hole contour data of the circuit board. The generated hole structure mask data can accurately identify the position and shape of the holes, avoiding the edge blur and hole adhesion problems that are prone to occur in traditional mask generation methods.

[0041] Preferably, step S343 includes the following steps:

[0042] Performing sub-pixel edge gradient amplitude calculation on sub-pixel edge detection data to generate edge pixel gradient amplitude data;

[0043] The edge pixel gradient amplitude data is subjected to dual-threshold hysteresis edge connection judgment by a preset high threshold and a preset low threshold, and pixels whose edge pixel gradient amplitude data is greater than the preset high threshold are marked as strong edge point data; pixels whose edge pixel gradient amplitude data is less than the preset low threshold are marked as non-edge point data; pixels whose edge pixel gradient amplitude data is between the preset high threshold and the preset low threshold are marked as weak edge point data;

[0044] Determine the buried / blind via radius range by monitoring the circuit board parameters and obtain the hole radius range data;

[0045] Use hole radius range data to perform Hough transform circular detection on sub-pixel edge detection data to generate candidate circular hole data for the circuit board;

[0046] The candidate circular hole data of the circuit board are mapped to edge points through strong edge point data, non-edge point data and weak edge point data, and the broken edge hole contours are connected to obtain the initial hole contour data.

[0047] The present invention first calculates the sub-pixel edge gradient amplitude, and then uses a double-threshold hysteresis edge connection method to divide edge pixels into strong edge points, weak edge points and non-edge points. The strong edge point data can ensure that real and reliable edge information is extracted, while the weak edge point data can supplement the edge details and improve the continuity of the edge. This double-threshold hysteresis connection method can effectively suppress the influence of noise and false edges and improve the reliability and accuracy of edge connection. The buried hole / blind hole radius range is determined by monitoring the circuit board parameters to obtain the hole radius range data. Then, the sub-pixel edge detection data is subjected to Hough transform circular detection using the hole radius range data, and only circular holes with radii within a preset range are detected, thereby avoiding interference from other shapes and sizes, improving the accuracy and efficiency of circular hole detection, and also reducing the amount of calculation. The strong edge point data, weak edge point data and non-edge point data obtained by double-threshold hysteresis edge connection are used to perform edge point mapping on the candidate circular hole data of the circuit board, and the detected circle is matched with the actual edge point. Then, the hole contour connection is performed for the broken edge, and the edge fragments belonging to the same hole are connected, thereby obtaining the complete initial hole contour data. This method combining circle detection and edge connection can effectively handle the situation of hole edge breakage and ensure the integrity of hole contour extraction.

[0048] Preferably, step S36 includes the following steps:

[0049] Step S361: performing grayscale feature statistics on the hole area image data to obtain hole grayscale feature data;

[0050] Step S362: performing gray level co-occurrence matrix calculation according to the hole gray level feature data to generate hole texture feature data;

[0051] Step S363: performing geometric shape feature analysis based on the hole area image data to obtain hole geometric shape feature data;

[0052] Step S364: integrating the hole grayscale feature data, the hole texture feature data and the hole geometric shape feature data to obtain hole feature vector data.

[0053] The present invention realizes a multi-dimensional and multi-level description of hole characteristics by comprehensively extracting the grayscale features, texture features and geometric shape features of the holes. Among them, the grayscale features reflect the statistical information such as the average grayscale and grayscale variance of the hole area, the texture features reflect the grayscale spatial distribution and texture pattern of the hole area, and the geometric shape features reflect the morphological information such as the area, perimeter, roundness, aspect ratio, etc. of the hole. These features complement each other and together constitute a complete feature description of the hole, which improves the accuracy and reliability of residual copper defect identification. The presence of residual copper defects will cause the grayscale distribution in the hole area to change and form a specific texture pattern. Grayscale co-occurrence matrix is ​​an effective texture analysis method that can reflect the spatial correlation of grayscale values ​​in an image, thereby extracting texture features related to residual copper defects. This scheme calculates the grayscale co-occurrence matrix based on the grayscale feature data of the holes, and extracts texture features such as contrast, energy, entropy, homogeneity, etc., which enhances the sensitivity to residual copper defects and makes residual copper defects easier to identify. Different types of residual copper defects often have different geometric shape features in the hole area. For example, uniform residual copper will lead to a smaller hole area, while non-uniform residual copper will lead to an irregular hole shape. This solution extracts geometric shape features such as hole area, perimeter, roundness, aspect ratio, etc. by performing geometric shape feature analysis on the hole area image data, which provides an important basis for distinguishing different types of residual copper defects and helps to improve the refinement of defect identification. The extracted hole grayscale feature data, hole texture feature data, and hole geometric shape feature data are integrated to construct a representative hole feature vector.

[0054] Preferably, step S4 comprises the following steps:

[0055] Step S41: Obtaining circuit board hole image sample data;

[0056] Step S42: performing feature engineering processing on the circuit board hole image sample data to obtain circuit board hole image sample feature data; wherein the circuit board hole image sample feature data includes hole residual copper sample feature data and hole non-residual copper sample feature data;

[0057] Step S43: performing feature subset processing on the feature data of the hole residual copper samples and the feature data of the hole non-residual copper samples, so as to obtain a model training feature set and a model verification feature set;

[0058] Step S44: performing classifier model training on a preset support vector machine model based on the model training feature set, thereby obtaining an initial residual copper recognition model;

[0059] Step S45: verifying the initial residual copper recognition model through the model verification feature set, and optimizing the hyperparameters through the genetic algorithm to obtain the residual copper feature recognition model;

[0060] Step S46: using the residual copper feature recognition model to perform residual copper detection on the hole feature vector data to generate residual copper probability prediction data;

[0061] Step S47: positioning the residual copper area of ​​the hole structure mask data by using the residual copper probability prediction data, and post-processing the detection result according to the pre-processed circuit board detection image data, so as to obtain the residual copper detection result data.

[0062] The present invention uses a machine learning method to train a residual copper recognition model using circuit board hole image sample data, realizes automatic recognition of residual copper defects, does not require manual intervention, and greatly improves detection efficiency. At the same time, since the model is obtained through training with a large amount of sample data, it has strong generalization ability and robustness, can effectively avoid artificial misjudgment and missed judgment, and improves the accuracy of detection. The circuit board hole image sample data is subjected to feature engineering processing to extract features that can effectively distinguish residual copper from non-residual copper holes, such as grayscale features, texture features, geometric shape features, etc. of the holes. Then, through feature subset processing, the optimal feature combination is selected for model training, feature redundancy and overfitting problems are avoided, and the recognition performance and generalization ability of the model are improved. A support vector machine model is selected as a residual copper recognition model, and model training is performed based on a model training feature set to obtain an initial residual copper recognition model. Then, the initial model is verified by a model verification feature set, and the model hyperparameters are optimized using a genetic algorithm to further improve the classification accuracy and robustness of the model, so that it can adapt to different types of circuit boards and different residual copper defect forms. The trained residual copper feature recognition model is used to detect residual copper on the hole feature vector data, generate residual copper probability prediction data, and use the residual copper probability prediction data to locate the residual copper area of ​​the hole structure mask data, and mark the residual copper defects on the image. Finally, the test results are post-processed according to the pre-processed circuit board test image data to obtain the final residual copper test result data, which is displayed in a visual way, so that the operator can intuitively judge the location and severity of the residual copper defect, and provide guidance for subsequent repair or scrapping.

[0063] Preferably, the present invention further provides a circuit board production detection system based on machine vision, which executes the circuit board production detection method based on machine vision as described above, and the circuit board production detection system based on machine vision comprises:

[0064] The circuit board visual acquisition module is used to extract circuit board parameters of the high-density interconnected circuit board to be inspected and obtain monitoring circuit board parameters; the visual sensor is used to scan the high-density interconnected circuit board to be inspected and generate original X-ray detection image data;

[0065] An image preprocessing module is used to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnection circuit board to be detected, so as to obtain original X-ray image sequence data of the circuit board; perform image preprocessing on the original X-ray image sequence data of the circuit board, so as to obtain preprocessed circuit board detection image data;

[0066] The hole feature analysis module is used to perform image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; perform morphological expansion operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole area extraction to obtain hole area image data; perform hole feature analysis on the hole area image data to obtain hole feature vector data;

[0067] The circuit board residual copper detection module is used to obtain circuit board hole image sample data; train the residual copper classification model according to the circuit board hole image sample data, so as to build a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area on the hole structure mask data, so as to obtain the residual copper detection result data.

[0068] Preferably, a storage medium stores a computer program, and when the computer program is executed, the circuit board production detection method based on machine vision as described in any one of the above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a schematic diagram of the steps of the circuit board production detection method based on machine vision of the present invention;

[0070] Figure 2 for Figure 1 Detailed implementation steps of step S1 in FIG.

[0071] Figure 3 for Figure 1 Detailed implementation steps of step S4 in FIG.

[0072] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0073] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

[0074] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0075] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0076] To achieve this, please refer to Figures 1 to 3 The present invention provides a circuit board production detection method based on machine vision, comprising the following steps:

[0077] Step S1: extracting circuit board parameters of the high-density interconnection circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnection circuit board to be inspected by using a visual sensor to generate original X-ray detection image data;

[0078] Step S2: Based on the original X-ray detection image data, virtual slicing is performed along a direction perpendicular to the high-density interconnection circuit board to be detected to obtain original X-ray image sequence data of the circuit board; image preprocessing is performed on the original X-ray image sequence data of the circuit board to obtain preprocessed circuit board detection image data;

[0079] Step S3: performing image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; performing morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and performing image hole region extraction to obtain hole region image data; performing hole feature analysis on the hole region image data to obtain hole feature vector data;

[0080] Step S4: Obtain sample data of the hole image of the circuit board; train a residual copper classification model based on the sample data of the hole image of the circuit board to construct a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area based on the hole structure mask data to obtain residual copper detection result data.

[0081] In the embodiment of the present invention, reference Figure 1 FIG. 1 is a schematic diagram of the process flow of a circuit board production detection method based on machine vision of the present invention. In this embodiment, the circuit board production detection method based on machine vision includes the following steps:

[0082] Step S1: extracting circuit board parameters of the high-density interconnection circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnection circuit board to be inspected by using a visual sensor to generate original X-ray detection image data;

[0083] In an embodiment of the present invention, key parameter information of a high-density interconnect circuit board (HDIPCB) to be inspected is obtained, for example, for determining scanning parameters, image correction and defect identification. Parameter extraction can use a variety of methods, such as a high-precision scanner, an optical measuring instrument or a measurement method based on image processing. Specific operations, for example: use a high-precision scanner to scan the HDIPCB, obtain its physical dimensions (length, width, thickness), and record them, for example, the length is 10cm, the width is 8cm, and the thickness is 1.6mm. At the same time, an optical measuring instrument or an image processing algorithm is used to measure key parameters such as the number of layers, wire width, spacing, aperture size, and hole position coordinates of the PCB. For example, it can be identified that the number of layers of the PCB is 8, the minimum wire width is 50μm, the minimum hole spacing is 100μm, and the aperture range is 0.2mm to 0.5mm. After these parameters are measured, they are stored as monitoring circuit board parameters for use in subsequent steps. Next, a visual sensor, such as an X-ray imaging system, is used to scan the HDIPCB. During the scanning process, it is necessary to set appropriate parameters such as X-ray energy and exposure time according to the material, thickness and detection requirements of the PCB. For example, for thicker PCBs, higher X-ray energy is required to ensure sufficient penetration. After scanning, the generated raw X-ray inspection image data is saved, for example, as a series of grayscale images, and the grayscale value of each pixel represents the attenuation degree of the X-ray.

[0084] Step S2: Based on the original X-ray detection image data, virtual slicing is performed along a direction perpendicular to the high-density interconnection circuit board to be detected to obtain original X-ray image sequence data of the circuit board; image preprocessing is performed on the original X-ray image sequence data of the circuit board to obtain preprocessed circuit board detection image data;

[0085] In an embodiment of the present invention, virtual slicing is performed along a direction perpendicular to the HDIPCB. The three-dimensional X-ray data is sliced ​​along the thickness direction (Z axis) of the PCB, and a two-dimensional image is extracted at a certain distance (e.g., 0.1 mm). For example, for a PCB with a thickness of 1.6 mm, it can be cut into 16 two-dimensional images, each of which represents the structural information of the PCB at different depths. This process is similar to medical CT scanning, which converts three-dimensional data into a series of two-dimensional slice images. Then, the generated circuit board original X-ray image sequence data is subjected to image preprocessing. The purpose of preprocessing is to improve image quality, such as removing noise, enhancing contrast, and correcting geometric distortion. Common preprocessing methods include: 1. Image filtering: Use Gaussian filtering, median filtering and other methods to remove noise in the image, such as using a 3x3 median filter to remove salt and pepper noise; 2. Image enhancement: Use histogram equalization, contrast stretching and other methods to enhance image contrast, so that structures such as holes and wires are clearer, such as using histogram equalization to evenly distribute the image grayscale values; 3. Geometric distortion correction: Use the pre-shot calibration plate image to calculate the distortion parameters of the imaging system, and then correct the original image to eliminate the influence of geometric distortion. For example, use a checkerboard calibration plate to calculate the radial distortion and tangential distortion parameters, and correct the image. After preprocessing, the preprocessed circuit board inspection image data is obtained.

[0086] Step S3: performing image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; performing morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and performing image hole region extraction to obtain hole region image data; performing hole feature analysis on the hole region image data to obtain hole feature vector data;

[0087] In an embodiment of the present invention, the pre-processed circuit board inspection image data is subjected to image hole structure mask processing. The purpose of this step is to extract the area representing the hole in the image to form a binary image, which is called hole structure mask data. Specific operations include: using a threshold segmentation method, setting the pixel points in the image whose grayscale value is lower than a certain threshold to 1 (representing the hole), and setting the remaining pixel points to 0 (representing the background). The selection of the threshold can be adjusted according to the grayscale distribution of the image, for example, the Otsu algorithm can be used to automatically calculate the optimal threshold. Edge detection algorithms, such as the Canny operator, can also be used to extract the edges of the holes, and then fill the internal area of ​​the edges to form a hole structure mask. Then, a morphological dilation operation is performed on the pre-processed circuit board inspection image data through the hole structure mask data. The purpose of the dilation operation is to expand the hole area so as to include pixels around the edge of the hole. For example, a 3×3 square structure element can be used for dilation operation to expand the hole area outward by one pixel. Next, the image hole area is extracted. The expanded hole structure mask data is multiplied by the pre-processed image data to obtain the hole area image data. This step is equivalent to cutting out the hole area from the original image and retaining only the information of the hole part. Finally, the hole feature analysis is performed on the hole area image data. For each hole area, its features are extracted, such as area, perimeter, roundness, aspect ratio, grayscale mean, grayscale variance, etc. These features can describe the shape, size and grayscale distribution of the hole. The extracted features are combined into a vector, which is the hole feature vector data. For example, the feature vector of a hole can be expressed as: [area, perimeter, roundness, aspect ratio, grayscale mean, grayscale variance].

[0088] Step S4: Obtain sample data of the hole image of the circuit board; train a residual copper classification model based on the sample data of the hole image of the circuit board to construct a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area based on the hole structure mask data to obtain residual copper detection result data.

[0089] In an embodiment of the present invention, sample data of hole images of a circuit board are obtained. A certain number of hole image samples with known residual copper states are collected, including samples with residual copper and samples without residual copper. For example, 1000 hole images with residual copper and 1000 hole images without residual copper are collected and annotated. Then, feature engineering is performed on the sample data of hole images of the circuit board. Features are extracted for each sample image, for example, using the same feature extraction method as step S3 to obtain sample feature data of hole images of the circuit board, including sample feature data of residual copper of the hole and sample feature data of non-residual copper of the hole. Then, the sample feature data of residual copper of the hole and the sample feature data of non-residual copper of the hole are divided into a training set and a test set, for example, divided in a ratio of 8:2. Classifier model training is performed on the preset support vector machine model based on the model training feature set. For example, a binary classification model is trained using the SVM algorithm to divide the holes into two categories: residual copper and non-residual copper. Appropriate kernel functions and parameters can be selected, for example, using the RBF kernel function, and the cross-validation method is used to select the optimal parameters. After the training is completed, the initial residual copper recognition model is obtained. Next, the initial residual copper recognition model is model verified by the model verification feature set, and the hyperparameters are optimized by the genetic algorithm. The performance of the model is evaluated using the test set, such as calculating the accuracy, recall rate, F1 value and other indicators. The model parameters can be fine-tuned using optimization algorithms such as genetic algorithms to further improve the performance of the model. After optimization, the final residual copper feature recognition model is obtained. Finally, the residual copper feature recognition model is used to detect residual copper on the hole feature vector data. The hole feature vector data extracted in step S3 is input into the trained residual copper feature recognition model, and the model outputs the probability of residual copper in each hole. And the residual copper area is located for the hole structure mask data. According to the residual copper probability, the holes with a probability exceeding a certain threshold are marked as residual copper holes, and the corresponding positions in the hole structure mask data are marked out, so as to obtain the residual copper detection result data, including the position and probability information of the residual copper holes. The detection result can be post-processed according to the pre-processed circuit board detection image data, such as removing the misdetected residual copper area, or performing a more detailed analysis of the residual copper area.

[0090] As an example of the present invention, refer to Figure 2 As shown, Figure 1 Detailed implementation steps of step S1 in the flowchart, in this example, step S1 includes:

[0091] Step S11: extracting circuit board parameters from the high-density interconnection circuit board to be detected to obtain monitoring circuit board parameters;

[0092] In an embodiment of the present invention, a high-precision measuring device is used, for example, a laser scanner or a high-resolution camera is used in combination with an image processing algorithm to accurately measure the key parameters of the HDIPCB. These parameters include the physical dimensions (length, width, thickness), number of layers, wire width, spacing, aperture size, hole coordinates, and the position of special marking points of the PCB. The purpose of the measurement is to obtain accurate geometric information of the PCB and provide basic data for subsequent circuit board positioning, posture adjustment, and scanning path planning. For example, for an HDIPCB with a size of 100mm×80mm×1.6mm, the length is measured to be 100.2mm, the width is 79.8mm, the thickness is 1.62mm, the minimum wire width is 50 microns, the minimum aperture is 0.2mm, and circular positioning marking points with a diameter of 1mm are set at the four corners of the PCB, and their coordinates are (5,5), (5,75), (95,5), (95,75) (unit: mm), respectively, to form monitoring circuit board parameters.

[0093] Step S12: using a visual sensor to identify the circuit board positioning feature points of the high-density interconnection circuit board to be inspected, and adjusting the circuit board posture to obtain the circuit board positioning posture data;

[0094] In an embodiment of the present invention, first, a camera captures an image of a PCB. Then, an image processing algorithm analyzes the captured image and identifies pre-set circuit board positioning feature points. These feature points may be specific marks, hole centers, edge corners, etc. on the PCB. For example, a circular feature point detection algorithm may be used to identify the four circular positioning mark points mentioned in step S11. The recognition process includes steps such as image preprocessing (such as filtering, binarization), feature point extraction and matching. After the feature points are identified, the actual position and posture of the PCB are calculated according to the positions of these feature points in the image. The posture information includes the plane rotation angle and spatial tilt angle of the PCB. For example, by identifying the image coordinates of the four positioning mark points and combining them with the actual coordinates obtained in step S11, the rotation angle and offset of the PCB may be calculated using a perspective transformation or an affine transformation. The calculated posture information will be used to control the robot arm or adjust the platform to adjust the posture of the PCB so that it is aligned with the predetermined scanning position and angle. After the adjustment is completed, the posture of the PCB is confirmed again using a visual sensor to ensure that it is in the correct scanning position and posture. Finally, the circuit board positioning posture data is obtained, including the precise position coordinates (x, y, z) and posture angles (θx, θy, θz) of the PCB, where θx, θy, θz represent the rotation angles around the x, y, and z axes, respectively.

[0095] Step S13: Scanning parameters of the monitoring circuit board are read through a preset scanning database to obtain scanning parameter configuration data;

[0096] In an embodiment of the present invention, scanning parameters of HDIPCBs of different types and specifications are stored in the scanning database, including the voltage, current, exposure time, scanning angle, scanning spacing, detector gain, etc. of the X-ray source. The setting of these parameters needs to be optimized according to the material, thickness, structural characteristics and detection requirements of the PCB. For example, for thicker PCBs, it is necessary to increase the X-ray voltage and current to improve the penetration ability; for thinner PCBs, the voltage and current can be appropriately reduced to reduce radiation damage. In the case of needing to detect tiny defects, it is necessary to reduce the scanning spacing and exposure time to improve the image resolution. The scanning parameter reading process is as follows: First, according to the monitoring circuit board parameters extracted in step S11 (such as the size, number of layers, material, etc. of the PCB), the matching scanning parameter records are retrieved in the scanning database. If there is no completely matching record, interpolation or approximate matching can be performed based on similar PCB parameters. Then, the scanning parameters in the matching record are read to form scanning parameter configuration data.

[0097] Step S14: performing multi-angle scanning path planning on the high-density interconnection circuit board to be inspected based on the scanning parameter configuration data and the circuit board positioning posture data to generate scanning path planning data;

[0098] In an embodiment of the present invention, the scanning range is determined according to the PCB size information obtained in step S11 to avoid the scanning area exceeding the PCB boundary. According to the PCB posture data obtained in step S12, the scanning path is adjusted so that the scanning plane is always perpendicular to the PCB surface. According to the scanning angle range obtained in step S13, the starting angle and the ending angle of the scan are determined. According to the scanning interval obtained in step S13, the angle increment of each scan is determined. When planning the scanning path, collision detection is required to avoid collision between the X-ray source and the detector and the PCB or other equipment. For example, for an HDIPCB with a plane size of 100mm×80mm and a posture angle of (0, 0, 10°), the scanning angle range is -30°~+30°, and the scanning interval is 0.5°. The scanning path planning process is as follows: First, according to the center position and size of the PCB, the center point and boundary of the scanning area are determined. Then, according to the posture angle of the PCB, the position and direction of the X-ray source and the detector at each scanning angle are calculated so that the scanning plane is always perpendicular to the PCB surface. Next, a series of scanning angles are generated according to the scanning angle range and scanning spacing, such as -30°, -29.5°, -29°, ..., 29.5°, 30°. Finally, the position and direction information of the X-ray source and detector corresponding to each scanning angle, as well as the scanning parameter configuration data, are combined into scanning path planning data.

[0099] Step S15: controlling the X-ray source to scan the high-density interconnection circuit board to be inspected according to the scanning path planning data and the scanning parameter configuration data, and using the detector to receive the X-rays to obtain multi-angle X-ray transmission data;

[0100] In an embodiment of the present invention, the X-ray source and the detector are controlled to move to the starting position according to the scanning path planning data. Then, the voltage, current and exposure time of the X-ray source are set according to the scanning parameter configuration data. Next, according to the angle sequence in the scanning path planning data, the angles of the X-ray source and the detector are gradually adjusted, and the X-ray source is triggered to emit X-rays. After the X-rays penetrate the PCB, they are received by the detector. The detector converts the received X-ray signal into an electrical signal, amplifies and converts the analog-to-digital signal, and obtains digital X-ray transmission data. For example, for each scanning angle, the detector collects a certain amount of X-ray transmission data to form a frame of X-ray image. After the multi-angle scanning is completed, a series of X-ray transmission data at different angles will be obtained, which contains information about the internal structure of the PCB at different viewing angles.

[0101] Step S16: performing X-ray signal conversion on the multi-angle X-ray transmission data, and reconstructing the image data to generate original X-ray detection image data.

[0102] In an embodiment of the present invention, signal correction is performed on multi-angle X-ray transmission data, including dark current correction, gain correction and geometric correction, to eliminate the noise and nonlinear response of the detector itself and correct image distortion. Then, according to the position information of the X-ray source and the detector corresponding to each scanning angle in the scanning path planning data, the X-ray tomography (CT) reconstruction algorithm, such as the filtered back projection algorithm (FBP) or the algebraic reconstruction algorithm (ART), is used to process the corrected X-ray transmission data to reconstruct the three-dimensional image data of the internal structure of the PCB. The reconstruction process is essentially to solve a large linear equation system, and the X-ray absorption coefficient of each voxel inside the PCB is obtained by inversion calculation. For example, for a 100mm×80mm×1.6mm PCB, it can be discretized into a grid of 1000×800×160 voxels, and the reconstruction algorithm will calculate the X-ray absorption coefficient of each voxel, thereby obtaining the three-dimensional density distribution inside the PCB.

[0103] Preferably, step S2 comprises the following steps:

[0104] Step S21: performing virtual slicing processing along a direction perpendicular to the high-density interconnection circuit board to be inspected based on the original X-ray inspection image data to obtain original X-ray image sequence data of the circuit board;

[0105] Step S22: performing non-local mean filtering to reduce noise on the original X-ray image sequence data of the circuit board to obtain primary noise-reduced image sequence data;

[0106] Step S23: calculating the distortion parameters of the imaging system according to the pre-shot chessboard calibration plate image to obtain distortion correction parameter data;

[0107] Step S24: performing image geometric distortion correction on the primary denoised image sequence data using the distortion correction parameter data to obtain geometrically corrected image sequence data;

[0108] Step S25: performing wavelet transform artifact removal according to the geometrically corrected image sequence data, and performing inverse wavelet transform to reconstruct the image, thereby obtaining pre-processed circuit board inspection image data.

[0109] In an embodiment of the present invention, three-dimensional X-ray data is converted into a series of two-dimensional images. The specific operation is as follows: first, the thickness direction of the HDI PCB, that is, the Z-axis direction, is determined. Then, a series of parallel planes are selected at certain intervals (for example, 0.1 mm) along the Z-axis direction. On each plane, two-dimensional image data on the plane is extracted from the original three-dimensional X-ray data by interpolation or other data extraction methods. For example, for a piece of HDIPCB with a thickness of 1.6 mm, 16 two-dimensional X-ray images will be obtained by slicing at intervals of 0.1 mm. These images are arranged in sequence to form a sequence of original X-ray images of the circuit board, and each image represents the internal structure information of the PCB at the depth position. For each image in the sequence, a search window is selected with a pixel as the center. In the search window, the similarity weight between the neighborhood of the central pixel and the neighborhood of the remaining pixels is calculated. The higher the similarity weight, the more similar the two neighborhoods are. Then, the grayscale values ​​of all pixels in the search window are weighted averaged according to the similarity weight to obtain the grayscale value of the central pixel after noise reduction. For example, for a 3×3 neighborhood and a 7×7 search window, the NLM algorithm calculates the similarity between the central 3×3 neighborhood and other 3×3 neighborhoods in the search window, and performs weighted averaging based on the similarity to obtain the initial denoised image sequence data. An image of a checkerboard calibration plate is taken using an X-ray imaging system. The checkerboard calibration plate has a regular grid structure, and the coordinates of the corner points are known. Then, the corner point detection algorithm is used to extract the pixel coordinates of the corner points in the calibration plate image. Next, based on the actual coordinates and pixel coordinates of the corner points of the calibration plate, a distortion model, such as a radial distortion model and a tangential distortion model, is established. Finally, the distortion model parameters are solved by an optimization algorithm, such as the least squares method, to obtain the distortion correction parameter data, including the camera intrinsic parameter matrix and the distortion coefficients. For example, radial distortion coefficients k1, k2, k3, etc., and tangential distortion coefficients p1, p2, etc. For each image in the initial denoised image sequence, each pixel in the image is traversed. According to the pixel coordinates and the distortion correction parameter data, the coordinates of the undistorted image corresponding to the pixel are calculated. Then, an interpolation algorithm, such as bilinear interpolation or bicubic interpolation, is used to obtain the corresponding grayscale value in the primary denoised image according to the coordinates of the undistorted image, and the grayscale value is assigned to the pixel at the corresponding position in the geometrically corrected image. For example, for a radially distorted pixel, its ideal position is calculated according to the distortion coefficient, and then the grayscale value of the ideal position is obtained by interpolation. By performing geometric distortion correction on all pixels in the image sequence, the geometrically corrected image sequence data is obtained. Multi-level wavelet decomposition is performed on each image in the geometrically corrected image sequence to decompose the image into sub-band images of different frequencies. Then, threshold processing is performed on the high-frequency sub-band image to remove or weaken the high-frequency component corresponding to the artifact. The selection of the threshold needs to be adjusted according to the intensity of the artifact and the noise level of the image. Then, the processed sub-band image is used to perform inverse wavelet transform to reconstruct the image.For example, the db4 wavelet can be used for 3-level decomposition, soft threshold processing can be performed on the high-frequency subband coefficients, and then inverse transformation can be performed. Through wavelet transform artifact removal, artifacts such as stripes and ringing in the image can be effectively suppressed to obtain clear pre-processed circuit board inspection image data.

[0110] Preferably, step S3 comprises the following steps:

[0111] Step S31: using the preset hole structure element data to perform a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data to obtain Top-Hat transformed image data;

[0112] Step S32: Calculate the Hessian matrix eigenvalues ​​based on the Top-Hat transformation image data, and determine the hole edge pixel points to obtain the hole edge pixel points and other pixel points respectively;

[0113] Step S33: setting the maximum grayscale value for the pixel points at the edge of the hole, and keeping the grayscale values ​​of other pixel points unchanged, thereby obtaining hole edge enhanced image data;

[0114] Step S34: performing image hole structure mask processing on the hole edge enhanced image data to obtain hole structure mask data;

[0115] Step S35: performing a morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and extracting the image hole area to obtain hole area image data;

[0116] Step S36: Perform hole feature analysis on the hole area image data to obtain hole feature vector data.

[0117] In an embodiment of the present invention, a group of hole structure elements of different sizes are selected, such as circular structure elements with radii of 1, 2, and 3 pixels, respectively. Then, each structure element is used to perform Top-Hat transformation on the preprocessed image. Top-Hat transformation includes white top-hat transformation (extracting bright details) and black top-hat transformation (extracting dark details), and the appropriate transformation type is selected according to the actual situation. Finally, multiple Top-Hat transformation results are fused by weighted averaging or taking the maximum value to obtain Top-Hat transformation image data. For example, for a hole with a diameter of 5 pixels, a white top-hat transformation is performed using circular structure elements with radii of 1, 2, and 3 pixels, which can effectively enhance the brightness of the hole area and suppress background noise. For each pixel in the Top-Hat transformation image, its Hessian matrix is ​​calculated. The calculation of the Hessian matrix involves calculating the second-order partial derivative of the image, and methods such as the second-order derivative of the Sobel operator or the Gaussian filter can be used. Then, the eigenvalues ​​λ1 and λ2 of the Hessian matrix are calculated. The size and sign of the eigenvalue reflect the change in the local curvature of the image. For the hole edge pixel, one of its eigenvalues ​​is larger, the other eigenvalue is smaller, and the signs are opposite. According to the size and sign relationship of the eigenvalues, a threshold is set to determine whether the pixel is a hole edge pixel. For example, thresholds T1 and T2 can be set. When λ1>T1 and λ2<-T2 or λ1<-T1 and λ2>T2, the pixel is considered to be a hole edge pixel, otherwise it is other pixel. Traverse all pixels in the image to obtain a hole edge pixel set and other pixel sets. Determine the maximum value of the image grayscale value, such as 255 (for 8-bit images). Then, traverse all pixels in the image. If the pixel belongs to the hole edge pixel set, set its grayscale value to the maximum value, such as 255. If the pixel belongs to other pixel sets, keep its grayscale value unchanged. For example, for a hole edge pixel with a grayscale value of 100, set its grayscale value to 255; for a non-hole edge pixel with a grayscale value of 150, keep its grayscale value at 150. By processing all pixels, hole edge enhanced image data is obtained, in which the hole edge is highlighted and other areas retain the original grayscale information. The hole edge enhanced image data is binarized to convert the image into black and white. The selection of the binarization threshold can be adjusted according to the grayscale distribution of the image, for example, the Otsu threshold or the adaptive threshold can be selected. Pixels above the threshold (hole edge) are set to white (usually represented as 1), and pixels below the threshold are set to black (usually represented as 0). Then, the binary image is subjected to morphological processing, such as opening operation (erosion followed by expansion) or closing operation (expansion followed by erosion), to remove small noise points and fill the holes inside the holes. For example, a 3x3 structure element can be used for opening operation to remove small noise points and maintain the shape of the hole.The processed binary image is the hole structure mask data, in which the white area represents the hole and the black area represents the non-hole. A morphological dilation operation is performed on the hole structure mask data. The dilation operation uses a structural element, such as a 3x3 square or circular structural element, to slide on the hole structure mask image and set the pixel value in the area covered by the structural element to the maximum value. The dilation operation can enlarge the hole area to make it slightly larger than the actual hole size, thereby ensuring that the hole area is completely covered. For example, a 3x3 circular structural element can be used for the dilation operation. Then, the expanded hole structure mask data is logically ANDed with the pre-processed circuit board inspection image data. As a result of the logical AND operation, only the pixels that are white (or high value) in both the hole structure mask data and the pre-processed image data will be retained, thereby extracting the image data of the hole area. For example, if the grayscale value of the hole area in the preprocessed image is 50-100, and the grayscale value of the background is 150-200, then after the logical AND operation, only the pixels with a grayscale value of 50-100, that is, the pixels of the hole area, are retained to obtain the hole area image data. For each hole area, a series of eigenvalues ​​are calculated and these eigenvalues ​​are combined into a eigenvector. For example, for a circular hole, its roundness is close to 1 and its aspect ratio is close to 1; for an elliptical hole, its roundness is less than 1 and its aspect ratio is greater than 1. For a hole with residual copper, its grayscale mean will be higher than that of a normal hole. By calculating these eigenvalues, the eigenvector of each hole can be obtained. For example, the eigenvector of a hole is (100, 35, 0.95, 1.02, 50, 60, 80), which respectively represent the area, perimeter, roundness, aspect ratio, centroid x coordinate, centroid y coordinate, and grayscale mean. The feature vectors of all holes are combined to form hole feature vector data.

[0118] Preferably, step S34 includes the following steps:

[0119] Step S341: Adaptively binarize and segment the hole edge enhanced image data to obtain binary detection image data;

[0120] Step S342: performing anisotropic diffusion filtering according to the binary detection image data, and performing sub-pixel edge positioning to generate sub-pixel edge detection data;

[0121] Step S343: performing a fracture edge hole contour connection process based on the sub-pixel edge detection data to generate initial hole contour data;

[0122] Step S344: ellipse fitting optimization is performed on the initial hole contour data, and morphological opening operation is performed to obtain the buried hole / blind hole contour data of the circuit board;

[0123] Step S345: performing image hole structure mask processing according to the buried hole / blind hole contour data of the circuit board to obtain hole structure mask data.

[0124] In an embodiment of the present invention, first, the hole edge enhanced image data is divided into several small areas. For example, a sliding window can be used to divide the image into multiple overlapping or non-overlapping areas. Then, a threshold is calculated for each area. For example, the average gray value, median gray value or weighted average gray value of the local area can be used as the threshold. Finally, each area is binarized according to the calculated threshold, and the pixel points with gray values ​​greater than the threshold are set to white (for example, the pixel value is 255), and the pixel points less than the threshold are set to black (for example, the pixel value is 0). For example, for a local area, if its average gray value is 150, the pixel gray values ​​in the area greater than 150 are set to 255, and those less than 150 are set to 0. In this way, the threshold can be adaptively adjusted according to the local grayscale change, the segmentation accuracy is improved, and the binary detection image data is obtained. The binary detection image data is smoothed using anisotropic diffusion filtering to reduce the influence of noise and enhance the clarity of the edge. The diffusion coefficient of the anisotropic diffusion filter depends on the local gradient of the image. The diffusion coefficient is small in the edge area, thereby retaining the edge; the diffusion coefficient is large in the flat area, thereby smoothing the noise. Then, sub-pixel edge positioning is performed on the smoothed image. Sub-pixel edge positioning technology can accurately locate the edge position below the pixel level, for example, it can be accurate to 0.1 pixel or 0.01 pixel. Common sub-pixel edge positioning methods include interpolation method, fitting method, etc. For example, the Zernike moment method can be used for sub-pixel edge positioning. Finally, sub-pixel edge detection data is generated, which contains the precise position information of the hole edge with higher accuracy than the pixel level. According to the sub-pixel edge detection data, the pixel points or sub-pixel points of the hole edge are extracted. Then, the connectivity of the edge points is analyzed, for example, using the 8-neighborhood or 4-neighborhood connection criteria to connect adjacent edge points into line segments. For broken edges, some edge connection algorithms, such as Hough transform or distance-based connection algorithms, can be used to connect the broken edges to form a closed hole contour. For example, for two fracture edge segments that are close to each other, it can be determined whether they need to be connected based on their direction and distance. If they need to be connected, a straight line segment or a curve segment is added between them to connect them and generate initial hole contour data. Use an ellipse fitting algorithm, such as the least squares method or an ellipse detection algorithm based on Hough transform, to fit the initial hole contour data to obtain a best fitting ellipse. Ellipse fitting can effectively remove burrs and noise on the contour and obtain the shape parameters of the hole, such as the major axis, minor axis and direction. Then, a morphological opening operation is performed on the fitted ellipse. The opening operation is an erosion operation followed by a dilation operation, which can remove small burrs and noise while maintaining the overall shape of the hole. For example, a circular or elliptical structural element slightly smaller than the hole size can be used for the opening operation to obtain the buried hole / blind hole contour data of the circuit board.Create a blank image of the same size as the original image, and initialize all pixel values ​​to 0. Then, according to the buried / blind hole contour data of the circuit board, set the pixel value inside the hole contour to 1. For example, a polygon filling algorithm or a scan line filling algorithm can be used to fill the pixels inside the hole contour to 1. Finally, the hole structure mask data is obtained, which is a binary image that clearly identifies the location and shape of the hole.

[0125] Preferably, step S343 includes the following steps:

[0126] Performing sub-pixel edge gradient amplitude calculation on sub-pixel edge detection data to generate edge pixel gradient amplitude data;

[0127] The edge pixel gradient amplitude data is subjected to dual-threshold hysteresis edge connection judgment by a preset high threshold and a preset low threshold, and pixels whose edge pixel gradient amplitude data is greater than the preset high threshold are marked as strong edge point data; pixels whose edge pixel gradient amplitude data is less than the preset low threshold are marked as non-edge point data; pixels whose edge pixel gradient amplitude data is between the preset high threshold and the preset low threshold are marked as weak edge point data;

[0128] Determine the buried / blind via radius range by monitoring the circuit board parameters and obtain the hole radius range data;

[0129] Use hole radius range data to perform Hough transform circular detection on sub-pixel edge detection data to generate candidate circular hole data for the circuit board;

[0130] The candidate circular hole data of the circuit board are mapped to edge points through strong edge point data, non-edge point data and weak edge point data, and the broken edge hole contours are connected to obtain the initial hole contour data.

[0131] In the embodiment of the present invention, a convolution operation is performed on the sub-pixel edge detection data using an edge detection operator such as the Sobel operator to calculate the gradients in the x-direction and the y-direction respectively. Then, the gradient amplitude is calculated based on the x-direction gradient and the y-direction gradient. The gradient amplitude can represent the strength of the edge. The larger the amplitude, the stronger the edge. For example, for a sub-pixel edge point (x, y), if its x-direction gradient is Gx and its y-direction gradient is Gy, then the gradient amplitude Mag = sqrt(Gx 2 +Gy 2). The gradient amplitudes of all sub-pixel edge points are calculated to generate edge pixel gradient amplitude data. First, two thresholds are preset: a high threshold T1 and a low threshold T2 (T1>T2). Then, the edge pixel gradient amplitude data is compared with these two thresholds. If the gradient amplitude is greater than T1, the pixel is marked as a strong edge point; if the gradient amplitude is less than T2, it is marked as a non-edge point; if the gradient amplitude is between T1 and T2, it is marked as a weak edge point. For example, let T1=200, T2=100, for a pixel with a gradient amplitude of 250, it is marked as a strong edge point; for a pixel with a gradient amplitude of 80, it is marked as a non-edge point; for a pixel with a gradient amplitude of 150, it is marked as a weak edge point. According to the circuit board parameters extracted in step S11, especially the aperture parameters, the radius range of the buried hole / blind hole is determined. The circuit board design parameters usually include the tolerance range of the aperture. Based on this tolerance range, a reasonable hole radius range can be determined for subsequent Hough transform circle detection. For example, if the hole diameter is specified as 0.2mm±0.01mm in the circuit board design parameters, and the pixel resolution of the imaging system is 0.005mm / pixel, the hole radius range is (0.095 / 0.005) to (0.105 / 0.005) pixels, that is, 19 to 21 pixels. This range is used as the hole radius range data to limit the search space of the Hough transform. According to the hole radius range data, the radius parameter of the Hough transform is set. Then, the sub-pixel edge detection data is subjected to the Hough transform. The Hough transform maps the edge points in the image space to the curve in the parameter space, and the circle can be detected by counting the intersection points of the curve in the parameter space. According to the hole radius range data, the Hough transform is only performed within the specified radius range, which can improve the detection efficiency and reduce false detection. For example, if the hole radius range is set to 19 to 21 pixels, the Hough transform will only search in the circle parameter space with radii of 19, 20, and 21. The detected circle parameters (center coordinates and radius) are the candidate circular hole data of the circuit board. Map the candidate circular hole data of the circuit board back to the image space to obtain the outline of the candidate circle. Then, check whether the pixels on the outline of the candidate circle are strong edge points. If most of the pixels on the outline of the candidate circle are strong edge points, the candidate circle is considered to be a valid hole. For weak edge points, if there is a strong edge point in its neighborhood and the weak edge point is located on the outline of a candidate circle, the weak edge point is also connected to the hole outline, thereby connecting the broken edges. Non-edge points are ignored. In this way, the broken hole outlines can be connected to form complete initial hole outline data. For example, if 80% of the pixels on the outline of a candidate circle are strong edge points and 20% of the pixels are weak edge points, and these weak edge points are all adjacent to strong edge points, then this is considered to be a valid hole, and the weak edge points are connected to the hole outline. The final initial hole outline data will contain complete and connected hole outline information.

[0132] Preferably, step S36 includes the following steps:

[0133] Step S361: performing grayscale feature statistics on the hole area image data to obtain hole grayscale feature data;

[0134] Step S362: performing gray level co-occurrence matrix calculation according to the hole gray level feature data to generate hole texture feature data;

[0135] Step S363: performing geometric shape feature analysis based on the hole area image data to obtain hole geometric shape feature data;

[0136] Step S364: integrating the hole grayscale feature data, the hole texture feature data and the hole geometric shape feature data to obtain hole feature vector data.

[0137] In an embodiment of the present invention, for each hole region, the distribution of its grayscale value is statistically analyzed, and a variety of grayscale features can be calculated, such as grayscale mean, grayscale variance, grayscale skewness, grayscale kurtosis, maximum grayscale value, minimum grayscale value, etc. The grayscale mean reflects the average grayscale level of the hole region, the variance reflects the discrete degree of the grayscale value, the skewness reflects the symmetry of the grayscale distribution, and the kurtosis reflects the sharpness of the grayscale distribution. For example, a high grayscale mean in a hole region indicates that there are defects such as residual copper inside the hole. The calculated multiple grayscale eigenvalues ​​are combined into a vector, which is the hole grayscale feature data. Based on the hole region image data, the grayscale co-occurrence matrix (GLCM) is calculated. GLCM describes the spatial relationship between different grayscale pixels in the image. Select appropriate distance and direction parameters, such as a distance of 1 pixel and directions of 0°, 45°, 90° and 135°. After calculating the GLCM in four directions, a variety of texture features can be further calculated, such as energy, contrast, correlation, inverse moment, entropy, etc. Energy reflects the uniformity of the grayscale distribution of the image, contrast reflects the clarity of the image, correlation reflects the degree of correlation of the local grayscale values ​​of the image, inverse moment reflects the local change of the image texture, and entropy reflects the complexity of the image. The calculated multiple texture feature values ​​are combined into a vector, which is the hole texture feature data. For example, a hole area has a low contrast, which means that the texture inside the hole is relatively uniform. Calculate a variety of geometric shape features, such as area, perimeter, roundness, aspect ratio, eccentricity, Hu moment, etc. The area represents the number of pixels in the hole area, the perimeter represents the length of the hole outline, the roundness represents the similarity between the hole shape and the circle, the aspect ratio represents the aspect ratio of the hole, the eccentricity represents the elliptical degree of the hole shape, and the Hu moment is a set of invariant moments that can describe the shape characteristics of the hole and is not affected by rotation, translation and scaling. For example, a hole with a roundness close to 1 means that its shape is close to a circle; an aspect ratio much greater than 1 means that its shape is relatively slender. The calculated multiple geometric shape feature values ​​are combined into a vector, which is the hole geometric shape feature data. The hole grayscale feature data, hole texture feature data, and hole geometry feature data are connected to form a high-dimensional feature vector. For example, if there are 4 grayscale features, 5 texture features, and 6 geometry features, the final hole feature vector will contain 15 elements.

[0138] As an example of the present invention, refer to Figure 3 As shown, Figure 1 Detailed implementation steps of step S4 in the embodiment are shown in the flowchart. In this embodiment, step S4 includes:

[0139] Step S41: Obtaining circuit board hole image sample data;

[0140] In an embodiment of the present invention, sample data is obtained through a variety of ways: 1. Collecting circuit boards with residual copper defects from the actual production process, and using an X-ray imaging system to obtain hole images; 2. Using artificial methods to simulate the manufacture of residual copper defects on defect-free circuit boards, and obtaining corresponding hole images; 3. Using simulation software to generate simulated residual copper and non-residual copper hole images. In order to ensure the generalization ability of the model, it is necessary to collect residual copper samples of different types and degrees, as well as non-residual copper samples from different batches and different process conditions. For example, collect 1,000 hole images with residual copper and 1,000 hole images without residual copper, and mark them as positive samples and negative samples respectively.

[0141] Step S42: performing feature engineering processing on the circuit board hole image sample data to obtain circuit board hole image sample feature data; wherein the circuit board hole image sample feature data includes hole residual copper sample feature data and hole non-residual copper sample feature data;

[0142] In an embodiment of the present invention, feature extraction algorithms such as SIFT, SURF, and ORB are used, or features are extracted using a deep learning model. The extracted features are processed, for example, dimensionality reduction methods such as PCA and LDA can be used, or feature selection can be performed to reduce feature dimensions and improve model efficiency. The circuit board hole image sample feature data finally obtained includes hole residual copper sample feature data and hole non-residual copper sample feature data, which correspond to hole image samples with residual copper and without residual copper, respectively. For example, 1000-dimensional SIFT features are extracted for each hole image, and then PCA is used to reduce the feature dimension to 100 dimensions.

[0143] Step S43: performing feature subset processing on the feature data of the hole residual copper samples and the feature data of the hole non-residual copper samples, so as to obtain a model training feature set and a model verification feature set;

[0144] In an embodiment of the present invention, the hole residual copper sample feature data and the hole non-residual copper sample feature data obtained in step S42 are divided into a model training feature set and a model verification feature set according to a certain ratio. For example, it can be divided according to a ratio of 8:2, 80% of the samples are used for training, and 20% of the samples are used for verification. When dividing, it is important to keep the positive and negative sample ratios balanced to avoid model deviations. For example, if there are 800 positive samples and 800 negative samples, the training set contains 640 positive samples and 640 negative samples, and the verification set contains 160 positive samples and 160 negative samples.

[0145] Step S44: performing classifier model training on a preset support vector machine model based on the model training feature set, thereby obtaining an initial residual copper recognition model;

[0146] In an embodiment of the present invention, a support vector machine (SVM) algorithm is used to train a residual copper recognition model. A SVM classifier is trained using the model training feature set obtained in step S43. SVM is a commonly used binary classification algorithm, and its goal is to find an optimal hyperplane to separate samples of different categories. During the training process, it is necessary to select a suitable kernel function and penalty parameter C. For example, a radial basis kernel function (RBF) can be selected, and the penalty parameter C=1 can be set. After the training is completed, an initial residual copper recognition model is obtained, which can be used to preliminarily determine whether there is residual copper in the hole.

[0147] Step S45: verifying the initial residual copper recognition model through the model verification feature set, and optimizing the hyperparameters through the genetic algorithm to obtain the residual copper feature recognition model;

[0148] In the embodiment of the present invention, the initial residual copper recognition model obtained in step S44 is verified, and the performance indicators of the model, such as accuracy, recall rate, F1 value, etc., are evaluated. Then, an optimization algorithm such as a genetic algorithm is used to optimize the hyperparameters of the SVM model, such as the kernel function parameters and the penalty parameter C. The genetic algorithm searches for the optimal hyperparameter combination by simulating natural selection and genetic mechanisms. For example, through the genetic algorithm search, the parameter gamma of the RBF kernel function is finally determined to be 0.1, and the penalty parameter C is determined to be 10, and the final residual copper feature recognition model is obtained.

[0149] Step S46: using the residual copper feature recognition model to perform residual copper detection on the hole feature vector data to generate residual copper probability prediction data;

[0150] In the embodiment of the present invention, the hole feature vector data obtained in step S36 is input into the residual copper feature recognition model obtained in step S45, and the model outputs the probability value of residual copper in each hole to generate residual copper probability prediction data. The higher the probability value, the greater the possibility of residual copper in the hole. For example, the residual copper probability of a hole is 0.9, indicating that the hole has residual copper.

[0151] Step S47: positioning the residual copper area of ​​the hole structure mask data by using the residual copper probability prediction data, and post-processing the detection result according to the pre-processed circuit board detection image data, so as to obtain the residual copper detection result data.

[0152] In an embodiment of the present invention, according to a preset probability threshold, holes whose residual copper probability prediction data is greater than the threshold are marked as residual copper holes. Then, according to the hole structure mask data, the positions of these residual copper holes in the original image are located. For example, the probability threshold is set to 0.8, and holes whose residual copper probability is greater than 0.8 are marked as residual copper holes, and the corresponding positions are marked in the hole structure mask data. Finally, according to the pre-processed circuit board detection image data, the detection results are post-processed. For example, morphological operations can be used to remove small noise points, or connected domain analysis can be used to merge adjacent residual copper areas. Finally, the residual copper detection result data is obtained, including information such as the position and size of the residual copper holes.

[0153] Preferably, the present invention further provides a circuit board production detection system based on machine vision, which executes the circuit board production detection method based on machine vision as described above, and the circuit board production detection system based on machine vision comprises:

[0154] The circuit board visual acquisition module is used to extract circuit board parameters of the high-density interconnected circuit board to be inspected and obtain monitoring circuit board parameters; the visual sensor is used to scan the high-density interconnected circuit board to be inspected and generate original X-ray detection image data;

[0155] An image preprocessing module is used to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnection circuit board to be detected, so as to obtain original X-ray image sequence data of the circuit board; perform image preprocessing on the original X-ray image sequence data of the circuit board, so as to obtain preprocessed circuit board detection image data;

[0156] The hole feature analysis module is used to perform image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; perform morphological expansion operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole area extraction to obtain hole area image data; perform hole feature analysis on the hole area image data to obtain hole feature vector data;

[0157] The circuit board residual copper detection module is used to obtain circuit board hole image sample data; train the residual copper classification model according to the circuit board hole image sample data, so as to build a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area on the hole structure mask data, so as to obtain the residual copper detection result data.

[0158] Preferably, a storage medium stores a computer program, and when the computer program is executed, the circuit board production detection method based on machine vision as described in any one of the above is implemented.

[0159] The present application is to utilize the strong penetration of X-rays, combined with virtual slicing technology, to convert the three-dimensional structure of the circuit board into a two-dimensional image sequence, so that the residual copper defects of the internal structure can be intuitively presented, effectively avoiding the damage caused by physical contact, and realizing true non-destructive testing. Secondly, through image preprocessing technology, noise interference is effectively suppressed and image quality is improved. The hole area is accurately extracted by image hole structure mask processing and morphological expansion operation, and the feature vector data that can accurately identify the residual copper defects is constructed in combination with hole feature analysis. By constructing a residual copper feature recognition model, the intelligent analysis of the hole feature vector data is realized, the accuracy and efficiency of the detection are improved, the risk of manual misjudgment is reduced, and the production cycle is shortened. Through the feature analysis of the hole area image data, a variety of feature parameters related to the residual copper defect are extracted, and the corresponding feature vector data are constructed. These quantitative indicators can objectively reflect the severity of the residual copper defect and provide a scientific basis for the quality control of the production process. At the same time, the residual copper detection based on the residual copper feature recognition model can accurately locate the residual copper area, provide guidance for subsequent rework or scrapping, and avoid unnecessary waste of resources. By early detection and elimination of HDI boards with residual copper defects, functional failure and product scrapping in the subsequent assembly process can be effectively avoided, reducing the cost of rework and after-sales service. Accurate residual copper detection can guide the improvement of production technology, optimize the production process, reduce the generation of defects, and thus improve the overall yield and reliability of HDI boards.

[0160] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0161] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A circuit board production detection method based on machine vision, characterized in that: The following steps are involved: Step S1: extracting circuit board parameters from the high-density interconnection circuit board to be detected to obtain monitoring circuit board parameters; Use the visual sensor to scan the high-density interconnection circuit board to be inspected and generate original X-ray inspection image data; Step S2: Based on the original X-ray detection image data, virtual slicing is performed along a direction perpendicular to the high-density interconnection circuit board to be detected to obtain original X-ray image sequence data of the circuit board; image preprocessing is performed on the original X-ray image sequence data of the circuit board to obtain preprocessed circuit board detection image data; Step S3: performing image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; Performing morphological expansion operation on pre-processed circuit board inspection image data through hole structure mask data, and extracting image hole regions to obtain hole region image data; Perform hole feature analysis on the hole area image data to obtain hole feature vector data; Step S4: Obtaining circuit board hole image sample data; The residual copper classification model is trained according to the sample data of the circuit board hole image to construct the residual copper feature recognition model; the residual copper feature recognition model is used to detect the residual copper on the hole feature vector data, and the residual copper area is located according to the hole structure mask data to obtain the residual copper detection result data.

2. The circuit board production detection method based on machine vision according to claim 1 is characterized in that: Step S1 includes the following steps: Step S11: extracting circuit board parameters from the high-density interconnection circuit board to be detected to obtain monitoring circuit board parameters; Step S12: using a visual sensor to identify the circuit board positioning feature points of the high-density interconnection circuit board to be inspected, and adjusting the circuit board posture to obtain the circuit board positioning posture data; Step S13: Scanning parameters of the monitoring circuit board are read through a preset scanning database to obtain scanning parameter configuration data; Step S14: performing multi-angle scanning path planning on the high-density interconnection circuit board to be inspected based on the scanning parameter configuration data and the circuit board positioning posture data to generate scanning path planning data; Step S15: controlling the X-ray source to scan the high-density interconnection circuit board to be inspected according to the scanning path planning data and the scanning parameter configuration data, and using the detector to receive the X-rays to obtain multi-angle X-ray transmission data; Step S16: performing X-ray signal conversion on the multi-angle X-ray transmission data, and reconstructing the image data to generate original X-ray detection image data.

3. The circuit board production detection method based on machine vision according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: performing virtual slicing processing along a direction perpendicular to the high-density interconnection circuit board to be inspected based on the original X-ray inspection image data to obtain original X-ray image sequence data of the circuit board; Step S22: performing non-local mean filtering to reduce noise on the original X-ray image sequence data of the circuit board to obtain primary noise-reduced image sequence data; Step S23: calculating the distortion parameters of the imaging system according to the pre-shot chessboard calibration plate image to obtain distortion correction parameter data; Step S24: performing image geometric distortion correction on the primary denoised image sequence data using the distortion correction parameter data to obtain geometrically corrected image sequence data; Step S25: performing wavelet transform artifact removal according to the geometrically corrected image sequence data, and performing inverse wavelet transform to reconstruct the image, thereby obtaining pre-processed circuit board inspection image data.

4. The circuit board production detection method based on machine vision according to claim 1 is characterized in that: Step S3 includes the following steps: Step S31: using the preset hole structure element data to perform a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data to obtain Top-Hat transformed image data; Step S32: Calculate the Hessian matrix eigenvalues ​​based on the Top-Hat transformation image data, and determine the hole edge pixel points to obtain the hole edge pixel points and other pixel points respectively; Step S33: setting the maximum grayscale value for the pixel points at the edge of the hole, and keeping the grayscale values ​​of other pixel points unchanged, thereby obtaining hole edge enhanced image data; Step S34: performing image hole structure mask processing on the hole edge enhanced image data to obtain hole structure mask data; Step S35: performing a morphological dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and extracting the image hole area to obtain hole area image data; Step S36: Perform hole feature analysis on the hole area image data to obtain hole feature vector data.

5. The circuit board production detection method based on machine vision according to claim 4 is characterized in that: Step S34 includes the following steps: Step S341: Adaptively binarize and segment the hole edge enhanced image data to obtain binary detection image data; Step S342: performing anisotropic diffusion filtering according to the binary detection image data, and performing sub-pixel edge positioning to generate sub-pixel edge detection data; Step S343: performing a fracture edge hole contour connection process based on the sub-pixel edge detection data to generate initial hole contour data; Step S344: ellipse fitting optimization is performed on the initial hole contour data, and morphological opening operation is performed to obtain the buried hole / blind hole contour data of the circuit board; Step S345: performing image hole structure mask processing according to the buried hole / blind hole contour data of the circuit board to obtain hole structure mask data.

6. The circuit board production detection method based on machine vision according to claim 5 is characterized in that: Step S343 includes the following steps: Performing sub-pixel edge gradient amplitude calculation on sub-pixel edge detection data to generate edge pixel gradient amplitude data; The edge pixel gradient amplitude data is subjected to dual-threshold hysteresis edge connection judgment by a preset high threshold and a preset low threshold, and pixels whose edge pixel gradient amplitude data is greater than the preset high threshold are marked as strong edge point data; pixels whose edge pixel gradient amplitude data is less than the preset low threshold are marked as non-edge point data; pixels whose edge pixel gradient amplitude data is between the preset high threshold and the preset low threshold are marked as weak edge point data; Determine the buried / blind via radius range by monitoring the circuit board parameters and obtain the hole radius range data; Use hole radius range data to perform Hough transform circular detection on sub-pixel edge detection data to generate candidate circular hole data for the circuit board; The candidate circular hole data of the circuit board are mapped to edge points through strong edge point data, non-edge point data and weak edge point data, and the broken edge hole contours are connected to obtain the initial hole contour data.

7. The circuit board production detection method based on machine vision according to claim 4 is characterized in that: Step S36 includes the following steps: Step S361: performing grayscale feature statistics on the hole area image data to obtain hole grayscale feature data; Step S362: performing gray level co-occurrence matrix calculation according to the hole gray level feature data to generate hole texture feature data; Step S363: performing geometric shape feature analysis based on the hole area image data to obtain hole geometric shape feature data; Step S364: integrating the hole grayscale feature data, the hole texture feature data and the hole geometric shape feature data to obtain hole feature vector data.

8. The circuit board production detection method based on machine vision according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: Obtaining circuit board hole image sample data; Step S42: performing feature engineering processing on the circuit board hole image sample data to obtain circuit board hole image sample feature data; wherein the circuit board hole image sample feature data includes hole residual copper sample feature data and hole non-residual copper sample feature data; Step S43: performing feature subset processing on the feature data of the hole residual copper samples and the feature data of the hole non-residual copper samples, so as to obtain a model training feature set and a model verification feature set; Step S44: performing classifier model training on a preset support vector machine model based on the model training feature set, thereby obtaining an initial residual copper recognition model; Step S45: verifying the initial residual copper recognition model through the model verification feature set, and optimizing the hyperparameters through the genetic algorithm to obtain the residual copper feature recognition model; Step S46: using the residual copper feature recognition model to perform residual copper detection on the hole feature vector data to generate residual copper probability prediction data; Step S47: positioning the residual copper area of ​​the hole structure mask data by using the residual copper probability prediction data, and post-processing the detection result according to the pre-processed circuit board detection image data, so as to obtain the residual copper detection result data.

9. A circuit board production inspection system based on machine vision, characterized in that: Used to perform the circuit board production inspection method based on machine vision as claimed in claim 1, the circuit board production inspection system based on machine vision comprises: The circuit board visual acquisition module is used to extract circuit board parameters of the high-density interconnected circuit board to be inspected and obtain monitoring circuit board parameters; the visual sensor is used to scan the high-density interconnected circuit board to be inspected and generate original X-ray detection image data; An image preprocessing module is used to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnection circuit board to be detected, so as to obtain original X-ray image sequence data of the circuit board; perform image preprocessing on the original X-ray image sequence data of the circuit board, so as to obtain preprocessed circuit board detection image data; The hole feature analysis module is used to perform image hole structure mask processing on the pre-processed circuit board inspection image data to obtain hole structure mask data; perform morphological expansion operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole area extraction to obtain hole area image data; perform hole feature analysis on the hole area image data to obtain hole feature vector data; The circuit board residual copper detection module is used to obtain circuit board hole image sample data; train the residual copper classification model according to the circuit board hole image sample data, so as to build a residual copper feature recognition model; use the residual copper feature recognition model to perform residual copper detection on the hole feature vector data, and locate the residual copper area on the hole structure mask data, so as to obtain the residual copper detection result data.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed, the circuit board production detection method based on machine vision as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Power battery welding quality detection method

    CN107093175A

  • Retina image enhancement method

    CN107220948A

  • Sub-pixel-level PCB board defect reference point detection method

    CN108830838A

  • Hole defect quantitative detection method based on microscopic CT (Computed Tomography)

    CN114519697A

  • PCB (Printed Circuit Board) hole offset anomaly detection method based on linear gray enhancement

    CN115345883A

Cited By

  • Detection device for wear of subway power supply contact network cable

    CN120507360A

  • Vehicle air window defrosting and demisting system detection method

    CN120726115A

  • X-ray-based PCB blind hole defect detection method

    CN121120594A

  • An X-ray-based method for detecting blind via defects in PCB boards

    CN121120594B

  • Method and system for judging corrosion condition of electrode foil

    CN121329920A