Distributed camera 2D and 3D based blind hole plate hole depth measurement method and system
By combining 2D and 3D distributed cameras, the positioning deviation and reliability issues in blind hole depth optical inspection were solved, enabling comprehensive and accurate evaluation of blind hole quality. This approach adapts to complex environments and improves the accuracy and production adaptability of the inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-03-24
AI Technical Summary
Existing optical methods for detecting the depth of blind holes suffer from large positioning deviations and low measurement reliability due to specular reflection and the inability of deep hole lasers to return, making it impossible to comprehensively assess the quality of blind holes.
A distributed camera approach combining 2D and 3D methods is employed. By combining laser stripe images and 2D grayscale images with Gaussian fitting and grayscale centroid method, the two-dimensional image coordinates of the center point of the laser stripe are extracted. Affine transformation and image matching are used to locate the center of the blind hole. The hole depth is calculated by combining 3D height data, and measurability is determined by 2D grayscale images for comprehensive evaluation.
It achieves accuracy and reliability in blind hole detection under complex environments, can adapt to various complex hole conditions, improves the comprehensiveness and accuracy of blind hole quality assessment, avoids invalid measurements, and adapts to various complex production environments.
Smart Images

Figure CN121095241B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision technology, specifically relating to a method and system for measuring the hole depth of blind holes based on distributed camera 2D and 3D. Background Technology
[0002] Blind vias on PCBs play a crucial role in achieving high-density interconnect (HDI) technology and are essential for the miniaturization and high-performance development of modern electronic devices. They enable inter-layer electrical connections through non-through-hole blind vias, effectively improving wiring density and signal integrity. However, accurate quality inspection of blind vias has always been a challenge in the manufacturing process.
[0003] Currently, some studies have proposed using optical methods to replace traditional destructive slicing inspections. For example, Chinese patent CN115713553A proposes a blind hole depth measurement scheme based on multiple 3D cameras. It acquires 3D data of the entire board through scanning and uses through-hole coordinates to locate blind holes via affine transformation. Finally, it calculates the hole depth within the rectangular area of the blind hole based on the average depth of multiple points. While this scheme achieves non-contact measurement, it still has significant limitations: First, it heavily relies on through-holes for blind hole location, limiting its applicability on boards with missing or unevenly distributed through-holes; second, it only uses 3D data for calculation, and when the blind hole is deep and specular reflection occurs or the laser cannot return, the 3D data becomes invalid or severely distorted, leading to measurement failure or a sharp drop in accuracy.
[0004] Therefore, existing technologies still lack an automated inspection solution that can adapt to complex hole conditions, effectively overcome the inherent limitations of optical measurement, and provide comprehensive, accurate, and robust quality testing for blind holes. Summary of the Invention
[0005] The purpose of this invention is to provide a method for measuring the depth of blind holes based on 2D and 3D distributed cameras, in order to solve the technical problems of existing blind hole depth optical detection methods, such as large positioning deviations, low measurement reliability, and inability to comprehensively evaluate the quality of blind holes, caused by specular reflection, the inability of deep hole lasers to return, and the lack of 2D information assistance.
[0006] The present invention achieves the above objectives through the following technical solutions:
[0007] In a first aspect, the present invention proposes a method for measuring the hole depth of a blind hole plate based on 2D and 3D distributed cameras, the method comprising:
[0008] Laser stripes are projected onto a blind hole plate using a laser, and images of the laser stripes and 2D grayscale images of the blind hole plate are acquired using distributed cameras.
[0009] The center extraction algorithm is determined based on the pixel grayscale distribution of the laser stripes in the image within a preset window, so as to extract the two-dimensional image coordinates of the center point of the laser stripes, and the 3D height data of the blind hole plate is determined based on the two-dimensional image coordinates.
[0010] Based on the 3D height data and the blind holes on the blind hole plate, coordinate mapping is performed through affine transformation, and image matching is used to locate the center of the blind hole in the mapped area to determine the center coordinates of the blind hole.
[0011] Based on the grayscale characteristics of the 2D grayscale image in the central coordinate region, the hole depth of the blind hole is calculated using the 3D height data.
[0012] Furthermore, the step of determining the center extraction algorithm based on the pixel grayscale distribution of the laser stripes within a preset window in the image to extract the two-dimensional image coordinates of the center point of the laser stripes includes:
[0013] Traverse the pixels on the laser stripe. When the gray values of multiple consecutive pixels within the preset window are all greater than the first threshold, the area is determined to be an overexposed area; otherwise, it is determined to be an unsaturated area.
[0014] In the unsaturated region, the two-dimensional image coordinates of the laser stripe center are extracted using Gaussian fitting, achieved by the following formula:
[0015] ;
[0016] Where x is the pixel position perpendicular to the laser stripe direction, f(x) is the grayscale of the light intensity fitted at that position; a is the peak intensity, b is the subpixel level ordinate of the center point of the laser stripe, c is the standard deviation of the Gaussian distribution, and e is the base of the natural logarithm; parameters a, b, and c are solved by the least squares method.
[0017] In the overexposed area, the center of the laser stripe is extracted using the gray-scale centroid method, achieved by the following formula:
[0018] ;
[0019] Among them, g i Let be the grayscale value of the i-th pixel. Let U be the integer pixel coordinate of the i-th pixel, and U be the sub-pixel coordinate of the center point of the laser stripe.
[0020] Furthermore, determining the 3D height data of the blind hole plate based on the two-dimensional image coordinates includes:
[0021] The two-dimensional image coordinates are input into a pre-calibrated laser triangulation model to calculate the three-dimensional spatial coordinates of each point on the surface of the blind hole plate, thereby generating the 3D height data.
[0022] Furthermore, the coordinate mapping based on the 3D height data and the positioning holes on the blind hole plate through affine transformation includes:
[0023] Based on the coordinates of at least four positioning holes on the blind hole plate in the actual image and their coordinates in the standard drawing, an affine transformation model is constructed.
[0024] Mapping the coordinates of the positioning holes in the standard drawing to the image coordinate system corresponding to the 3D height data is achieved using the following formula:
[0025] ;
[0026] Where x' is the abscissa of the actual hole and y' is the ordinate of the actual hole; x is the abscissa of the standard hole and y is the ordinate of the standard hole; A is an 8-parameter transformation matrix.
[0027] Furthermore, the step of using image matching to perform center localization within the mapped region and determining the center coordinates of the blind hole includes:
[0028] Within the mapped region, a convolution kernel is constructed that matches the three-dimensional morphology of a standard blind aperture;
[0029] Calculate the response map of the convolution kernel and the 3D height data in the region, and determine the peak points of the response map as candidate points for the blind hole center;
[0030] Clustering algorithms are used to perform cluster analysis on all candidate points, and cluster centers are formed based on the optimal number of clusters.
[0031] Calculate the Euclidean distance between each candidate point and its cluster center. If the distance is greater than the preset deviation tolerance, the point is determined to be an outlier and removed. The final cluster center coordinates are then used as the center coordinates of the blind hole.
[0032] Furthermore, the step of using a clustering algorithm to perform cluster analysis on all candidate points includes:
[0033] Iterate through the preset number of candidate clusters, perform clustering for each candidate cluster, and calculate the average silhouette coefficient of the cluster.
[0034] By comparing the average silhouette coefficients under different numbers of candidates, the number of candidates with the highest coefficient is determined as the optimal number of clusters; the formula for calculating the silhouette coefficient s of a single sample point is:
[0035] ;
[0036] Where M is the average distance from a sample point to other points within its cluster, and N is the average distance from a sample point to points in other clusters.
[0037] Furthermore, the step of calculating the hole depth of the blind hole using the 3D height data based on the grayscale features of the 2D grayscale image in the central coordinate region includes:
[0038] Calculate the percentage of pixels with grayscale values lower than a second preset threshold within a predetermined area surrounding the center coordinates;
[0039] If the percentage is lower than the third preset threshold, it is determined to be a measurable blind hole, and the hole depth is calculated by fitting a quadratic surface in the neighborhood of the center coordinates based on the quadratic surface model in the 3D height data.
[0040] If the percentage is higher than the third preset threshold, it is determined to be an unmeasurable blind hole;
[0041] The quadratic surface model is as follows:
[0042] ;
[0043] Solving parameters using the least squares method , , , , , The optimal value is determined, and the difference between the height of the extreme point of the quadratic surface and the reference height of the plate surface is taken as the actual hole depth.
[0044] Furthermore, the method also includes:
[0045] Based on the quadratic surface used for hole depth calculation, the transverse curvature and longitudinal curvature of the bottom of the blind hole are calculated. When either curvature exceeds the preset range, it is judged as an abnormal shape.
[0046] Based on the 2D grayscale image, the grayscale uniformity of the hole wall region is analyzed. When the grayscale standard deviation exceeds the preset standard deviation threshold, it is determined that there is an over-plating or under-plating defect.
[0047] Based on the deviation of the hole depth from the standard depth, abnormal morphology, and filling defects, the quality of blind holes is divided into multiple grades, including "qualified", "repairable", and "scrap".
[0048] Secondly, the present invention proposes a blind hole plate depth measurement system based on distributed camera 2D and 3D, used to implement the steps of the blind hole plate depth measurement method described above, the system comprising:
[0049] The data acquisition module is used to project laser stripes onto the blind hole plate using a laser, and to acquire laser stripe images and 2D grayscale images of the blind hole plate using a distributed camera.
[0050] The 3D reconstruction module is used to determine the center extraction algorithm based on the pixel grayscale distribution of the laser stripes in the image within a preset window, so as to extract the two-dimensional image coordinates of the center point of the laser stripes, and determine the 3D height data of the blind hole plate based on the two-dimensional image coordinates.
[0051] The center positioning module is used to perform coordinate mapping by affine transformation based on the 3D height data and the positioning holes on the blind hole plate, and to perform center positioning by image matching in the mapped area to determine the center coordinates of the blind hole.
[0052] The hole depth calculation module is used to calculate the hole depth of blind holes based on the grayscale features of the 2D grayscale image in the central coordinate region and the 3D height data.
[0053] Thirdly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the blind hole plate hole depth measurement method described above.
[0054] The beneficial effects of this invention are as follows:
[0055] 1. This invention effectively solves practical problems in blind hole detection by combining the advantages of both 2D and 3D images. When extracting the center of laser stripes, the system automatically selects the most suitable algorithm based on the light intensity: Gaussian fitting is used to ensure accuracy when the light is normal, and the grayscale centroid method is switched to avoid errors when the light is too strong, thus ensuring the accurate generation of 3D data. When locating the center of the blind hole, the system first performs preliminary positioning using the positioning hole, then uses a template matching the shape of a standard blind hole for precise searching, and finally uses intelligent clustering to eliminate erroneous positioning points caused by specular reflection, making the positioning results more reliable.
[0056] 2. This invention utilizes 2D grayscale images for pre-judgment. When the hole is too dark, it is directly identified as an unmeasurable hole, avoiding invalid measurements. For measurable holes, the depth is accurately calculated using 3D data. After obtaining the hole depth, the system also automatically judges the blind hole processing quality by analyzing the shape of the hole bottom surface and the uniformity of the hole wall color, achieving an upgrade from simple measurement to comprehensive evaluation. This method not only improves the accuracy of measurement, but more importantly, it can adapt to various complex actual production environments. Attached Figure Description
[0057] Figure 1 A schematic flowchart of a blind hole plate hole depth measurement method based on distributed camera 2D and 3D provided in Embodiment 1 of this application;
[0058] Figure 2 This is another flowchart illustrating the blind hole depth measurement method based on distributed camera 2D and 3D provided in Embodiment 1 of this application;
[0059] Figure 3 A system block diagram of a blind hole plate depth measurement system based on distributed camera 2D and 3D provided in Embodiment 2 of this application;
[0060] Figure 4 This is a schematic diagram of one possible deployment of distributed cameras in this application. Detailed Implementation
[0061] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.
[0062] Example 1
[0063] Please see Figure 1 and Figure 2 In a specific embodiment of the present invention, a method for measuring the hole depth of a blind hole plate based on 2D and 3D distributed cameras is proposed. The method includes: projecting laser stripes through a laser and simultaneously acquiring laser stripe images and 2D grayscale images of the blind hole plate using a distributed camera; adaptively selecting Gaussian fitting or grayscale centroid method to extract the sub-pixel center based on the pixel grayscale distribution within a preset window on the laser stripes to generate 3D height data of the blind hole plate; locating the center of the blind hole based on the 3D height data and the positioning hole through affine transformation and image matching; combining the 3D height data and the 2D grayscale image, judging the measurability of the blind hole based on the 2D grayscale features, selectively enabling hole depth calculation based on the 3D height data, and comprehensively evaluating the quality of the blind hole.
[0064] The method for measuring the depth of a blind hole plate includes the following specific steps:
[0065] S1. Project laser stripes onto the blind hole plate using a laser, and use a distributed camera to acquire images of the laser stripes and 2D grayscale images of the blind hole plate.
[0066] For a specific implementation method, please refer to Figure 4 A linear laser stripe is projected onto the surface of the blind hole plate under test using a line laser (marked as "laser" in the diagram). A set of calibrated distributed industrial cameras (marked as "CAM" in the diagram) are used to simultaneously acquire two images under unified trigger signal control: one is a laser stripe image primarily containing the laser stripe (ambient light should be turned off or reduced to ensure the laser stripe is clearly visible); the other is a 2D grayscale image of the blind hole plate acquired under uniform surface illumination, clearly showing the surface texture, blind hole outline, and other two-dimensional features of the blind hole plate.
[0067] S2. Determine the center extraction algorithm based on the pixel grayscale distribution of the laser stripes in the preset window to extract the two-dimensional image coordinates of the center point of the laser stripes, and determine the 3D height data of the blind hole plate based on the two-dimensional image coordinates.
[0068] Specifically, an adaptive center extraction algorithm is used based on distribution characteristics: for normal, unsaturated areas with normal laser energy, Gaussian fitting is used to accurately determine the sub-pixel position of the stripe center; for overexposed areas where laser energy is saturated due to specular reflection or other reasons, the gray-scale centroid method is switched to overcome the positioning deviation caused by saturation. Through this process, sub-pixel precision two-dimensional image coordinates of all points on the entire laser stripe are extracted.
[0069] Finally, these two-dimensional coordinates are input into a pre-calibrated laser triangulation model to calculate the three-dimensional spatial coordinates of each point on the surface of the blind hole plate, thereby generating 3D height data describing the overall shape of the plate.
[0070] S3. Based on the 3D height data and the positioning holes on the blind hole plate, coordinate mapping is performed through affine transformation. Image matching is used to locate the center of the blind hole within the mapped area to determine the center coordinates of the blind hole.
[0071] In practice, the four positioning holes on the blind via board are selected as the reference feature points. In a normal PCB blind via board design, a positioning hole is usually set at each of the four corners of the board: the upper left, lower left, upper right, and lower right. These four holes are precisely positioned on the board and have a wide distribution range, providing a stable and accurate coordinate transformation reference.
[0072] Optionally, if all four corner positioning holes cannot be reliably identified due to contamination, obstruction, or damage, four non-collinear through holes or dedicated positioning marks at other locations on the board can be selected as alternative references. As long as these four points can be clearly identified and corresponded in both the actual board and standard drawings, and their spatial distribution can form a stable geometric relationship, the system can still calculate an effective affine transformation matrix, complete coordinate mapping, and ensure the accuracy of subsequent blind hole positioning.
[0073] S4. Based on the grayscale characteristics of the 2D grayscale image in the central coordinate region, the hole depth of the blind hole is calculated using 3D height data.
[0074] Specifically, the grayscale characteristics of the 2D grayscale image around the center of the blind hole are analyzed, particularly the proportion of low grayscale pixels. If this proportion exceeds a set threshold, it indicates that the laser may not be able to return from the bottom of the hole or that complex secondary reflections have occurred. In this case, the 3D data is unreliable, and the hole is directly determined to be an unmeasurable hole. For conventional holes determined to be measurable, a quadratic surface is fitted in a small neighborhood of the 3D height data, using the coordinates of the blind hole center as a reference, to accurately characterize the three-dimensional shape of the hole bottom. The accurate hole depth is obtained by calculating the height difference between the extreme points of this quadratic surface and the reference plane of the plate.
[0075] S5. Based on the quadratic surface used for hole depth calculation, calculate the transverse curvature and longitudinal curvature of the bottom of the blind hole. When either curvature exceeds the preset range, it is judged as an abnormal shape. Based on the 2D grayscale image, analyze the grayscale uniformity of the hole wall area. When the grayscale standard deviation exceeds the preset standard deviation threshold, it is judged that there is over-plating or under-plating defect. Combining the deviation between the hole depth and the standard depth, abnormal shape and filling defects, the quality of the blind hole is divided into multiple levels, including "qualified", "repairable" and "scrap".
[0076] More preferably, in step S2, the center extraction algorithm is determined based on the pixel grayscale distribution of the laser stripes within a preset window in the image to extract the two-dimensional image coordinates of the center point of the laser stripes, including:
[0077] First, the acquired single laser stripe image is preprocessed using a 7×5 mean filter to suppress random noise interference. Then, each pixel along the laser stripe's extension direction is sequentially traversed. For the currently processed point, a preset detection window (e.g., a 5-pixel wide neighborhood) is set centered on it, and the pixel grayscale distribution within this window is analyzed. The judgment rule is: if the grayscale values of three consecutive pixels within the window are all greater than a preset first threshold K, the current area is determined to be an overexposed area with saturated laser energy; otherwise, it is determined to be an unsaturated area with normal laser energy.
[0078] In the unsaturated region, the two-dimensional image coordinates of the laser stripe center are extracted using Gaussian fitting. This method is based on the characteristic that the laser intensity approximately follows a Gaussian distribution, and the following mathematical model is used for fitting:
[0079] ;
[0080] Where x is the pixel position perpendicular to the laser stripe direction, f(x) is the light intensity gray level fitted at that position; a is the peak intensity, b is the subpixel level ordinate of the center point of the laser stripe, c is the standard deviation of the Gaussian distribution, and e is the base of the natural logarithm (a mathematical constant). The least squares method is used to perform curve fitting on the pixel gray level data within the window to solve for the optimal values of parameters a, b, and c, thereby accurately determining the center position.
[0081] In overexposed areas, the Gaussian distribution model becomes distorted because the pixel grayscale values have reached or are close to saturation. In this case, the grayscale centroid method is used. This method locates the center by calculating the weighted centroid of the pixel grayscale values within the window. The calculation formula is as follows:
[0082] ;
[0083] Among them, g i Let be the grayscale value of the i-th pixel. Let U be the integer pixel coordinate of the i-th pixel, and U be the sub-pixel coordinate of the center point of the laser stripe.
[0084] Through the above-mentioned regional adaptive processing strategy, this application can stably extract high-precision laser stripe center coordinates in regions with different reflection characteristics on the surface of the blind hole plate (such as normal rough substrate and smooth hole bottom copper foil with specular reflection).
[0085] It should be noted that, in the specific implementation process, the vertical coordinate of the laser stripe center obtained from the aforementioned steps needs to be combined with the corresponding horizontal coordinate of the image to form a complete two-dimensional image coordinate system.
[0086] Specifically, this application processes laser stripe images column by column. For each column in the image (assuming its horizontal coordinate is u), within the laser stripe area corresponding to that column, the precise vertical coordinate v (corresponding to b in Gaussian fitting and U in gray-scale centroid method) of the center point of the laser stripe in that column is calculated using the aforementioned adaptive algorithm (Gaussian fitting method or gray-scale centroid method).
[0087] Therefore, for each column, the output center point coordinates are two-dimensional data (u, v), where u is the known x-coordinate (i.e., column number) of that column, and v is the sub-pixel-level y-coordinate calculated by the algorithm. By traversing all relevant columns in the image, a set of two-dimensional image coordinate points (u, v) constituting the center line of the entire laser stripe can be obtained. i v i This set of two-dimensional points containing horizontal and vertical coordinates is the complete input for subsequently constructing 3D height data.
[0088] In a further preferred embodiment, step S2, determining the 3D height data of the blind hole plate based on the two-dimensional image coordinates, includes: inputting the two-dimensional image coordinates into a pre-calibrated laser triangulation model, calculating the three-dimensional spatial coordinates of each point on the surface of the blind hole plate, and generating 3D height data.
[0089] Understandably, during the calibration of the laser triangulation model in this application, a standard planar target of known height is used, and the target is precisely moved by multiple known displacements in a direction perpendicular to the camera's optical axis (Z-axis). At each displacement height, the system acquires a laser stripe image and extracts the position coordinates of the laser stripes in the image. By recording a series of known physical height values and their corresponding laser stripe image position coordinates, a precise correspondence between "image coordinates - physical height" is established, and this relationship is encapsulated in the laser triangulation model. This model is essentially a mapping function, and its core parameters are determined after calibration.
[0090] More preferably, in step S3, coordinate mapping is performed based on the 3D height data and the positioning holes on the blind hole plate through affine transformation, specifically including:
[0091] Primary coordinate mapping based on positioning holes
[0092] First, the coordinate transformation relationship from standard drawings to actual measured images is established using the inherent positioning holes on the blind hole plate. Specifically, the center coordinates of at least four positioning holes (preferably four non-collinear holes located at the corners of the plate) in the actual acquired 3D height data or 2D grayscale image are identified and extracted, denoted as (x', y'). Simultaneously, the theoretical coordinates (x, y) of these identical positioning holes are obtained from the standard design drawings of the blind hole plate.
[0093] Subsequently, based on these two corresponding sets of coordinate points, an affine transformation matrix A is calculated using the least squares method. This matrix is a 3x3 transformation matrix, often referred to as an 8-parameter transformation matrix with 6 independent degrees of freedom. The coordinate mapping is achieved through the following equation:
[0094] ;
[0095] Where x' is the x-coordinate of the actual hole in the drawing, and y' is the y-coordinate of the actual hole in the drawing; x is the x-coordinate of the standard hole in the drawing, and y is the y-coordinate of the standard hole in the drawing; A is an 8-parameter transformation matrix. (x', y') are the corresponding coordinates mapped to the actual image coordinate system. Using this transformation matrix, the theoretical coordinates of all blind holes in the standard drawing can be initially transformed into the actual image, achieving coarse localization of blind holes and narrowing the search range to a local area around each blind hole (e.g., a 40×40 pixel ROI).
[0096] (2) Precise location and anomaly filtering within the mapped area
[0097] Within each local ROI provided by the initial localization, perform precise center localization:
[0098] Shape matching: Construct a convolutional kernel that matches the 3D shape of a standard blind hole (i.e., its ideal height variation characteristics). Perform correlation operations between this convolutional kernel and the actual 3D height data within the ROI to generate a correlation response map. The brightest point (peak point) in the response map is the location that best matches the standard blind hole shape, and these peak points are used as candidate points for the blind hole center.
[0099] Clustering screening: Due to factors such as specular reflection and noise, multiple false candidate points may be generated. Therefore, a clustering algorithm (such as K-means) is used to analyze the spatial coordinates of all candidate points. Clustering quality is evaluated using metrics such as the silhouette coefficient, and the optimal number of clusters is automatically determined, thus forming stable cluster centers.
[0100] Anomaly removal: Calculate the Euclidean distance between each candidate point and its cluster center. Set a preset deviation tolerance (e.g., 5μm). If a candidate point's distance exceeds this tolerance, it is determined to be a location anomaly and removed.
[0101] Center determination: Finally, the coordinates of the cluster center of the most stable cluster that has been selected and retained will be determined as the final center coordinates of the blind hole.
[0102] Further preferred, a clustering algorithm is used to perform cluster analysis on all candidate points, specifically including:
[0103] In processing the candidate point set of blind hole centers generated by morphological matching, an adaptive determination method based on cluster quality assessment was adopted to overcome the subjectivity of the preset number of clusters.
[0104] First, iterate through a preset range of candidate cluster numbers (e.g., from 2 to 5). For each candidate number K within this range, perform a cluster analysis (such as the K-means algorithm) to divide all candidate points into K clusters.
[0105] Subsequently, for each clustering result, the overall average silhouette coefficient is calculated to quantitatively evaluate the quality of the clustering. For each sample point (i.e., a candidate point) in the clustering result, its individual silhouette coefficient s needs to be calculated. The calculation formula is:
[0106] ;
[0107] Where M is the average distance from a sample point to other points within its cluster. The smaller the value of M, the closer the point is to other points in the same cluster. N is the average distance from a sample point to points in other clusters. The larger the value of N, the farther the point is from other clusters, and the better the inter-cluster separation.
[0108] After calculating the s-values for all sample points, their average value is taken, which yields the average silhouette coefficient for this clustering (for the current K value). Finally, the average silhouette coefficients obtained under different candidate numbers K are compared, and the K value with the highest average silhouette coefficient is determined as the optimal number of clusters for the current candidate point set.
[0109] Further preferably, based on the grayscale characteristics of the 2D grayscale image in the central coordinate region, the hole depth of the blind hole is calculated using 3D height data, specifically including:
[0110] After obtaining the precise coordinates of the blind hole center, the first step is to determine the measurability of the blind hole. A predetermined rectangular region is delineated centered on these coordinates, and the pixel distribution within this region in the 2D grayscale image is analyzed. Specifically, the number of pixels within this region with grayscale values below a second preset threshold T is counted, and their percentage of the total number of pixels (i.e., the proportion of low-grayscale pixels) is calculated.
[0111] This percentage is compared with a third preset threshold:
[0112] If the percentage is below this threshold, the blind hole is determined to be a measurable blind hole. This indicates that the reflected light signal inside the hole is sufficient, and the 3D height data quality is reliable.
[0113] If the percentage exceeds this threshold, the blind hole is determined to be an unmeasurable blind hole. This usually means that the hole is deep, the laser cannot return effectively, or complex secondary reflections occur within the hole, rendering the 3D height data invalid or unreliable in this area. This hole will be directly marked to avoid invalid depth calculations.
[0114] For blind holes determined to be measurable, precise depth calculations are performed using the 3D height data. Within a small neighborhood of the blind hole's center coordinates, a quadratic surface model is used to fit discrete height points to accurately reconstruct the 3D topography of the hole's bottom. The quadratic surface model is as follows:
[0115] ;
[0116] Where (x, y) are the planar coordinates of the pixel, and z is the corresponding height value. The parameters are solved using the least squares method. , , , , , The optimal value is determined, and the difference between the height of the extreme point of the quadratic surface and the reference height of the plate surface is taken as the actual hole depth.
[0117] Example 2
[0118] Please see Figure 3Another specific embodiment of the present invention proposes a blind hole plate depth measurement system based on distributed camera 2D and 3D, used to implement the steps of the blind hole plate depth measurement method as described in Embodiment 1. The system includes:
[0119] The data acquisition module is used to project laser stripes onto the blind hole plate using a laser, and to acquire laser stripe images and 2D grayscale images of the blind hole plate using a distributed camera.
[0120] The 3D reconstruction module is used to determine the center extraction algorithm based on the pixel grayscale distribution of the laser stripes in the image within a preset window, so as to extract the two-dimensional image coordinates of the center point of the laser stripes, and determine the 3D height data of the blind hole plate based on the two-dimensional image coordinates.
[0121] The center positioning module is used to perform coordinate mapping based on 3D height data and positioning holes on the blind hole plate through affine transformation, and then use image matching to perform center positioning within the mapped area to determine the center coordinates of the blind hole.
[0122] The hole depth calculation module is used to calculate the hole depth of blind holes based on the grayscale characteristics of the 2D grayscale image in the central coordinate region and using 3D height data.
[0123] The blind hole quality evaluation module is used to comprehensively evaluate and classify the quality of blind holes based on hole depth calculation results, 3D morphological features and 2D grayscale information.
[0124] Specific limitations regarding the blind hole depth measurement system based on distributed camera 2D and 3D can be found in the limitations of the blind hole depth measurement method described above, and will not be repeated here. It should be noted that each module in the above measurement system corresponds to steps S1 to S5 in the above measurement method. Multiple modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1 above.
[0125] It is understandable that the aforementioned measurement system is primarily applied to the online quality inspection stage of PCB / HDI blind via board manufacturing. In its specific implementation, the distributed cameras can be arranged along the production line track gantry to form a visual inspection station covering the entire board surface. After the conveyor belt transports the blind via board to be inspected to the inspection station, the system automatically triggers the laser and camera to complete the image acquisition and processing process.
[0126] The data acquisition module, 3D reconstruction module, center positioning module, hole depth calculation module, and blind hole quality evaluation module can all be implemented using a dedicated software system installed on the production control computer. Measurement results can be uploaded to the factory's Manufacturing Execution System (MES) in real time for statistical process control, and simultaneously drive downstream sorting devices to classify boards of different quality grades.
[0127] This system can be integrated into existing production lines to detect the depth and quality of blind vias, replacing the traditional manual sampling and slicing inspection method. It effectively improves production efficiency and product consistency, providing a reliable automated inspection solution for high-end PCB manufacturing.
[0128] In another embodiment of the present invention, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, implements the steps of the blind hole plate depth measurement method as described in Embodiment 1.
[0129] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0130] In addition, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0131] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for measuring the depth of holes in a blind hole plate based on distributed cameras 2D and 3D, characterized by, The method comprises: projecting a laser fringe onto the blind hole plate by a laser, and collecting a laser fringe image and a 2D gray image of the blind hole plate by a distributed camera; determining a center extraction algorithm according to pixel gray distribution of the laser fringe in a preset window on the image, to extract 2D image coordinates of the center point of the laser fringe, and determining 3D height data of the blind hole plate according to the 2D image coordinates; the center extraction algorithm according to pixel gray distribution of the laser fringe in a preset window on the image, to extract 2D image coordinates of the center point of the laser fringe, comprises: traversing pixel points on the laser fringe, and when gray values of continuous multiple pixel points in the preset window are all greater than a first threshold value, it is determined that the region is an overexposure region, otherwise it is determined to be an unsaturated region; in the unsaturated region, a 2D image coordinate of the center of the laser fringe is extracted by using a Gaussian fitting method, and is realized by the following formula: ; wherein x is a pixel position perpendicular to the direction of the laser fringe, f(x) is the light intensity gray at the position, a is a peak intensity, b is a sub-pixel level longitudinal coordinate of the center point of the laser fringe, c is a standard deviation of Gaussian distribution, and e is a base number of a natural logarithm; parameters a, b and c are solved by a least square method; in the overexposure region, the center of the laser fringe is extracted by using a gray barycenter method, and is realized by the following formula: ; wherein g i is the gray value of the i-th pixel point, is the integer pixel vertical coordinate of the i-th pixel point, and U is the sub-pixel level vertical coordinate of the center point of the laser stripe. based on the 3D height data and positioning holes on the blind hole plate, coordinate mapping is performed by affine transformation, center positioning is performed in the mapped region by using image matching, and a center coordinate of the blind hole is determined; according to gray features of the 2D gray image in the center coordinate region, hole depth calculation of the blind hole is performed by using the 3D height data.
2. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 1, characterized in that, the 3D height data of the blind hole plate determined according to the 2D image coordinates, comprises: the 2D image coordinates are input into a laser triangulation model calibrated in advance, 3D space coordinates of each point on the surface of the blind hole plate are calculated, and the 3D height data is generated.
3. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 1, characterized in that, the coordinate mapping based on the 3D height data and the positioning holes on the blind hole plate by affine transformation, comprises: an affine transformation model is constructed based on coordinates of at least four positioning holes on the blind hole plate in an actual image and coordinates of the positioning holes in a standard drawing; the coordinates of the positioning holes in the standard drawing are mapped to an image coordinate system corresponding to the 3D height data, and are realized by the following formula: ; wherein x' is a horizontal coordinate of an actual image hole, y' is a vertical coordinate of the actual image hole, x is a horizontal coordinate of a standard image hole, y is a vertical coordinate of the standard image hole, and A is an 8-parameter transformation matrix.
4. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 3, characterized in that, the center positioning in the mapped region by using image matching, to determine the center coordinate of the blind hole, comprises: in the mapped region, a convolution kernel matched with a three-dimensional topography of a standard blind hole is constructed; a response map of the convolution kernel and the 3D height data in the region is calculated, and a peak point of the response map is determined as a candidate point of the center of the blind hole; a clustering algorithm is used for clustering analysis on all candidate points, and a clustering center is formed based on an optimal clustering number; Calculate the Euclidean distance between each candidate point and the cluster center to which it belongs. If the distance is greater than the preset deviation limit, the point is determined to be an outlier and is removed. The final cluster center coordinates are determined as the center coordinates of the blind hole.
5. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 4, characterized in that, The clustering algorithm is used to analyze the clustering of all candidate points, including: Traverse the preset number of candidate clusters. For each candidate number, perform clustering and calculate the average silhouette coefficient of this clustering. Compare the average silhouette coefficients under different candidate numbers, and determine the candidate number corresponding to the highest coefficient as the optimal cluster number. The silhouette coefficient s of a single sample point is calculated as follows: ; where M is the average distance of the sample point to other points in its own cluster, and N is the average distance of the sample point to points in other clusters.
6. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 1, characterized in that, The 3D height data is used to calculate the hole depth of the blind hole based on the gray level features of the 2D gray level image in the center coordinate region, including: Calculate the proportion of pixels with a gray value below a second preset threshold in a predetermined region around the center coordinates. If the proportion is below a third preset threshold, it is determined to be a measurable blind hole, and a quadratic surface is fitted in the 3D height data based on a quadratic surface model in the neighborhood of the center coordinates to calculate the hole depth. If the proportion is above the third preset threshold, it is determined to be an unmeasurable blind hole. The quadratic surface model is as follows: ; (x, y) is the plane coordinate of the pixel point, z is the corresponding height value, and the parameters are solved by the least square method , , , , , The difference between the extreme point height of the quadric surface and the reference height of the plate surface is taken as the actual hole depth.
7. The distributed camera 2D and 3D based blind hole plate hole depth measurement method according to claim 6, characterized in that, The method further includes: Based on the quadratic surface used for hole depth calculation, the lateral curvature and longitudinal curvature of the bottom of the blind hole are calculated, and if any of the curvatures exceeds a preset range, it is determined to be a topographic anomaly. Based on the 2D gray level image, the gray level uniformity of the hole wall region is analyzed, and if the gray level standard deviation exceeds a preset standard deviation threshold, it is determined to exist over-plating or under-plating defects. The quality of the blind hole is divided into multiple levels, including "qualified", "repairable" and "scrap", based on the deviation of the hole depth from the standard depth, the topographic anomaly and the filling defects.
8. A distributed camera 2D and 3D based blind hole plate hole depth measurement system for implementing the steps of the blind hole plate hole depth measurement method according to any one of claims 1-7, characterized in that, The system includes: A data acquisition module for projecting a laser fringe onto a blind hole plate using a laser, and collecting a laser fringe image and a 2D gray level image of the blind hole plate using a distributed camera; A 3D reconstruction module for determining a center extraction algorithm based on the pixel gray level distribution of the laser fringe in a preset window on the image, to extract the two-dimensional image coordinates of the laser fringe center point, and determine the 3D height data of the blind hole plate based on the two-dimensional image coordinates; A center positioning module for mapping coordinates through affine transformation based on the 3D height data and the blind hole on the blind hole plate, and positioning the center in the mapped region to determine the center coordinates of the blind hole; A hole depth calculation module for calculating the hole depth of the blind hole using the 3D height data based on the gray level features of the 2D gray level image in the center coordinate region.
9. A computer-readable storage medium, characterized in that, A computer program is stored, which is executed by a processor to implement the steps of the blind hole plate hole depth measurement method of any one of claims 1-7.
Citation Information
Patent Citations
Method for measuring hole depth of blind hole of blind hole plate and related device
CN115713553A
Circuit board blind hole quality detection method and system
CN116295047A