A visual inspection method, device and system for a PCB copper-inlay structure of a metal hole
By identifying circular regions in PCB images, calculating gray-level co-occurrence matrices and morphological features, and combining gradient analysis, the problem of detection accuracy for copper-embedded metal vias in PCBs was solved, thus improving the effectiveness of visual inspection.
Patent Information
- Application Number
- CN202511902643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-12-17
AI Technical Summary
Defects in PCB metal hole copper embedding structures are highly concealed and cannot be fully detected through functional testing. Inaccurate positioning of the copper embedding holes and scratches on the copper surface affect the accuracy of the inspection, resulting in a reduction in the effectiveness of visual inspection results.
By identifying circular regions in PCB images, calculating gray-level co-occurrence matrices and morphological features, and combining gradient direction and amplitude analysis, the regions with embedded copper metal holes are identified and the confidence level of scratches is evaluated to obtain visual inspection results.
It improves the accuracy of visual inspection of PCB metal hole copper embedding structures, avoids the influence of inaccurate copper hole positioning and scratches, and enhances the effectiveness of inspection results.
Smart Images

Figure CN121353276B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a PCB metal hole copper-embedded structure visual detection method, device and system. BACKGROUND
[0002] PTH metalized holes and copper-embedded structures are the core structures for realizing interlayer electrical interconnection of PCBs, and the quality thereof directly determines the reliability of the circuit board. The defects of the PCB metal hole copper-embedded structure are highly concealed and cannot be completely found through functional testing, but can be found through visual detection, so as to establish an efficient and reliable printed circuit board defect detection system and intercept the defects of the PCB metal hole copper-embedded structure at the source.
[0003] The PCB board is small in size and complex in structure, and different components and copper-embedded holes are distributed at different positions on the PCB surface according to their corresponding functions, which causes inaccurate positioning of the copper-embedded holes and affects the accuracy of visual detection of the metal hole copper-embedded structure. Further, when the copper-embedded structure is rubbed during transportation, micro scratches may appear on the copper surface, affecting the effectiveness of the detection result of the metal hole copper-embedded structure. SUMMARY
[0004] In order to solve the above technical problems, the purpose of the present application is to provide a PCB metal hole copper-embedded structure visual detection method, device and system, and the technical solutions adopted are as follows:
[0005] In a first aspect, the embodiments of the present application provide a PCB metal hole copper-embedded structure visual detection method, which comprises the following steps:
[0006] PCB images of a PCB board to be detected are collected, and all circular regions in the PCB images are recognized;
[0007] A gray level co-occurrence matrix of the circular region in a first preset number of directions is established, morphological processing is performed on the circular region to obtain an expanded region and a corroded region, the copper-embedded hole possibility of the circular region is calculated according to the distribution difference of the gray level co-occurrence matrix of the circular region in all directions and the distribution difference of the gray values in the expanded region and the corroded region, and the copper-embedded metal hole region is recognized according to the copper-embedded hole possibilities of all the circular regions recognized in the PCB images;
[0008] The gradient direction and gradient amplitude of all edge pixel points of the corroded region are calculated, and the scratch confidence of the copper-embedded metal hole region is calculated according to the difference of the gradient direction and the value of the gradient amplitude of all the edge pixel points of the corroded region determined according to the copper-embedded metal hole region;
[0009] The visual detection result of the PCB board to be detected is obtained according to the value of the scratch confidence of all the copper-embedded metal hole regions recognized from the PCB images.
[0010] Further, the process of determining the copper-embedding hole possibility of the circular region is as follows:
[0011] According to the distribution difference of the gray level co-occurrence matrix of the circular region in all directions, the first copper-embedding feature value of the circular region is calculated;
[0012] According to the distribution difference of the gray level values in the dilated region and the eroded region, the second copper-embedding feature value of the circular region is calculated;
[0013] The positive correlation processing result of the first copper-embedding feature value and the second copper-embedding feature value of the circular region is recorded as the copper-embedding hole possibility of the circular region.
[0014] Further, the process of constructing the first copper-embedding feature value of the circular region is as follows:
[0015] The mean value of the second-order entropy and the contrast of the gray level co-occurrence matrix of the circular region in the same direction is recorded as the texture fluctuation degree of the circular region in the same direction;
[0016] The mean value of the texture fluctuation degrees of the circular region in all directions is recorded as the first copper-embedding feature value of the circular region.
[0017] Further, the specific calculation process of the second copper-embedding feature value of the circular region is as follows:
[0018] According to the pixel values of the pixel points contained in the dilated region and the eroded region, the dilated gray sequence and the eroded gray sequence are constructed respectively, and the DTW distance between the dilated gray sequence and the eroded gray sequence is recorded as the second copper-embedding feature value of the circular region.
[0019] Further, the specific process of identifying the copper-embedding metal hole region includes:
[0020] The mean value of the copper-embedding hole possibilities of all the circular regions identified in the PCB image is recorded as the possibility threshold value, and the circular region with a copper-embedding hole possibility greater than the possibility threshold value is recorded as the copper-embedding metal hole region.
[0021] Further, the process of determining the scratch confidence of the copper-embedding metal hole region is as follows:
[0022] According to the gradient direction and the gradient amplitude of all the edge pixel points of the eroded region determined by the copper-embedding metal hole region, the scratch severity of the copper-embedding metal hole region is calculated;
[0023] The normalized value of the cumulative sum of the gradient amplitudes of all the edge pixel points of the eroded region determined by the copper-embedding metal hole region is recorded as the scratch salience of the copper-embedding metal hole region;
[0024] The positive correlation processing result of the scratch severity and the scratch salience of the copper-embedding metal hole region is recorded as the scratch confidence of the copper-embedding metal hole region.
[0025] Further, the specific determination process of the scratch severity of the copper-embedded metal hole region is as follows:
[0026] The value range of the gradient direction is divided into a second preset number of sub-ranges, and the cumulative sum of the product of the gradient direction and the corresponding gradient amplitude of all edge pixels of the determined corrosion region of the copper-embedded metal hole region in the same sub-range is recorded as the scratch energy value of the copper-embedded metal hole region in the same sub-range.
[0027] The normalized value of the cumulative sum of the scratch energy values of the copper-embedded metal hole region in all sub-ranges is recorded as the scratch severity of the copper-embedded metal hole region.
[0028] Further, the specific process of obtaining the visual inspection result of the PCB to be detected according to the values of the scratch confidence of all copper-embedded metal hole regions identified from the PCB image includes:
[0029] The scratch confidence equal to 0 is deleted, and the mean value of the remaining scratch confidence of all copper-embedded metal hole regions identified from the PCB image is recorded as the scratch defect confidence of the PCB image.
[0030] The scratch defect confidence is compared with the preset first defect threshold, second defect threshold and third defect threshold respectively, and the visual inspection result of the PCB to be detected is obtained.
[0031] The visual inspection result includes that the PCB metal hole copper-embedded structure belongs to no defect, slight defect, moderate defect and severe defect.
[0032] In a second aspect, the embodiments of the present application provide a PCB metal hole copper-embedded structure visual inspection device, which includes a circular region detection module, a copper-embedded metal hole region identification module, a scratch confidence calculation module and a visual inspection result acquisition module.
[0033] The circular region detection module is used to collect the PCB image of the PCB to be detected and identify all circular regions in the PCB image.
[0034] The copper-embedded metal hole region identification module is used to establish the gray level co-occurrence matrix of the circular region in a first preset number of directions, perform morphological processing on the circular region, obtain the inflation region and the corrosion region, calculate the copper hole possibility of the circular region according to the distribution difference of the gray level co-occurrence matrix of the circular region in all directions and the distribution difference of the gray level values in the inflation region and the corrosion region, and identify the copper-embedded metal hole region according to the copper hole possibilities of all circular regions identified in the PCB image.
[0035] a scratch confidence calculation module configured to calculate gradient directions and gradient amplitudes of all edge pixel points of the corrosion area, and calculate a scratch confidence of the copper-embedded metal hole area according to differences in the gradient directions and values of the gradient amplitudes of all edge pixel points of the corrosion area determined according to the copper-embedded metal hole area;
[0036] a visual detection result acquisition module configured to acquire a visual detection result of the PCB to be detected according to values of the scratch confidence of all copper-embedded metal hole areas identified from the PCB image.
[0037] In a third aspect, the embodiments of the present application further provide a PCB copper-embedded metal hole structure visual detection system, which comprises a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the method according to any one of the preceding aspects when executing the computer program.
[0038] As can be seen from the above embodiments, the PCB copper-embedded metal hole structure visual detection method, device and system provided by the embodiments of the present application have at least the following beneficial effects:
[0039] Firstly, the embodiments of the present application identify all circular areas in the PCB image according to the feature that the copper-embedded metal hole is circular. However, there are also interference circular structures without copper embedding in the PCB. Considering that the gray values of the pixel points outside and around the edges of the interference circular structure are close, and the copper-embedded metal hole is composed of two different parts, i.e., the copper-embedded position and the hole position, and the brightness of the copper-embedded position is larger, and the gray difference between the position outside the edge of the copper-embedded position and the copper-embedded position is larger, the embodiments of the present application evaluate the distinctness of different parts of the circular area, calculate the copper hole possibility of the circular area, and accurately screen out the copper-embedded metal hole area corresponding to the copper-embedded metal hole from the circular area according to the copper hole possibilities of all circular areas identified from the PCB image, thereby avoiding the problem of inaccurate positioning of the copper-embedded metal hole and affecting the accuracy of the visual detection of the copper-embedded metal hole structure. When the copper-embedded structure is rubbed during transportation, micro scratches may appear on the copper surface, and the scratches generated by the same rubbing are parallel, and the directions of the scratches generated by different rubbings are randomly distributed. The embodiments of the present application analyze the distinctness of the high-frequency energy brought by the scratches and the direction difference of the scratches, calculate the scratch confidence of the copper-embedded metal hole area, and the greater the scratch confidence, the greater the possibility of the occurrence of the division defect in the corresponding copper-embedded metal hole area. Finally, the embodiments of the present application acquire the visual detection result of the PCB to be detected according to the values of the scratch confidence of all copper-embedded metal hole areas identified from the PCB image, thereby solving the problem of the mixture of micro scratches and defects on the surface of the copper-embedded metal hole structure, reducing the effectiveness of the detection result of the copper-embedded metal hole structure, and improving the accuracy of the visual detection of the copper-embedded metal hole structure. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0041] Figure 1 A step flow chart of a PCB metal hole copper-embedded structure visual detection method provided by an embodiment of the present application is shown in
[0042] Figure 2 A structural schematic diagram of a PCB metal hole copper-embedded structure visual detection device provided by an embodiment of the present application is shown in DETAILED DESCRIPTION
[0043] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purposes, the following will combine the drawings and the preferred embodiments to specifically describe the specific implementation, structure, features and effects of the PCB metal hole copper-embedded structure visual detection method, device and system according to the present application.
[0044] The following will specifically describe the specific scheme of the PCB metal hole copper-embedded structure visual detection method, device and system provided by the present application in combination with the drawings.
[0045] Please refer to Figure 1 which shows a step flow chart of a PCB metal hole copper-embedded structure visual detection method provided by an embodiment of the present application, and the method comprises the following steps:
[0046] S001: Collecting the PCB image of the PCB to be detected, and identifying all the circular regions in the PCB image.
[0047] The front surface of the PCB faces the industrial CCD camera, so as to avoid the influence of the change of the gray value of the edge of the copper-embedded metal hole in the PCB caused by the light on the defect detection, and the industrial CCD camera is used to collect the PCB image of the PCB to be detected, and the PCB image is preprocessed.
[0048] The preprocessing of the PCB image comprises denoising and image equalization processing. Specifically, the Gaussian filtering algorithm is used for denoising, and the CLAHE algorithm is used for image equalization processing in the present embodiment. Denoising and image equalization processing are both well-known technologies, and will not be described here. As other implementation manners, on the basis of achieving the purposes of image denoising and image equalization processing, the implementer can use other methods such as mean filtering in the prior art to perform image denoising, and use other methods such as AHE algorithm in the prior art to perform image equalization processing, which is not specially limited by the present application.
[0049] The copper-embedded position of the copper-embedded metal hole in the PCB board can have scratches, and the gray scale difference between the copper-embedded position and the hole position is obvious, which can cause separation in the detection of the circular structure of the empty hole. Therefore, the pre-processed PCB image is subjected to morphological processing.
[0050] Preferably, as an embodiment of the present application, the cvtColor function, threshold function and morphologyEx function in OpenCV are used to perform gray scale processing, binarization and opening operation processing on the pre-processed PCB image, respectively. In particular, according to the actual situation, if one opening operation cannot fill the empty hole area formed by scratches and holes in the circular area, multiple opening operation processing is performed, and the embodiment uses 2 times of opening operation processing.
[0051] The processed PCB image is subjected to edge detection to obtain a PCB edge image, and the Hough circle detection is used on the PCB edge image to extract a circular area.
[0052] At this point, all the circular areas in the PCB image are identified.
[0053] S002: Establish a gray level co-occurrence matrix of the circular area in a first preset number of directions, perform morphological processing on the circular area, obtain an expanded area and an eroded area, calculate the copper-embedded hole possibility of the circular area according to the distribution difference of the gray level co-occurrence matrix of the circular area in all directions and the distribution difference of the gray level values in the expanded area and the eroded area, and identify the copper-embedded metal hole area according to the copper-embedded hole possibility of all the circular areas identified in the PCB image.
[0054] The copper-embedded metal hole in the PCB board is generally a circular structure, which is composed of a copper-embedded position and a hole position, and the brightness of the copper-embedded position is larger, i.e., the gray scale value of the copper-embedded position is larger. At the same time, the position outside the edge of the copper-embedded position has a higher height difference relative to the copper-embedded position, which is manifested as a larger gray scale difference in the image. However, there are also circular structures without copper embedding in the PCB board, which are referred to as interference circular structures, and the gray scale values of the pixel points outside the edge of the interference circular structure are close to those of the surrounding pixel points. Therefore, the gray scale value difference between the extracted circular area and the pixel value adjacent to the circular area can be used to avoid the influence of non-copper-embedded holes on visual detection.
[0055] a gray level co-occurrence matrix of pixel values of all pixel points contained in the circular region in the first preset number of directions is calculated, and denoted as a gray level co-occurrence matrix of the circular region in the first preset number of directions; a mean value of a second order entropy and a contrast of the gray level co-occurrence matrix of the circular region in the same direction is denoted as a texture fluctuation degree of the circular region in the same direction; and a mean value of the texture fluctuation degrees of the circular region in all directions is denoted as a first copper-embedding characteristic value of the circular region.
[0056] In the embodiment, the first preset number is 4, and the first preset number of directions are 0°, 45°, 90° and 135° respectively. The second order entropy and the contrast of the gray level co-occurrence matrix are known techniques, and will not be described herein.
[0057] The circular region is dilated and eroded respectively using a morphological algorithm, and a region different from the circular region in the dilated region and the eroded region is denoted as a dilated region and an eroded region of the circular region respectively; pixel values of pixel points contained in the dilated region and the eroded region are arranged in the same order successively respectively, and a dilated gray level sequence and an eroded gray level sequence are obtained; and a DTW distance of the dilated gray level sequence and the eroded gray level sequence is denoted as a second copper-embedding characteristic value of the circular region.
[0058] In the embodiment, the pixel range of the dilation and the erosion is set to 3, and the dilation and the erosion of the region using the morphological algorithm and the calculation of the DTW distance of the sequence are known techniques, and will not be described herein.
[0059] In the process of obtaining the dilated gray level sequence and the eroded gray level sequence, the pixel points are arranged in descending order of the coordinate values in the horizontal direction and in descending order of the coordinate values in the vertical direction.
[0060] It can be understood that the dilated region corresponds to a region outside the edge of the circular region, and the eroded region corresponds to a copper-embedding region in the circular region.
[0061] A positive correlation processing result of the first copper-embedding characteristic value and the second copper-embedding characteristic value of the circular region is denoted as a copper-embedding hole possibility of the circular region.
[0062] It can be understood that the positive correlation processing of the first copper-embedding characteristic value and the second copper-embedding characteristic value of the circular region ensures that the first copper-embedding characteristic value and the second copper-embedding characteristic value of the circular region are positively correlated with the copper-embedding hole possibility of the circular region. It can be understood that the positive correlation relationship in the present application refers to the relationship between the independent variable and the dependent variable, the independent variable is the first copper-embedding characteristic value and the second copper-embedding characteristic value of the circular region, the dependent variable is the copper-embedding hole possibility of the circular region, and the positive correlation relationship is that the dependent variable increases (decreases) with the increase (decrease) of the independent variable, which can be an additive relationship, a multiplication relationship, etc.
[0063] Preferably, as an embodiment of the present application, the mean value of the first copper-embedded feature value and the second copper-embedded feature value of the circular region is recorded as the copper-embedded hole possibility of the circular region.
[0064] In practical application, as other embodiments, the product of the first copper-embedded feature value and the second copper-embedded feature value of the circular region is recorded as the copper-embedded hole possibility of the circular region.
[0065] The mean value of the copper-embedded hole possibilities of all the circular regions identified in the PCB image is recorded as the possibility threshold value, and the circular region with the copper-embedded hole possibility greater than the possibility threshold value is recorded as the copper-embedded metal hole region.
[0066] Up to now, all the copper-embedded metal hole regions in the PCB image are identified.
[0067] S003: Calculate the gradient direction and gradient amplitude of all the edge pixel points of the corrosion region, and calculate the scratch confidence of the copper-embedded metal hole region according to the difference of the gradient direction and the value of the gradient amplitude of all the edge pixel points of the corrosion region determined by the copper-embedded metal hole region.
[0068] When the copper-embedded structure is rubbed during transportation, micro scratches may appear on the copper surface, and the scratches generated by the same rubbing are parallel, and the scratches generated by different rubbings are randomly distributed. When there are more scratches in the copper-embedded metal hole region and the influence of the scratches is more serious, more high-frequency energy will appear in the frequency domain in the copper-embedded metal hole region, and the difference in direction corresponding to different scratches is greater.
[0069] Calculate the gradient direction and gradient amplitude of all the edge pixel points of the corrosion region determined by the copper-embedded metal hole region, divide the value range of the gradient direction into a second preset number of sub-ranges, and record the cumulative sum of the product of the gradient direction and the corresponding gradient amplitude of all the edge pixel points of the corrosion region determined by the copper-embedded metal hole region in the same sub-range as the scratch energy value of the copper-embedded metal hole region in the same sub-range. The normalized value of the cumulative sum of the scratch energy values of the copper-embedded metal hole region in all sub-ranges is recorded as the scratch severity of the copper-embedded metal hole region.
[0070] It should be noted that the Z-Score standard normalization method is used to calculate the normalized value in the present embodiment, and other methods such as the maximum and minimum value normalization method, the sigmoid function, and other methods in the prior art can be used to calculate the normalized value in practical application, which is not limited herein.
[0071] In the present embodiment, the value of the second preset number is 8.
[0072] The normalized value of the cumulative sum of the gradient amplitudes of all edge pixel points of the corrosion area of the copper-embedded metal hole area is recorded as the scratch conspicuity of the copper-embedded metal hole area.
[0073] Preferably, as an embodiment of the present application, the mean value of the scratch severity and the scratch conspicuity of the copper-embedded metal hole area is recorded as the scratch confidence of the copper-embedded metal hole area.
[0074] At this point, the scratch confidence of all copper-embedded metal hole areas is obtained.
[0075] S004: According to the values of the scratch confidence of all copper-embedded metal hole areas identified from the PCB image, the visual inspection result of the PCB to be detected is obtained.
[0076] The first defect threshold, the second defect threshold, and the third defect threshold are set respectively, and in this embodiment, the values of the first defect threshold, the second defect threshold, and the third defect threshold are 0.3, 0.5, and 0.8 respectively. The first defect threshold, the second defect threshold, and the third defect threshold are used to divide whether the PCB metal hole copper-embedded structure belongs to no defect, light defect, moderate defect, or severe defect.
[0077] The values equal to 0 are removed from the scratch confidence of all copper-embedded metal hole areas identified from the PCB image, and the mean value of the remaining values is recorded as the scratch defect confidence of the PCB image. The scratch defect confidence is compared with the preset first defect threshold, second defect threshold, and third defect threshold respectively, and the visual inspection result of the PCB to be detected is obtained.
[0078] Specifically, as an embodiment of the present application, when the scratch defect confidence is less than or equal to the first defect threshold, it is determined that the PCB to be detected has no defect; when the scratch defect confidence is greater than the first defect threshold and less than or equal to the second defect threshold, it is determined that the PCB to be detected has a light defect; when the scratch defect confidence is greater than the second defect threshold and less than or equal to the third defect threshold, it is determined that the PCB to be detected has a moderate defect; and when the scratch defect confidence is greater than the third defect threshold, it is determined that the PCB to be detected has a severe defect.
[0079] At this point, the visual inspection result of the PCB is obtained.
[0080] Please refer to Figure 2 , Figure 2 is a structural schematic diagram of a PCB metal hole copper-embedded structure visual inspection device provided by an embodiment of the present application. In this embodiment, each unit included in the device is used to execute each step in the corresponding embodiment of a PCB metal hole copper-embedded structure visual inspection method. Please refer to Figure 2The visual inspection device comprises a circular region detection module, a copper-embedded metal hole region identification module, a scratch confidence calculation module, and a visual inspection result acquisition module.
[0081] The circular region detection module is configured to acquire a PCB image of a PCB to be inspected, and identify all circular regions in the PCB image.
[0082] The copper-embedded metal hole region identification module is configured to establish a gray level co-occurrence matrix of the circular region in a first preset number of directions, perform morphological processing on the circular region, acquire an expanded region and a corroded region, calculate a copper-embedded hole possibility of the circular region according to a distribution difference of the gray level co-occurrence matrix of the circular region in all directions and a distribution difference of gray level values in the expanded region and the corroded region, and identify a copper-embedded metal hole region according to the copper-embedded hole possibilities of all the circular regions identified in the PCB image.
[0083] The scratch confidence calculation module is configured to calculate gradient directions and gradient amplitudes of all edge pixel points of the corroded region, and calculate a scratch confidence of the copper-embedded metal hole region according to a difference of the gradient directions and a value of the gradient amplitudes of all the edge pixel points of the corroded region determined by the copper-embedded metal hole region.
[0084] The visual inspection result acquisition module is configured to acquire a visual inspection result of the PCB to be inspected according to the value of the scratch confidence of all the copper-embedded metal hole regions identified from the PCB image.
[0085] Based on the same inventive concept as the above method, the embodiments of the present application also provide a PCB metal hole copper-embedded structure visual inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of any one of the above PCB metal hole copper-embedded structure visual inspection methods when executing the computer program.
[0086] It can be understood that the above-mentioned embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. Moreover, the above-mentioned embodiments of the present application are described. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.
[0087] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0088] The above merely illustrates the embodiments of the present application, and is not intended to limit the scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the protection scope of the present application.
Claims
1. A visual inspection method for a PCB copper-inlay structure of a metal hole, characterized in that, The method comprises the following steps: Collecting a PCB image of a PCB to be detected, and identifying all circular regions in the PCB image; Establishing a gray level co-occurrence matrix of the circular regions in a first preset number of directions, performing morphological processing on the circular regions, obtaining an expanded region and an eroded region, calculating a copper-embedded hole possibility of the circular regions according to distribution differences of the gray level co-occurrence matrices of the circular regions in all directions and distribution differences of gray level values in the expanded region and the eroded region, and identifying a copper-embedded metal hole region according to the copper-embedded hole possibilities of all the circular regions identified in the PCB image; Calculating gradient directions and gradient amplitudes of all edge pixel points of the eroded region, and calculating a scratch confidence of the copper-embedded metal hole region according to differences of the gradient directions and values of the gradient amplitudes of all the edge pixel points of the eroded region determined according to the copper-embedded metal hole region; Obtaining a visual inspection result of the PCB to be detected according to values of the scratch confidence of all the copper-embedded metal hole regions identified from the PCB image; The determination process of the scratch confidence of the copper-embedded metal hole region comprises: Calculating a scratch severity of the copper-embedded metal hole region according to the gradient directions and the gradient amplitudes of all the edge pixel points of the eroded region determined according to the copper-embedded metal hole region; Taking a normalized value of a sum of the gradient amplitudes of all the edge pixel points of the eroded region determined according to the copper-embedded metal hole region as a scratch saliency of the copper-embedded metal hole region; Taking a positive correlation processing result of the scratch severity and the scratch saliency of the copper-embedded metal hole region as the scratch confidence of the copper-embedded metal hole region.
2. The method for visual inspection of copper-inlayed structure of PCB metal hole according to claim 1, characterized in that, The determination process of the copper-embedded hole possibility of the circular region comprises: Calculating a first copper-embedded feature value of the circular region according to distribution differences of the gray level co-occurrence matrices of the circular region in all directions; Calculating a second copper-embedded feature value of the circular region according to distribution differences of gray level values in the expanded region and the eroded region; Taking a positive correlation processing result of the first copper-embedded feature value and the second copper-embedded feature value of the circular region as the copper-embedded hole possibility of the circular region.
3. The method of claim 2, wherein the method further comprises: determining the position of the PCB metal hole embedded copper structure by using the image processing method. The construction process of the first copper-embedded feature value of the circular region comprises: Taking a mean value of a second-order entropy and a contrast of the gray level co-occurrence matrix of the circular region in a same direction as a texture fluctuation degree of the circular region in the same direction; Taking a mean value of the texture fluctuation degrees of the circular region in all directions as the first copper-embedded feature value of the circular region.
4. The visual inspection method for PCB metal hole copper embedding structure as described in claim 2, characterized in that, The specific calculation process of the second copper-embedded feature value of the circular region comprises: According to pixel values of pixel points contained in the expanded region and the eroded region, constructing an expanded gray level sequence and an eroded gray level sequence respectively, and taking a dynamic time warping distance of the expanded gray level sequence and the eroded gray level sequence as the second copper-embedded feature value of the circular region.
5. The method of claim 1, wherein the method further comprises: determining the copper thickness of the copper inlaid structure of the PCB metal hole inlaid structure based on the captured image of the copper inlaid structure of the PCB metal hole inlaid structure. The specific process of identifying the copper-embedded metal hole region comprises: Taking a mean value of the copper-embedded hole possibilities of all the circular regions identified in the PCB image as a possibility threshold value, and taking a circular region with a copper-embedded hole possibility greater than the possibility threshold value as the copper-embedded metal hole region.
6. The method of visual inspection of copper-inlayed structure of PCB metal hole according to claim 1, wherein, The specific determination process of the scratch severity of the copper-embedded metal hole region comprises: The product of the gradient direction of all edge pixel points of the corrosion region determined by the copper-embedded metal hole region in the same sub-range and the corresponding gradient amplitude is accumulated, and the accumulated sum is recorded as the scratch energy value of the copper-embedded metal hole region in the same sub-range. The normalized value of the accumulated sum of the scratch energy values of the copper-embedded metal hole region in all sub-ranges is recorded as the scratch severity of the copper-embedded metal hole region.
7. The method of visual inspection of copper-inlayed PCB metal hole structure of claim 1, wherein, The value of the scratch confidence of all copper-embedded metal hole regions identified from the PCB image is used to obtain the visual inspection result of the PCB to be detected, and the specific process includes: The scratch confidence equal to 0 is deleted, and the mean value of the remaining scratch confidence of all copper-embedded metal hole regions identified from the PCB image is recorded as the scratch defect confidence of the PCB image. The scratch defect confidence is compared with the preset first defect threshold, second defect threshold and third defect threshold respectively, and the visual inspection result of the PCB to be detected is obtained. The visual inspection result includes that the PCB metal hole copper-embedded structure belongs to no defect, slight defect, moderate defect and severe defect.
8. A PCB copper-in-hole structure visual inspection apparatus for implementing the method as claimed in claim 1, characterized in that, The visual inspection device includes: A circular region detection module is configured to acquire a PCB image of a PCB to be detected and identify all circular regions in the PCB image. A copper-embedded metal hole region identification module is configured to establish a gray level co-occurrence matrix of the circular region in a first preset number of directions, perform morphological processing on the circular region, obtain an expanded region and a corrosion region, calculate a copper-embedded hole possibility of the circular region according to the distribution difference of the gray level co-occurrence matrix of the circular region in all directions and the distribution difference of the gray level values in the expanded region and the corrosion region, and identify a copper-embedded metal hole region according to the copper-embedded hole possibilities of all circular regions identified in the PCB image. A scratch confidence calculation module is configured to calculate the gradient direction and the gradient amplitude of all edge pixel points of the corrosion region, and calculate the scratch confidence of the copper-embedded metal hole region according to the difference of the gradient direction and the value of the gradient amplitude of all edge pixel points of the corrosion region determined by the copper-embedded metal hole region. A visual inspection result acquisition module is configured to obtain the visual inspection result of the PCB to be detected according to the value of the scratch confidence of all copper-embedded metal hole regions identified from the PCB image. 9.A PCB copper-in-hole structure visual inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to realize the steps of the method of any one of claims 1-7. The processor executes the computer program to realize the steps of the method of any one of claims 1-7.
Citation Information
Patent Citations
Visual inspection system for rigid PCB metal hole copper-embedded structure
CN117372426A
Method and device for controlling copper embedding quality of printed circuit board, computer equipment and storage medium
CN120672702A