Circuit board production detection method, system and medium based on machine vision
Through machine vision-based X-ray imaging and image processing technology, the problem of residual copper detection inside HDI boards has been solved, a non-destructive and accurate detection method has been realized, the detection efficiency and accuracy have been improved, and the production process has been optimized.
Patent Information
- Application Number
- CN202411752439.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Traditional inspection methods have difficulty effectively identifying residual copper defects in buried and blind vias inside high-density interconnect (HDI) boards. Physical inspection can easily damage the circuits, and optical inspection cannot penetrate the internal structure.
A machine vision-based method is adopted to obtain the internal structure using X-ray imaging, which is converted into a two-dimensional image sequence through virtual slicing. Combined with image preprocessing, pore structure mask processing and morphological operations, a residual copper feature recognition model is constructed to achieve non-destructive testing.
It achieves high-precision automatic identification and positioning of residual copper defects inside HDI boards, improves detection accuracy and efficiency, reduces the risk of manual misjudgment, optimizes production processes, reduces defects, and improves overall yield and reliability.
Smart Images

Figure CN119715630B_ABST
Abstract
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] High-density interconnect (HDI) boards, as high-performance, high-density printed circuit boards, are widely used in smartphones, tablets, wearable devices, automotive electronics, and other fields due to their advantages such as lightness, thinness, and dense functionality. HDI boards typically utilize multi-layer interconnect structures such as buried and blind vias to achieve higher wiring density and more complex electrical performance. Residual copper refers to excess copper remaining on the inner walls or bottoms of buried or blind vias during the circuit board manufacturing process due to factors such as incomplete drilling, uneven electroless copper plating, or defects in the electroplating process. This residual copper can lead to electrical performance degradation, such as short circuits, signal interference, and unstable conduction, thus affecting the overall performance of the HDI board and even causing product failure. Traditional circuit board inspection methods mainly include probe testing and optical inspection. While probe testing can provide a simple verification of the circuit board's electrical performance, it is difficult to effectively identify residual copper within the internal structures of buried and blind vias. Furthermore, probe testing requires physical contact, which can easily damage the delicate circuitry of the HDI board, leading to misjudgments and even direct board failure, resulting in significant financial losses for manufacturers. Optical inspection 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 interior of the circuit board, it cannot detect buried 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 inspection method, system and medium based on machine vision to solve at least one of the above technical problems.
[0004] To achieve the above objectives, a circuit board production inspection method based on machine vision includes the following steps:
[0005] Step S1: extracting circuit board parameters from the high-density interconnected circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnected circuit board to be inspected using a visual sensor to generate original X-ray inspection image data;
[0006] Step S2: performing virtual slicing processing on the original X-ray inspection image data along a direction perpendicular to the high-density interconnection circuit board to be inspected to obtain a sequence of original X-ray image 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 inspection 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 a morphological dilation operation on the pre-processed circuit board inspection image data using 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 circuit board hole image; train a residual copper classification model based on the circuit board hole image sample data 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] This method utilizes the strong penetrating power of X-rays to obtain clear images of the internal structure of HDI boards. Using virtual slicing technology, the three-dimensional structure is converted into a two-dimensional image sequence, enabling intuitive visualization of residual copper defects in internal structures such as buried and blind vias, avoiding damage caused by physical contact and achieving true nondestructive testing. Image preprocessing techniques effectively suppress noise interference, improve image quality, and lay the foundation for subsequent feature extraction and analysis. Then, using image hole structure masking and morphological dilation operations, the hole region is precisely extracted. Combined with hole feature analysis, feature vector data is constructed to accurately identify residual copper defects. Finally, using a residual copper feature recognition model, intelligent analysis of the hole feature vector data is performed to achieve automatic identification and location of residual copper defects, significantly improving detection accuracy and efficiency, reducing the risk of manual misjudgment, and shortening the production cycle. Through feature analysis of the hole region image data, multiple characteristic parameters related to residual copper defects, such as residual copper area, shape, and location, are extracted and corresponding feature vector data is constructed. These quantitative indicators can objectively reflect the severity of residual copper defects, providing a scientific basis for quality control in the production process. Furthermore, residual copper detection, based on a residual copper feature recognition model, can precisely locate residual copper areas, providing guidance for subsequent repair or scrapping, thus avoiding unnecessary resource waste. Early detection and removal of HDI boards with residual copper defects effectively prevents functional failures and product scrap during subsequent assembly, reducing repair and after-sales service costs. Furthermore, accurate residual copper detection can guide production process improvements, optimize production processes, reduce defects, and thus improve the overall yield and reliability of HDI boards.
[0010] Therefore, the present invention's machine vision-based circuit board production inspection method utilizes high-precision X-ray imaging to capture internal images of the circuit board. Virtual slicing processes convert the three-dimensional images into a two-dimensional image sequence, with image preprocessing ensuring image quality. Hole regions are precisely extracted through hole structure masking and morphological operations. Feature analysis is then performed on these regions to construct feature vectors. These feature vectors are analyzed using a machine learning model to automatically detect defects such as residual copper, achieving high-precision inspection of the internal structure of high-density interconnected circuit boards.
[0011] Preferably, step S1 includes the following steps:
[0012] Step S11: extracting circuit board parameters from the high-density interconnect 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 interconnected circuit board to be inspected, and adjusting the circuit board posture to obtain 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 interconnected 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 interconnected 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] By extracting circuit board parameters and automatically identifying positioning feature points, this method achieves precise positioning and posture adjustment of circuit boards, avoiding the errors and inefficiencies associated with manual operation. Furthermore, based on a preset scanning database and circuit board parameters, it enables intelligent configuration of scanning parameters, automatically adjusting scanning parameters for different circuit board types without manual intervention, improving detection flexibility and efficiency. Multi-angle scanning path planning enables acquisition of transmission images of HDI boards from different angles, effectively avoiding missed detections and false detections caused by complex internal structures or defect obstructions. Compared to traditional single-angle scanning, multi-angle scanning provides a more comprehensive picture of the circuit board's internal structure, improving the reliability of defect detection. Precise scanning parameter configuration and circuit board positioning ensure the optimal relative position between the X-ray source and detector, thereby obtaining high-quality X-ray transmission data. Multi-angle scanning also overcomes the shortcomings of single-angle scanning, acquiring more comprehensive information and helping to improve the accuracy and reliability of image reconstruction. This method can adapt to the inspection needs of HDI boards of different types and specifications, requiring only updating the scanning database and adjusting the corresponding parameters.
[0019] Preferably, step S2 includes 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 based on the pre-shot checkerboard calibration plate image to obtain distortion correction parameter data;
[0023] Step S24: performing image geometric distortion correction on the initial 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 based on 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 solution uses 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 to 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 solution 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 through wavelet decomposition. The frequency components where the artifacts are located are identified and suppressed, and then the image is reconstructed using the inverse wavelet transform, thereby obtaining pre-processed circuit board detection image data with fewer artifacts and clearer details.
[0026] Preferably, step S3 includes the following steps:
[0027] Step S31: performing a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data using the preset hole structure element data to obtain Top-Hat transformed image data;
[0028] Step S32: Calculate the Hessian matrix eigenvalues based on the Top-Hat transformed 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 using the hole structure mask data, and extracting the image hole region to obtain hole region 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 uses a multi-scale Top-Hat transform to effectively extract minute details and contrast differences in an image, thereby enhancing the response of hole edges and making them more prominent in the image. Then, based on the Top-Hat transformed image data, the Hessian matrix eigenvalues are calculated, and the hole edge pixel points are determined to further accurately locate the hole edge. The maximum grayscale value of the hole edge pixel points is set, thereby obtaining hole edge enhanced image data with sharp and clear hole edges. By performing image hole structure mask processing on the hole edge enhanced image data, hole structure mask data is obtained, which can accurately identify the location and shape of the hole. Then, using the hole structure mask data, a morphological dilation operation is performed on the pre-processed circuit board inspection image data, effectively separating the hole area from the background, and performing image hole area extraction to obtain hole area image data containing only hole information. This segmentation method based on the hole structure mask avoids the over-segmentation or under-segmentation problems that are prone to occur in traditional segmentation methods, improving 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 hole shape, size, position and texture information, such as hole area, perimeter, 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: performing adaptive binary segmentation on the hole edge enhanced image data to obtain binary detection image data;
[0036] Step S342: performing anisotropic diffusion filtering on the binarized 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: performing ellipse fitting optimization on the initial hole contour data and performing morphological opening operation to obtain the buried / blind via contour data of the circuit board;
[0039] Step S345: performing image hole structure mask processing according to the buried / 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 hole, 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] A dual-threshold hysteresis edge connection judgment is performed on the edge pixel gradient amplitude data using 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; and 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 circuit board parameters and obtain hole radius range data;
[0045] Use the hole radius range data to perform Hough transform circular detection on the sub-pixel edge detection data to generate candidate circular hole data for the circuit board;
[0046] Edge point mapping is performed on candidate circular hole data of the circuit board using strong edge point data, non-edge point data and weak edge point data, and broken edge hole contours are connected to obtain initial hole contour data.
[0047] The present invention first calculates the sub-pixel edge gradient amplitude and then uses a dual-threshold hysteresis edge connection method to classify edge pixels into strong edge points, weak edge points, and non-edge points. Strong edge point data ensures the extraction of authentic and reliable edge information, while weak edge point data supplements edge details and improves edge continuity. This dual-threshold hysteresis connection method effectively suppresses the influence of noise and false edges, improving the reliability and accuracy of edge connection. The buried / blind via radius range is determined by monitoring circuit board parameters, generating via radius range data. This via radius range data is then used to perform Hough transform circle detection on the sub-pixel edge detection data. Only circular vias with a radius within a preset range are detected, eliminating interference from other shapes and sizes, improving the accuracy and efficiency of circular via detection, and reducing computational complexity. The strong edge point data, weak edge point data, and non-edge point data obtained through dual-threshold hysteresis edge connection are then used to perform edge point mapping on candidate circular via data on the circuit board, aligning the detected circles with actual edge points. Hole contour connection is then performed on broken edges, connecting edge segments belonging to the same hole to obtain complete initial hole contour data. This method combining circle detection and edge connection can effectively handle the situation of broken hole edges 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 based on the hole gray 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: performing hole feature integration on 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, thereby improving the accuracy and reliability of residual copper defect identification. The presence of residual copper defects will cause the grayscale distribution of the hole area to change, forming a specific texture pattern. The grayscale co-occurrence matrix is an effective texture analysis method that can reflect the spatial correlation of grayscale values in the image, thereby extracting texture features related to residual copper defects. This solution calculates the grayscale co-occurrence matrix based on the hole grayscale feature data, and extracts texture features such as contrast, energy, entropy, and homogeneity, 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 result in a smaller hole area, while uneven residual copper will result in an irregular hole shape. This solution analyzes the geometric features of the hole area image data to extract geometric features such as the hole area, perimeter, roundness, and aspect ratio. This provides an important basis for distinguishing different types of residual copper defects and helps improve the refinement of defect identification. The extracted hole grayscale feature data, hole texture feature data, and hole geometric feature data are integrated to construct a representative hole feature vector.
[0054] Preferably, step S4 includes the following steps:
[0055] Step S41: Obtaining sample data of circuit board hole images;
[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 sample and the feature data of the hole non-residual copper sample to obtain a model training feature set and a model verification feature set;
[0058] Step S44: performing classifier model training on the 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 hyperparameters through a genetic algorithm to obtain a 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 using the residual copper probability prediction data, and performing post-processing on the detection results according to the pre-processed circuit board detection image data, thereby obtaining residual copper detection result data.
[0062] The present invention uses a machine learning method to train a residual copper recognition model using sample data of circuit board hole images, achieving automatic recognition of residual copper defects without manual intervention, greatly improving detection efficiency. At the same time, because the model is trained with a large amount of sample data, it has strong generalization ability and robustness, can effectively avoid manual misjudgment and missed judgment, and improve 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 the grayscale features, texture features, and geometric shape features of the holes. Then, through feature subset processing, the optimal feature combination is selected for model training, avoiding feature redundancy and overfitting problems, and improving the recognition performance and generalization ability of the model. A support vector machine model is selected as the residual copper recognition model, and model training is performed based on the model training feature set to obtain an initial residual copper recognition model. Then, the initial model is verified using the 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, making it adaptable to different types of circuit boards and different residual copper defect morphologies. The trained residual copper feature recognition model is used to detect residual copper on the hole feature vector data, generating residual copper probability prediction data. This residual copper probability prediction data is then used to locate the residual copper area in the hole structure mask data, marking the residual copper defects on the image. Finally, the test results are post-processed based on the pre-processed circuit board inspection image data to obtain the final residual copper detection results and display them in a visual format, allowing operators to intuitively determine the location and severity of residual copper defects and provide guidance for subsequent repair or scrapping.
[0063] Preferably, the present invention further provides a circuit board production inspection system based on machine vision, which executes the circuit board production inspection method based on machine vision as described above. The circuit board production inspection system based on machine vision includes:
[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 configured to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnected circuit board to be detected, thereby obtaining a sequence of original X-ray image data of the circuit board; and perform image preprocessing on the original X-ray image sequence data of the circuit board 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 dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole region extraction to obtain hole region image data; perform hole feature analysis on the hole region 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 a residual copper classification model based on the circuit board hole image sample data 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 to obtain the residual copper detection result data.
[0068] Preferably, a storage medium stores a computer program, and when the computer program is executed, it implements the circuit board production detection method based on machine vision as described in any one of the above. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 This is a schematic flow chart of the steps of the circuit board production inspection 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 purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0073] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. It is obvious that the embodiments described are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of the present invention.
[0074] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor and / or microcontroller approaches.
[0075] It should be understood that although the terms "first," "second," and the like may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used solely to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the scope of the exemplary embodiments. The term "and / or" as 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 from the high-density interconnected circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnected circuit board to be inspected using a visual sensor to generate original X-ray inspection image data;
[0078] Step S2: performing virtual slicing processing on the original X-ray inspection image data along a direction perpendicular to the high-density interconnection circuit board to be inspected to obtain a sequence of original X-ray image 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 inspection 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 a morphological dilation operation on the pre-processed circuit board inspection image data using 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 circuit board hole image; train a residual copper classification model based on the circuit board hole image sample data 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 flow chart showing the steps of a circuit board production inspection method based on machine vision according to the present invention. In this embodiment, the circuit board production inspection method based on machine vision includes the following steps:
[0082] Step S1: extracting circuit board parameters from the high-density interconnected circuit board to be inspected to obtain monitoring circuit board parameters; scanning the high-density interconnected circuit board to be inspected using a visual sensor to generate original X-ray inspection 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 be performed using a variety of methods, such as high-precision scanners, optical measuring instruments, or measurement methods based on image processing. For example, a high-precision scanner is used to scan the HDIPCB, obtain its physical dimensions (length, width, and thickness), and record them, for example, a length of 10 cm, a width of 8 cm, and a thickness of 1.6 mm. Simultaneously, an optical measuring instrument or image processing algorithm is used to measure key parameters of the PCB, such as the number of layers, conductor width, spacing, aperture size, and aperture coordinates. For example, it can be determined that the PCB has 8 layers, the minimum conductor width is 50 μm, the minimum hole spacing is 100 μm, and the aperture range is 0.2 mm to 0.5 mm. 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, appropriate parameters such as X-ray energy and exposure time need to be set based on the PCB material, thickness, and inspection requirements. For example, for thicker PCBs, higher X-ray energy is required to ensure sufficient penetration. After the scan is completed, the generated raw X-ray inspection image data is saved, for example, as a series of grayscale images, where the grayscale value of each pixel represents the degree of X-ray attenuation.
[0084] Step S2: performing virtual slicing processing on the original X-ray inspection image data along a direction perpendicular to the high-density interconnection circuit board to be inspected to obtain a sequence of original X-ray image 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 inspection 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 image representing the structural information of the PCB at different depths. This process is similar to a medical CT scan, 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 methods such as Gaussian filtering and median filtering to remove noise from the image. For example, a 3x3 median filter can be used to remove salt and pepper noise. 2. Image enhancement: Use methods such as histogram equalization and contrast stretching to enhance image contrast and make structures such as holes and wires clearer. For example, histogram equalization can be used to evenly distribute the grayscale values in the image. 3. Geometric distortion correction: Use pre-captured calibration plate images to calculate the distortion parameters of the imaging system, then correct the original image to eliminate the effects of geometric distortion. For example, a checkerboard calibration plate can be used to calculate radial and tangential distortion parameters and then 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 a morphological dilation operation on the pre-processed circuit board inspection image data using 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. The specific operation is, for example: using the threshold segmentation method, setting the pixels in the image whose grayscale value is lower than a certain threshold to 1 (representing the hole), and setting the remaining pixels 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. An edge detection algorithm, such as the Canny operator, can also be used to extract the edge of the hole and then fill the internal area of the edge to form a hole structure mask. Then, a morphological dilation operation is performed on the pre-processed circuit board inspection image data using the hole structure mask data. The purpose of the dilation operation is to expand the hole area so as to include the pixels around the hole edge. For example, a 3×3 square structure element can be used to perform the 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 with the pre-processed image data to obtain the hole area image data. This step is equivalent to cropping the hole region from the original image, retaining only the hole information. Finally, the hole region image data is subjected to hole feature analysis. For each hole region, its features are extracted, such as area, perimeter, circularity, aspect ratio, grayscale mean, and grayscale variance. 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, circularity, aspect ratio, grayscale mean, grayscale variance].
[0088] Step S4: Obtain sample data of the circuit board hole image; train a residual copper classification model based on the circuit board hole image sample data 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, 1,000 hole images with residual copper and 1,000 hole images without residual copper are collected and annotated. Then, feature engineering processing is performed on the sample data of hole images of the circuit board. Features are extracted from 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 hole residual copper and sample feature data of hole non-residual copper. Then, the sample feature data of hole residual copper and the sample feature data of hole non-residual copper are divided into a training set and a test set, for example, in a ratio of 8:2. The classifier model is trained on the preset support vector machine model based on the model training feature set. For example, a two-classification model is trained using the SVM algorithm to divide the holes into two categories: those with residual copper and those without 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 training is completed, an initial residual copper recognition model is obtained. Next, the initial residual copper recognition model is verified using a model verification feature set, and hyperparameter optimization is performed using a genetic algorithm. The performance of the model is evaluated using a test set, such as calculating indicators such as accuracy, recall rate, and F1 value. Optimization algorithms such as genetic algorithms can be used to fine-tune the model parameters 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. The residual copper area is located on the hole structure mask data. Based on the residual copper probability, holes with a probability exceeding a certain threshold are marked as residual copper holes, and the corresponding positions are marked in the hole structure mask data, thereby obtaining residual copper detection result data, including the location and probability information of the residual copper holes. The detection results can be post-processed based on the pre-processed circuit board detection image data, such as removing falsely detected residual copper areas or performing a more detailed analysis of the residual copper areas.
[0090] As an example of the present invention, refer to Figure 2 As shown, Figure 1 Detailed implementation steps of step S1 are shown in the flowchart. In this example, step S1 includes:
[0091] Step S11: extracting circuit board parameters from the high-density interconnect circuit board to be detected to obtain monitoring circuit board parameters;
[0092] In an embodiment of the present invention, high-precision measuring equipment is used, such as a laser scanner or a high-resolution camera combined with an image processing algorithm, to accurately measure the key parameters of an HDI PCB. These parameters include the physical dimensions (length, width, thickness) of the PCB, the number of layers, the conductor width, the spacing, the aperture size, the aperture coordinates, and the location of special marking points. 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 HDI PCB with a size of 100mm×80mm×1.6mm, the measurement results show that its length is 100.2mm, the width is 79.8mm, the thickness is 1.62mm, the minimum conductor 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, with coordinates of (5,5), (5,75), (95,5), and (95,75) (unit: mm), forming the monitoring circuit board parameters.
[0093] Step S12: using a visual sensor to identify the circuit board positioning feature points of the high-density interconnected circuit board to be inspected, and adjusting the circuit board posture to obtain circuit board positioning posture data;
[0094] In an embodiment of the present invention, a camera first captures an image of a PCB. An image processing algorithm then analyzes the captured image to identify pre-defined circuit board positioning feature points. These feature points can include specific markings on the PCB, hole centers, edge corners, and so on. For example, a circular feature point detection algorithm can be used to identify the four circular positioning markers mentioned in step S11. The recognition process includes image preprocessing (such as filtering and binarization), feature point extraction, and matching. After identifying the feature points, the actual position and posture of the PCB are calculated based on their positions in the image. This posture information includes the PCB's planar rotation angle and spatial tilt angle. For example, by identifying the image coordinates of the four positioning markers and combining them with the actual coordinates obtained in step S11, the PCB's rotation angle and offset can be calculated using a perspective transformation or an affine transformation. The calculated posture information is used to control a robotic arm or adjust the platform to adjust the PCB's posture to align it with the predetermined scanning position and angle. After the adjustment is complete, the PCB's posture is reconfirmed using a visual sensor to ensure 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, the scanning database stores scanning parameters for HDIPCBs of different types and specifications, 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, the X-ray voltage and current need to be increased to improve penetration; for thinner PCBs, the voltage and current can be appropriately reduced to reduce radiation damage. In cases where tiny defects need to be detected, the scanning spacing and exposure time need to be reduced to improve image resolution. The scanning parameter reading process is as follows: First, based on the monitoring circuit board parameters extracted in step S11 (such as the size, number of layers, material, etc. of the PCB), matching scanning parameter records are retrieved from 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 interconnected 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 based on the PCB size information obtained in step S11 to prevent the scanning area from exceeding the PCB boundary. The scanning path is adjusted based on the PCB posture data obtained in step S12 so that the scanning plane is always perpendicular to the PCB surface. The starting and ending angles of the scan are determined based on the scanning angle range obtained in step S13. The angle increment for each scan is determined based on the scanning spacing obtained in step S13. When planning the scanning path, collision detection is required to prevent the X-ray source and detector from colliding with the PCB or other equipment. For example, for an HDI PCB with a plane size of 100 mm × 80 mm and a posture angle of (0, 0, 10°), the scanning angle range is -30° to +30°, and the scanning spacing is 0.5°. The scanning path planning process is as follows: First, the center point and boundary of the scanning area are determined based on the center position and size of the PCB. Then, based on the posture angle of the PCB, the position and direction of the X-ray source and detector at each scanning angle are calculated so that the scanning plane is always perpendicular to the PCB surface. Next, a series of scan angles are generated based on the scan angle range and scan spacing, such as -30°, -29.5°, -29°, ..., 29.5°, and 30°. Finally, the position and orientation information of the X-ray source and detector corresponding to each scan angle, as well as the scan parameter configuration data, are combined into scan path planning data.
[0099] Step S15: controlling the X-ray source to scan the high-density interconnected 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 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, the angles of the X-ray source and detector are gradually adjusted according to the angle sequence in the scanning path planning data, 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 it, and performs analog-to-digital conversion to obtain digitized 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 scan is completed, a series of X-ray transmission data at different angles will be obtained. These data contain 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 noise and nonlinear response of the detector itself and correct image distortion. Then, based on the position information of the X-ray source and detector corresponding to each scanning angle in the scan path planning data, an 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 and reconstruct three-dimensional image data of the internal structure of the PCB. The reconstruction process essentially solves a large system of linear equations, and the X-ray absorption coefficient of each voxel within the PCB is calculated through inversion. For example, a PCB measuring 100 mm × 80 mm × 1.6 mm can be discretized into a grid of 1000 × 800 × 160 voxels. The reconstruction algorithm calculates the X-ray absorption coefficient of each voxel, thereby obtaining the three-dimensional density distribution within the PCB.
[0103] Preferably, step S2 includes 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 based on the pre-shot checkerboard calibration plate image to obtain distortion correction parameter data;
[0107] Step S24: performing image geometric distortion correction on the initial 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 based on 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 one 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, i.e., the Z-axis, is determined. Then, a series of parallel planes are selected along the Z-axis at regular intervals (e.g., 0.1 mm). On each plane, two-dimensional image data for that plane is extracted from the original three-dimensional X-ray data through interpolation or other data extraction methods. For example, if a 1.6 mm thick HDI PCB is sliced at 0.1 mm intervals, 16 two-dimensional X-ray images will be obtained. These images are arranged sequentially to form a sequence of raw X-ray image data of the circuit board, with each image representing the internal structural information of the PCB at that depth. For each image in the sequence, a search window is selected with a pixel as the center. Within the search window, the similarity weight between the neighborhood of the central pixel and the neighborhoods 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 de-noised grayscale value of the central pixel. 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 the other 3×3 neighborhoods within the search window and performs a weighted average based on the similarities to produce the initial denoised image sequence data. An X-ray imaging system is used to capture an image of a checkerboard calibration plate. The checkerboard calibration plate has a regular grid structure with known corner coordinates. A corner detection algorithm is then used to extract the pixel coordinates of the corner points in the calibration plate image. Distortion models, such as radial and tangential distortion models, are then established based on the actual coordinates and pixel coordinates of the calibration plate corner points. Finally, optimization algorithms, such as the least squares method, are used to solve the distortion model parameters, resulting in distortion correction parameter data, including the camera intrinsic parameter matrix and distortion coefficients. For example, radial distortion coefficients k1, k2, and k3, and tangential distortion coefficients p1 and p2, are used. For each image in the initial denoised image sequence, the algorithm iterates over every pixel in the image. Based on the pixel coordinates and distortion correction parameter data, the corresponding undistorted image coordinates of the pixel are calculated. Then, using an interpolation algorithm, such as bilinear interpolation or bicubic interpolation, the corresponding grayscale value in the primary denoised image is obtained based on the undistorted image coordinates. This grayscale value is then 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 based on the distortion coefficient, and the grayscale value at that ideal position is then obtained through interpolation. Geometric distortion correction is performed on all pixels in the image sequence to obtain a geometrically corrected image sequence. Multi-level wavelet decomposition is then performed on each image in the geometrically corrected image sequence, decomposing the image into subband images of different frequencies. Thresholding is then applied to the high-frequency subband images to remove or attenuate the high-frequency components corresponding to artifacts. The threshold selection needs to be adjusted based on the artifact intensity and the image noise level. The processed subband images are then used to perform an inverse wavelet transform to reconstruct the image.For example, you can use the db4 wavelet to perform a three-level decomposition, perform soft thresholding on the high-frequency subband coefficients, and then perform an inverse transform. Wavelet transform artifact removal can effectively suppress artifacts such as streaks and ringing in the image, resulting in clear pre-processed circuit board inspection image data.
[0110] Preferably, step S3 includes the following steps:
[0111] Step S31: performing a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data using the preset hole structure element data to obtain Top-Hat transformed image data;
[0112] Step S32: Calculate the Hessian matrix eigenvalues based on the Top-Hat transformed 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 using the hole structure mask data, and extracting the image hole region to obtain hole region 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 a Top-Hat transform on the preprocessed image. Top-Hat transform includes white top-hat transform (extracting bright details) and black top-hat transform (extracting dark details). The appropriate transform type is selected according to the actual situation. Finally, multiple Top-Hat transform results are fused by weighted averaging or taking the maximum value to obtain Top-Hat transformed image data. For example, for a hole with a diameter of 5 pixels, using circular structure elements with radii of 1, 2, and 3 pixels for white top-hat transform can effectively enhance the brightness of the hole area and suppress background noise. For each pixel in the Top-Hat transformed image, its Hessian matrix is calculated. The calculation of the Hessian matrix involves calculating the second-order partial derivatives of the image, and methods such as the Sobel operator or the second-order derivative of 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 hole-edge pixels, one eigenvalue is larger, while the other is smaller, with opposite signs. Based on the magnitude 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 a hole-edge pixel; otherwise, it is considered another pixel. Iterate through all pixels in the image to obtain the set of hole-edge pixels and the set of other pixels. Determine the maximum grayscale value of the image, such as 255 (for an 8-bit image). Then, iterate through all pixels in the image. If the pixel belongs to the hole-edge pixel set, its grayscale value is set to the maximum value, such as 255. If the pixel belongs to another set, its grayscale value remains unchanged. For example, for a hole-edge pixel with a grayscale value of 100, its grayscale value is set to 255; for a non-hole-edge pixel with a grayscale value of 150, its grayscale value remains at 150. By processing all pixels, hole edge enhanced image data is obtained, in which the hole edges are highlighted while other areas retain the original grayscale information. The hole edge enhanced image data is binarized to convert the image into black and white. The choice of binarization threshold can be adjusted according to the grayscale distribution of the image, for example, the Otsu threshold or adaptive threshold can be selected. Pixels above the threshold (hole edges) are set to white (usually represented as 1), and pixels below the threshold are set to black (usually represented as 0). Then, morphological processing is performed on the binary image, such as opening operation (erode first and then expand) or closing operation (expand first and then erode), to remove small noise points and fill the voids 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, where the white area represents holes and the black area represents non-holes. 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 values within 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, a logical AND operation is performed on the expanded hole structure mask data and the pre-processed circuit board inspection image data. The result of the logical AND operation is that only 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 values of the hole region in the preprocessed image are between 50 and 100, while the grayscale values of the background are between 150 and 200, after a logical AND operation, only pixels with grayscale values between 50 and 100, i.e., those in the hole region, are retained, yielding the hole region image data. For each hole region, a series of eigenvalues are calculated and combined into a feature vector. For example, a circular hole has a roundness close to 1 and an aspect ratio close to 1; an elliptical hole has a roundness less than 1 and an aspect ratio greater than 1. A hole with residual copper will have a higher grayscale mean than a normal hole. By calculating these eigenvalues, a feature vector for each hole can be obtained. For example, the feature vector for a hole is (100, 35, 0.95, 1.02, 50, 60, 80), representing the area, perimeter, roundness, aspect ratio, centroid x-coordinate, centroid y-coordinate, and grayscale mean, respectively. 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: performing adaptive binary segmentation on the hole edge enhanced image data to obtain binary detection image data;
[0120] Step S342: performing anisotropic diffusion filtering on the binarized 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: performing ellipse fitting optimization on the initial hole contour data and performing morphological opening operation to obtain the buried / blind via contour data of the circuit board;
[0123] Step S345: performing image hole structure mask processing according to the buried / 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 segment the image into multiple overlapping or non-overlapping areas. Then, a threshold is calculated for each area. For example, the average grayscale value, median grayscale value, or weighted average grayscale value of the local area can be used as the threshold. Finally, each area is binarized according to the calculated threshold, and pixels with grayscale values greater than the threshold are set to white (for example, pixel value 255), and pixels with grayscale values less than the threshold are set to black (for example, pixel value 0). For example, for a local area, if its average grayscale value is 150, then the pixel grayscale values within 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 changes, 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 impact 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 smaller in edge regions, preserving edges; it is larger in flat regions, smoothing noise. Sub-pixel edge location is then performed on the smoothed image. Sub-pixel edge location can accurately locate edges to sub-pixel levels, for example, down to 0.1 or 0.01 pixels. Common sub-pixel edge location methods include interpolation and fitting. For example, the Zernike moment method can be used for sub-pixel edge location. Ultimately, sub-pixel edge detection data is generated, containing precise location information of the hole edge with higher than pixel-level accuracy. Based on this sub-pixel edge detection data, the pixel or sub-pixel points at the hole edge are extracted. The connectivity of the edge points is then analyzed, for example, using an 8-neighborhood or 4-neighborhood connection criterion to connect adjacent edge points into line segments. For broken edges, edge connection algorithms, such as the Hough transform or distance-based connection algorithms, can be used to connect the broken edges and form a closed hole outline. 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-fit 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 an expansion 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 / 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, based on the buried / blind via outline data of the PCB, set the pixel values inside the hole outline to 1. For example, you can use a polygon fill algorithm or a scanline fill algorithm to fill the pixels inside the hole outline with 1. Ultimately, 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] A dual-threshold hysteresis edge connection judgment is performed on the edge pixel gradient amplitude data using 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; and 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 circuit board parameters and obtain hole radius range data;
[0129] Use the hole radius range data to perform Hough transform circular detection on the sub-pixel edge detection data to generate candidate circular hole data for the circuit board;
[0130] Edge point mapping is performed on candidate circular hole data of the circuit board using strong edge point data, non-edge point data and weak edge point data, and broken edge hole contours are connected to obtain 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 gradient in the x-direction and the gradient in the y-direction. 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 gradient in the x-direction is Gx and its gradient in the y-direction 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 circuit board design parameters specify a hole diameter of 0.2mm±0.01mm and the imaging system's pixel resolution is 0.005mm / pixel, the hole radius range is (0.095 / 0.005) to (0.105 / 0.005) pixels, or 19 to 21 pixels. This range, used as the hole radius range data, is used to constrain the Hough transform search space. Based on the hole radius range data, the Hough transform radius parameters are set. The Hough transform is then performed on the sub-pixel edge detection data. The Hough transform maps edge points in image space to curves in parameter space. By counting the intersections of these curves in parameter space, circles can be detected. Based on the hole radius range data, performing the Hough transform only within the specified radius range improves detection efficiency and reduces false detections. For example, if the hole radius range is set to 19 to 21 pixels, the Hough transform will only search within the parameter space of circles with radii of 19, 20, and 21. The detected circle parameters (center coordinates and radius) are the candidate circular hole data for the circuit board. The candidate circular hole data of the circuit board is mapped back to the image space to obtain the outline of the candidate circle. Then, check whether the pixels on the candidate circle outline are strong edge points. If most of the pixels on the candidate circle outline 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 based on the hole gray 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: performing hole feature integration on 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 area, 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 area, the variance reflects the discreteness 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 area indicates that there are defects such as residual copper inside the hole. The multiple grayscale eigenvalues obtained by calculation are combined into a vector, which is the hole grayscale feature data. Based on the hole area image data, the grayscale co-occurrence matrix (GLCM) is calculated. GLCM describes the spatial relationship between different grayscale pixels in the image. Appropriate distance and direction parameters are selected, 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 image's grayscale distribution, contrast reflects image clarity, correlation reflects the degree of correlation between local grayscale values, inverse moment reflects local variations in image texture, and entropy reflects image complexity. The multiple texture feature values calculated are combined into a vector, which becomes the hole texture feature data. For example, a low contrast in a hole region indicates a relatively uniform texture within the hole. Various geometric shape features are calculated, such as area, perimeter, roundness, aspect ratio, eccentricity, and Hu moments. Area represents the number of pixels in the hole region, perimeter represents the length of the hole's outline, roundness indicates the degree of resemblance to a circle, aspect ratio represents the ratio of the hole's length to its width, and eccentricity indicates the degree of elliptical shape. Hu moments are invariant moments that describe the shape of a hole and are unaffected by rotation, translation, and scaling. For example, a roundness close to 1 indicates a hole that is nearly circular, while an aspect ratio much greater than 1 indicates an elongated shape. The multiple geometric shape feature values calculated are combined into a vector, which becomes the hole geometric feature data. The hole grayscale feature data, hole texture feature data, and hole geometry feature data are concatenated 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 are shown in the flowchart. In this example, step S4 includes:
[0139] Step S41: Obtaining sample data of circuit board hole images;
[0140] In an embodiment of the present invention, sample data is obtained through a variety of channels: 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 obtain 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 under different process conditions. For example, 1,000 hole images with residual copper and 1,000 hole images without residual copper are collected and marked 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 deep learning models are used to extract features. The extracted features are processed, for example, using dimensionality reduction methods such as PCA and LDA, or performing feature selection to reduce feature dimensions and improve model efficiency. The resulting circuit board hole image sample feature data includes hole residual copper sample feature data and hole non-residual copper sample feature data, corresponding to hole image samples with 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 sample and the feature data of the hole non-residual copper sample to obtain a model training feature set and a model verification feature set;
[0144] In an embodiment of the present invention, the feature data of the hole copper residue sample and the feature data of the hole non-copper residue sample obtained in step S42 are divided into a model training feature set and a model validation feature set according to a certain ratio. For example, the division can be 8:2, with 80% of the samples used for training and 20% of the samples used for validation. When dividing, care should be taken to maintain a balanced ratio of positive and negative samples to avoid model bias. 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 validation set contains 160 positive samples and 160 negative samples.
[0145] Step S44: performing classifier model training on the 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. The model training feature set obtained in step S43 is used to train an SVM classifier. SVM is a commonly used binary classification algorithm whose 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 hyperparameters through a genetic algorithm to obtain a residual copper feature recognition model;
[0148] In this embodiment of the present invention, the initial residual copper recognition model obtained in step S44 is verified, and its performance metrics, such as accuracy, recall, and F1 value, 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. Genetic algorithms simulate natural selection and heredity mechanisms to search for the optimal hyperparameter combination. For example, the genetic algorithm search ultimately determined the RBF kernel function parameters gamma = 0.1 and the penalty parameter C = 10, resulting in the final residual copper feature recognition model.
[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 this 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. The model outputs a probability value for the presence of residual copper in each hole, generating residual copper probability prediction data. A higher probability value indicates a greater likelihood of residual copper in the hole. For example, a residual copper probability of 0.9 for a hole indicates the presence of residual copper in the hole.
[0151] Step S47: positioning the residual copper area of the hole structure mask data using the residual copper probability prediction data, and performing post-processing on the detection results according to the pre-processed circuit board detection image data, thereby obtaining 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, based on 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 inspection system based on machine vision, which executes the circuit board production inspection method based on machine vision as described above. The circuit board production inspection system based on machine vision includes:
[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 configured to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnected circuit board to be detected, thereby obtaining a sequence of original X-ray image data of the circuit board; and perform image preprocessing on the original X-ray image sequence data of the circuit board 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 dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole region extraction to obtain hole region image data; perform hole feature analysis on the hole region 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 a residual copper classification model based on the circuit board hole image sample data 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 to obtain the residual copper detection result data.
[0158] Preferably, a storage medium stores a computer program, and when the computer program is executed, it implements the circuit board production detection method based on machine vision as described in any one of the above.
[0159] The present application is to utilize the strong penetrability of X-rays and combine 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. Using image hole structure mask processing and morphological expansion operation, the hole area is accurately extracted, and combined with hole feature analysis, feature vector data that can accurately identify residual copper defects is constructed. By constructing a residual copper feature recognition model, intelligent analysis of hole feature vector data is realized, the accuracy and efficiency of detection are improved, the risk of manual misjudgment is reduced, and the production cycle is shortened. Through feature analysis of the hole area image data, multiple feature parameters related to residual copper defects are extracted and corresponding feature vector data are constructed. These quantitative indicators can objectively reflect the severity of residual copper defects and provide a scientific basis for 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 rework or scrapping, and avoid unnecessary waste of resources. By early detecting and eliminating HDI boards with residual copper defects, functional failures and product scrapping during subsequent assembly processes can be effectively avoided, reducing repair and after-sales service costs. Accurate residual copper detection can guide production process improvements, optimize production processes, reduce defects, and thus improve the overall yield and reliability of HDI boards.
[0160] The present invention is therefore intended to be illustrative and non-restrictive in all respects, with the scope of the invention being defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the application documents are intended to be embraced therein.
[0161] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily 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 is not intended to be limited to the embodiments shown herein, but is to be construed in the widest possible manner consistent with the principles and novel features disclosed 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 interconnected circuit board to be inspected and generate original X-ray inspection image data; Step S2: performing virtual slicing processing on the original X-ray inspection image data along a direction perpendicular to the high-density interconnection circuit board to be inspected to obtain a sequence of original X-ray image 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 inspection 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 dilation 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 region image data to obtain hole feature vector data; wherein step S3 includes: Step S31: performing a multi-scale Top-Hat transformation on the pre-processed circuit board inspection image data using the preset hole structure element data to obtain Top-Hat transformed image data; Step S32: Calculate the Hessian matrix eigenvalues based on the Top-Hat transformed 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 using the hole structure mask data, and extracting the image hole region to obtain hole region image data; Step S36: performing hole feature analysis on the hole region image data to obtain hole feature vector data; wherein step S36 includes: 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 based on 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: performing hole feature integration on the hole grayscale feature data, the hole texture feature data, and the hole geometric shape feature data to obtain hole feature vector data; Step S4: Obtain sample data of the circuit board hole image; train a residual copper classification model based on the circuit board hole image sample data 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.
2. The circuit board production detection method based on machine vision according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: extracting circuit board parameters from the high-density interconnect 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 interconnected circuit board to be inspected, and adjusting the circuit board posture to obtain 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 interconnected 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 interconnected 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 based on the pre-shot checkerboard calibration plate image to obtain distortion correction parameter data; Step S24: performing image geometric distortion correction on the initial denoised image sequence data using the distortion correction parameter data to obtain geometrically corrected image sequence data; Step S25: performing wavelet transform artifact removal based on 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, characterized in that: Step S34 includes the following steps: Step S341: performing adaptive binary segmentation on the hole edge enhanced image data to obtain binary detection image data; Step S342: performing anisotropic diffusion filtering on the binarized 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: performing ellipse fitting optimization on the initial hole contour data and performing morphological opening operation to obtain the buried / blind via contour data of the circuit board; Step S345: performing image hole structure mask processing according to the buried / blind hole contour data of the circuit board to obtain hole structure mask data.
5. The circuit board production detection method based on machine vision according to claim 4, 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; A dual-threshold hysteresis edge connection judgment is performed on the edge pixel gradient amplitude data using 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; and 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 circuit board parameters and obtain hole radius range data; Use the hole radius range data to perform Hough transform circular detection on the sub-pixel edge detection data to generate candidate circular hole data for the circuit board; Edge point mapping is performed on candidate circular hole data of the circuit board using strong edge point data, non-edge point data and weak edge point data, and broken edge hole contours are connected to obtain initial hole contour data.
6. 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 sample data of circuit board hole images; 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 sample and the feature data of the hole non-residual copper sample to obtain a model training feature set and a model verification feature set; Step S44: performing classifier model training on the 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 hyperparameters through a genetic algorithm to obtain a 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 using the residual copper probability prediction data, and performing post-processing on the detection results according to the pre-processed circuit board detection image data, thereby obtaining residual copper detection result data.
7. A circuit board production inspection system based on machine vision, characterized in that: For executing the circuit board production inspection method based on machine vision according to 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 configured to perform virtual slicing processing based on the original X-ray detection image data in a direction perpendicular to the high-density interconnected circuit board to be detected, thereby obtaining a sequence of original X-ray image data of the circuit board; and perform image preprocessing on the original X-ray image sequence data of the circuit board 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 dilation operation on the pre-processed circuit board inspection image data through the hole structure mask data, and perform image hole region extraction to obtain hole region image data; perform hole feature analysis on the hole region 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 a residual copper classification model based on the circuit board hole image sample data 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 to obtain the residual copper detection result data.
8. 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 6 is implemented.
Citation Information
Patent Citations
Power battery welding quality detection method
CN107093175A
Sub-pixel-level PCB board defect reference point detection method
CN108830838A
Hole defect quantitative detection method based on microscopic CT (Computed Tomography)
CN114519697A
Screen printing defect detection method and device based on image analysis
CN115439476A