A hierarchical denoising and edge-preserving inpainting method for PCB fusion height map

CN122675673APending Publication Date: 2026-09-01SUZHOU SANDI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610803642.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-05
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

[0010]本发明提供一种面向PCB融合高度图的分级去噪与保边填补方法,用于解决融合高度图中孤立噪点、低置信度区域、断裂空洞和边界失真并存的问题,使得处理后的高度图在保持电子元件轮廓、芯片引脚边缘以及元件与PCB底板高度台阶特征的前提下,提高高度结果的完整性、连续性和稳定性

Benefits of technology

[0023] In summary, the present invention has the following beneficial effects: by classifying the confidence level of the fused height map, over-processing of high-confidence regions can be avoided, thus improving the fidelity of the results; by first removing statistical outliers and then repairing holes, the contamination of the filling results by abnormal noise can be reduced; by adopting edge-preserving filling that favors the low-value side, cross-boundary misfilling of electronic component edges, chip pins, and the interface between the base plate can be effectively reduced; through multi-stage, multi-scale repair, both fine restoration of small gaps and continuous restoration of large holes can be achieved; by performing boundary smoothing after filling, the component outline and height steps can be maintained while reducing burrs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122675673A_ABST
    Figure CN122675673A_ABST
Patent Text Reader

Abstract

This invention discloses a hierarchical denoising and edge-preserving filling method for PCB fusion height maps, comprising: acquiring a PCB fusion height map and its corresponding confidence map, wherein the confidence map characterizes the confidence level of each pixel height value; dividing the fusion height map into multiple confidence level regions based on the confidence map, and performing differentiated denoising processing on regions of different confidence levels; for the void regions formed after denoising, using an asymmetric weighting strategy biased towards the local low-value side for edge-preserving filling, so that the filling value is dominated by low-height-value pixels in the neighborhood, thereby suppressing the diffusion of high-side height values ​​to low-side regions, protecting the accuracy of high-confidence regions through confidence-driven hierarchical denoising, and avoiding cross-boundary misfilling at component edge height steps through asymmetric filling biased towards the low-value side, thus maintaining component contour and height boundary features while restoring continuity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of PCB 3D inspection, and in particular to a hierarchical denoising and edge-preserving filling method for PCB fusion height maps. Background Technology

[0002] In PCB 3D inspection, multiple height maps of the same target area are often obtained using structured light, phase measurement, or multi-optical-mechanical collaborative measurement methods. These are then fused to obtain a fused height map with higher coverage and better stability. This type of fusion method can alleviate problems such as single-view occlusion, localized reflections, and insufficient signal-to-noise ratio to some extent. However, the fused height map still tends to have the following defects in the transition areas at the edges of electronic components:

[0003] (1) Isolated noise and outlier height values ​​caused by uneven local reflection, occlusion or phase calculation fluctuations;

[0004] (2) Low confidence areas are formed due to insufficient consistency of height results from different optical engines at the same location;

[0005] (3) Due to the voids, fractures and discontinuities formed in the low-confidence areas during the subsequent cleanup process;

[0006] (4) Due to the obvious height transition and sharp contour between the resistor body edge, chip pin side edge and component and PCB base plate, if uniform smoothing or ordinary interpolation is used to fill the hole, cross-boundary diffusion is likely to occur, causing problems such as component contour being smoothed, pin root transition distortion, and base plate area being incorrectly raised.

[0007] In existing technologies, the processing of fused height maps typically involves direct uniform filtering, uniform interpolation, or one-time hole filling. These approaches fail to differentiate between regions with varying confidence levels within the height map, nor do they differentiate between ordinary flat areas and height transition boundary regions. Specifically, measurement data in high-confidence regions already possess high reliability; applying the same level of denoising might actually diminish the sharp geometric features of component edges. Furthermore, in areas with significant height steps, such as the interface between components and the base plate, using conventional interpolation and hole-filling algorithms aimed at smooth transitions can cause high height values ​​from the component side to diffuse into lower-side void areas through the filling operation, resulting in the base plate area being incorrectly elevated and compromising the authenticity of the height steps.

[0008] While some edge-preserving filtering algorithms (such as bilateral filtering and guided filtering) exist in the field of image processing, which can preserve the edges of grayscale or depth images while denoising or smoothing, these algorithms essentially still employ the idea of ​​symmetrical weighting and are not specifically designed for the physical requirement in height maps that "when filling holes, the filling value should belong to the lower surface rather than being between the high and low sides." In PCB fusion height maps with significant height transitions, when missing areas need to be filled, simply applying edge-preserving filtering or symmetrical interpolation will still result in cross-boundary contamination due to the presence of two different physical surface height values ​​in the neighborhood.

[0009] In summary, existing technologies struggle to simultaneously address the coexistence of isolated noise points, low-confidence regions, broken voids, and boundary distortion in PCB fusion height maps. This requires addressing multiple demands simultaneously, including removing significant outliers, restoring continuity of void areas, maintaining the outer contours and pin edges of electronic components, and preventing cross-boundary incorrect filling. Therefore, a post-processing method is urgently needed that can differentiate between regions of varying confidence levels in the PCB fusion height map and effectively prevent cross-boundary diffusion of height from higher to lower areas during void filling. Summary of the Invention

[0010] This invention provides a hierarchical denoising and edge-preserving filling method for PCB fusion height maps, which solves the problems of isolated noise points, low-confidence areas, fracture voids and boundary distortion coexisting in fusion height maps. This improves the integrity, continuity and stability of the height results while maintaining the outline of electronic components, the edges of chip pins and the height step characteristics of components and PCB base plates.

[0011] To achieve the above objectives, the present invention adopts the following technical solution:

[0012] A hierarchical denoising and edge-preserving filling method for PCB fusion height maps includes the following steps: obtaining a PCB fusion height map to be processed, and a confidence map corresponding to the fusion height map, representing the confidence level of the height value of each pixel position; based on the confidence map, dividing the fusion height map into multiple regions with different confidence levels, and performing denoising processing of intensity matching the confidence level of the region on each region, wherein the denoising processing intensity is higher for regions with lower confidence levels; for the void regions formed after denoising processing, performing edge-preserving void filling: for the pixel to be filled, obtaining the height value of the effective pixels in its neighborhood, and calculating the filling value using an asymmetric weighting strategy biased towards the local low-value side, so that the filling value approaches the local low-value side surface in the neighborhood, thereby suppressing the diffusion of the high-side surface height to the low-side region during the filling process.

[0013] Furthermore, the confidence map is directly derived from the fusion stage of the multi-optical-mechanism height results, and is determined by the validity and consistency of the height values ​​of different optical-mechanisms at the same pixel position.

[0014] Furthermore, before performing the step of hierarchical denoising based on the confidence map, the method further includes performing a first-stage statistical outlier removal on the fused height map: for each pixel, based on the local mean and local standard deviation of the effective pixels in its neighborhood, pixels whose height value deviates from the local statistics by a preset threshold are identified as outliers, and the pixels identified as outliers are set as invalid values ​​or values ​​to be repaired.

[0015] Furthermore, the statistical outlier removal adopts the following judgment condition: for the current pixel, let the local mean of the effective pixels in its neighborhood be 1. Local standard deviation is If satisfied If the value is an outlier, then the pixel is determined to be an outlier; where, This is the height value of the current pixel. The outlier determination coefficient. This is the minimum fluctuation threshold.

[0016] Furthermore, the asymmetric weighting strategy that biases towards the local low-value side includes: for any valid pixel in the neighborhood of the pixel to be filled, the reciprocal of the power of the absolute value of the difference between its height value and the minimum height value in the neighborhood is used as the weight of the pixel, so that the closer the height value is to the minimum height value in the neighborhood, the greater the contribution weight of the pixel in the filling calculation.

[0017] Furthermore, the asymmetric weighting strategy determines the weight of each effective pixel in the neighborhood using the following formula. : in, For the neighboring region The height value of each effective pixel. It is the minimum effective pixel height value within the neighborhood. These are the preset weight control parameters. This is a preset minimum constant.

[0018] Furthermore, the fill value of the pixel to be filled Calculate using the following formula:

[0019] The summation process iterates through all valid pixels in the neighborhood.

[0020] Furthermore, after performing edge-preserving void filling on the void areas formed after noise reduction, the process also includes multiple rounds or multi-scale filling steps based on the defect size and region level.

[0021] Furthermore, after completing the hole filling, the process also includes performing boundary smoothing and result constraints on the filling results: the height map after filling is smoothed by adopting an edge-preserving method that takes into account both spatial distance and height differences, and the original clearly invalid areas are rewritten as invalid markers.

[0022] Furthermore, after obtaining the fused height map and confidence map and before performing the hierarchical denoising, the method further includes detecting invalid regions in the fused height map and generating a defect region mask, and performing a morphological cleaning operation on the defect region mask.

[0023] In summary, the present invention has the following beneficial effects: by classifying the confidence level of the fused height map, over-processing of high-confidence regions can be avoided, thus improving the fidelity of the results; by first removing statistical outliers and then repairing holes, the contamination of the filling results by abnormal noise can be reduced; by adopting edge-preserving filling that favors the low-value side, cross-boundary misfilling of electronic component edges, chip pins, and the interface between the base plate can be effectively reduced; through multi-stage, multi-scale repair, both fine restoration of small gaps and continuous restoration of large holes can be achieved; by performing boundary smoothing after filling, the component outline and height steps can be maintained while reducing burrs. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of a typical defect in the transition area at the edge of an electronic component in a PCB fusion height diagram.

[0026] Figure 2 This is a flowchart illustrating the overall process of the method of the present invention.

[0027] Figure 3 A schematic diagram illustrating the confidence level of high consistency among multiple optical engines;

[0028] Figure 4 Comparison images before and after mask generation and cleaning of invalid areas;

[0029] Figure 5 This is a diagram illustrating the removal of outliers.

[0030] Figure 6 A schematic diagram illustrating the differentiated processing of multi-level confidence regions;

[0031] Figure 7This is a comparison chart of ordinary mean fill and edge-preserving fill;

[0032] Figure 8 This is a before-and-after comparison image of the repair and smoothing process. Detailed Implementation

[0033] This invention provides a hierarchical denoising and edge-preserving filling method for PCB fusion height maps. This method is applied to a multi-optical-mechanical structured light 3D measurement system. It performs post-processing optimization on PCB height maps obtained by multi-view, multi-optical-channel, or multi-optical-mechanical collaborative measurement and fusion to solve the problems of isolated noise points, low-confidence areas, fracture voids, and boundary distortion coexisting in the fusion height map. This improves the integrity, continuity, and stability of the height results while maintaining the outline of electronic components, the edges of chip pins, and the height step characteristics between components and the PCB substrate.

[0034] This invention provides a hierarchical denoising and edge-preserving filling method for PCB fused height maps. This method can be applied to multi-optical-mechanical structured light 3D measurement systems to post-process PCB height maps obtained through multi-view, multi-optical-channel, or multi-optical-mechanical collaborative measurements and fusion. This method addresses the coexistence of isolated noise points, low-confidence regions, fractures, and boundary distortions in the fused height map, improving the integrity and continuity of the height results while preserving the outlines of electronic components, chip pin edges, and the height step characteristics between components and the PCB substrate.

[0035] Please see Figure 2 , Figure 2 This is a general flowchart of the method of the present invention. The method specifically includes the following steps.

[0036] S1: Obtain the PCB fusion height map to be processed, and the confidence map corresponding to the fusion height map, wherein the confidence map is used to characterize the confidence level of the height value of each pixel position in the fusion height map.

[0037] The PCB fusion height map, as mentioned above, refers to a comprehensive height map obtained by fusing the height measurements of the same PCB target area from different angles using multiple optical engines. It is understandable that during the fusion process, the height values ​​calculated by different optical engines at the same pixel location may differ due to factors such as local occlusion, differences in surface reflectivity, blind spots, or phase calculation fluctuations. This inevitably results in some areas with low data reliability in the fusion height map. These low-reliability areas are typically distributed at the edges of electronic components, the roots of chip pins, and the height transition areas between components and the PCB substrate.

[0038] Please see Figure 1 , Figure 1 This diagram illustrates typical defects in the transition area at the edge of electronic components in a PCB integration height map. It shows burrs and noise near the resistor body edge, low-confidence gaps at the junction of chip leads and the base plate, fractures and voids near the component sidewall or lead root, and component height steps that are easily smoothed out after uniform smoothing. Because there are significant height transitions and sharp contours between the resistor body edge, chip lead side edge, and the component and PCB base plate, improper handling of these areas can easily lead to problems such as smoothed component contours, distorted lead root transitions, and incorrectly raised base plate areas.

[0039] The confidence map and the fused height map are spatially correlated, meaning that each pixel value in the confidence map corresponds to the confidence level of the height value at the same location in the fused height map. The confidence map can be directly derived from the multi-optical-mechanism height fusion stage, determined by the validity and consistency of the height values ​​at the same pixel location from different optical mechanisms.

[0040] Specifically, for the same pixel location, if two height results exist and both are valid, the confidence level of that location can be determined based on whether the height difference between the two exceeds a preset consistency threshold. Let the two height values ​​at the same pixel location be... and The corresponding input confidence levels are respectively and The preset consistency threshold is The output height after pairing and fusion can be expressed as:

[0041]

[0042] in, This represents the height measurement value from the first optical engine at the same pixel location; This represents the height measurement value from the second optical engine at the same pixel location; express The corresponding input confidence level, that is, the evaluation of the reliability of the measurement value by the first optomechanical output alone; express The corresponding input confidence level, that is, the evaluation of the reliability of the measurement value by the second optomechanical output alone; A preset consistency threshold is used to determine whether the two height measurement results can be considered to corroborate each other; The height value of the preset priority channel; This is the output height of the pixel after pairing and fusion.

[0043] In one specific embodiment, The value can be set to 2 to 3 times the single-optical-machine measurement accuracy (such as the standard deviation of height measurement calibrated by the system). If the standard deviation of height measurement calibrated by the system is 5 micrometers, then... It can be set from 10 micrometers to 15 micrometers; for measuring equipment with different accuracy levels, It can be scaled accordingly. When the height difference between the two paths exceeds the consistency threshold, it will scale accordingly. This serves as the fused output height for that pixel.

[0044] The corresponding fusion confidence level can be calculated using the following formula:

[0045] in, This represents the fusion confidence level at that pixel location, and its value ranges from [value missing]. , The closer the result is to 1, the more consistent the measurements from the two optical engines are, and the more reliable the data. It can be seen that when the height difference between the two paths... The smaller the size, the higher the fusion confidence level. The closer the result is to 1, the higher the consistency between the two optomechanical measurements; when the height difference between the two paths approaches the threshold δ, the fusion confidence score increases. The value approaches 0.5; when the height difference between the two paths exceeds the threshold δ, the output height of the preset priority channel is retained. This location is then considered a region of low consistency.

[0046] If only one height value is valid, the valid height is retained and the corresponding single-path confidence score is inherited. When there are three or four optical engines, the preset paired optical engines can be fused in pairs to generate candidate height values ​​and candidate confidence scores. Then, based on the consistency between the candidate results, the next stage of fusion is performed to finally form a fused height map covering the entire map and its corresponding confidence score map.

[0047] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the confidence level of high consistency among multiple optical machines, showing the high consistency high confidence zone, the medium consistency transition zone, and the low consistency low confidence zone.

[0048] The confidence map generated in the above manner directly reflects the reliability of the corresponding height values: regions with higher confidence levels indicate more consistent multi-optical measurement results and more reliable data; regions with lower confidence levels indicate greater discrepancies in multi-optical measurement and less reliable data. By identifying low-confidence regions, hierarchical denoising and edge-preserving filling processes are performed in subsequent steps.

[0049] In a preferred embodiment, after obtaining the fused height map and confidence map and before performing hierarchical denoising, the steps of invalid region detection and mask cleaning may be included.

[0050] Specifically, invalid height values, out-of-range height values, or obviously abnormal height values ​​in the fused height map are detected to generate an initial defect region mask. The invalid height values ​​can be preset invalid constants (such as marking pixels that did not have a measured effective height as -9999 or NaN, etc.), or regions below the minimum usable height threshold or above the maximum usable height threshold (e.g., in PCB inspection scenarios, height values ​​below the PCB substrate plane exceeding a certain margin or height values ​​exceeding the theoretical maximum height of the component can be considered invalid).

[0051] To prevent individual discrete defects from directly affecting subsequent partition repair, morphological cleaning operations can be performed on the initial defect region mask. For example, circular or square structuring elements with a radius of 1 to 3 pixels can be used to perform morphological opening operations on the mask to break weak connections and remove pseudo-defect regions with too small an area; alternatively, a connected component area threshold (such as 10 to 50 pixels) can be directly set to remove isolated connected components with an area smaller than the threshold from the mask, retaining the real areas to be repaired.

[0052] Please see Figure 4 , Figure 4 The images show a comparison before and after mask generation and cleaning of invalid regions. They illustrate the original distribution of invalid points, the actual area to be repaired after mask cleaning, and the effective boundary areas retained near component edges or pin edges. Mask cleaning effectively preserves the actual areas to be repaired near component edges and pin roots, providing more accurate defect area segmentation for subsequent steps.

[0053] S2: Based on the confidence map, the fused height map is divided into multiple regions with different confidence levels, and denoising processing with an intensity matching the confidence level of the region is performed on each region with a different confidence level. The lower the confidence level of the region, the higher the intensity of the denoising processing is performed; the higher the confidence level of the region, the lower the intensity of the denoising processing is performed.

[0054] Specifically, the division of the region can be achieved using one or more preset confidence thresholds. In one specific embodiment, the following grading strategy can be set for the confidence value range: the first threshold, the second threshold, and the third threshold are set to values ​​of 200, 128, and 50, respectively (in an 8-bit representation of confidence quantification from 0 to 255). Pixels with a confidence level higher than the first threshold (>200) are classified as high-confidence regions. These regions have highly consistent optical-mechanical measurements, and the data is reliable. They typically correspond to flat base plate areas or the top plane of components. Pixels with a confidence level between the first and second thresholds (128 to 200) are classified as low-confidence regions. These regions have slight measurement discrepancies but are generally acceptable. Pixels with a confidence level between the second and third thresholds (50 to 128) are classified as very low-confidence regions. These regions have significant measurement discrepancies, and the data reliability is questionable. Regions with a confidence level lower than the third threshold (<50) are marked as regions to be repaired and directly transferred to the subsequent filling process.

[0055] The threshold values ​​mentioned above are merely examples. In specific applications, they can be flexibly adjusted based on the noise characteristics of the measuring equipment, image quality, and different requirements for detection accuracy. For example, in applications with high accuracy requirements, the threshold can be appropriately increased to include more areas in the low-confidence category and apply stronger repair processing; in applications with high speed requirements and where a certain degree of error is acceptable, the threshold can be appropriately decreased to reduce the processing area. The number of levels can also be flexibly set according to actual needs, with at least two levels.

[0056] After region segmentation, denoising processes of varying intensities are applied to regions with different confidence levels. For high-confidence regions, only the original height values ​​are retained, or a very slight edge-preserving smoothing process is applied (e.g., mean filtering using only a tiny window with a radius of 1 pixel). This is because the measurement data in these regions already possesses high reliability, with consistent multi-optical measurement results; excessive processing may actually lose the sharp geometric features of component edges. For lower-confidence regions, moderate-intensity local statistical denoising (e.g., outlier removal based on neighborhood mean and standard deviation) is employed to moderately suppress noise while preserving basic structural features. For extremely low-confidence regions, a stronger denoising process is applied. For example, a larger neighborhood window (such as a window with a radius of 5 to 7 pixels) can be used for statistical filtering; alternatively, a local consistency test can be used, which involves analyzing the continuity of height values ​​within the window. If the pixel height values ​​within the window exhibit a clear bimodal or multimodal distribution, and the height difference between the peaks exceeds a preset step threshold (such as 50 micrometers), then the region is determined to be a height transition boundary region, requiring careful handling to protect the edges. If the pixel height values ​​within the window exhibit a unimodal distribution with a large variance, it indicates a noise-dominated flat region, and the current pixel value can be replaced with the median or truncated mean within the window. Pixels in extremely low confidence regions with confidence levels below the limit threshold can be directly marked as invalid values ​​and will be uniformly repaired in the subsequent filling stage.

[0057] Please see Figure 6 , Figure 6 This diagram illustrates the differentiated processing of multi-level confidence regions, showing the processing relationship where high-confidence regions are directly preserved, medium- and low-confidence regions undergo local denoising, and extremely low-confidence regions are subjected to a stronger denoising and filling process.

[0058] Existing post-processing methods for fused heightmaps typically apply a uniform filtering or denoising operation to the entire map. This approach fails to differentiate between high-confidence and low-confidence regions, or between ordinary flat areas and height transition boundary regions. Our method, however, does not perform uniform processing on the entire map. Instead, it layers the heightmap based on confidence information and applies different processing strategies to different layers. This partitioned and hierarchical processing concentrates post-processing resources on low-quality areas, avoiding unintended damage to high-quality areas, thus achieving a balance between denoising and fidelity preservation.

[0059] In a preferred embodiment, before performing the aforementioned hierarchical denoising, a first-stage statistical outlier removal can be performed on the fused height map to pre-emptively remove isolated peaks and anomalous pits that significantly deviate from the local surface, reducing the risk of these extreme outliers interfering with subsequent hierarchical denoising and hole filling. The first-stage denoising is preferably performed on the entire image or a large area.

[0060] Specifically, this statistical outlier removal method uses local statistics rather than fixed threshold pruning. For a pixel to be detected, the height values ​​of all valid pixels within its preset neighborhood window are obtained. Let the current pixel position be... Its neighborhood window is The number of effective pixels in the neighborhood is Then the local mean of the neighborhood and local standard deviation Calculate according to the following formulas:

[0061]

[0062] in, Indicates the current detected pixel position (i.e., coordinate index); Indicated by The set of pixels contained in a preset neighborhood window centered on the image. In one specific embodiment, the size of the neighborhood window can be set to a rectangular area of ​​3×3 to 5×5 pixels to accommodate the resolution and component feature size of most PCB images. Represents the neighborhood window The total number of valid pixels within; Representing the neighborhood Inner The height value of each effective pixel; This represents the arithmetic mean of the height values ​​of all valid pixels in the neighborhood, i.e., the local mean.

[0063]

[0064] in, The standard deviation represents the standard deviation of all valid pixel height values ​​within the neighborhood, also known as the local standard deviation, which measures the dispersion of height values ​​within the neighborhood.

[0065] If the height value h of the current pixel satisfies the following formula, it is identified as an outlier and set as an invalid value or a value to be repaired:

[0066]

[0067] in, This indicates the height value of the currently detected pixel; The meaning is the same as above; it is the local mean of the neighborhood of that pixel. The meaning is the same as above; it represents the local standard deviation of the pixel's neighborhood. This is the outlier determination coefficient, used to control the strictness of the determination threshold.

[0068] In one specific embodiment, It can be set between 2.0 and 3.0. =2.5 is a typical default value—based on the properties of the normal distribution, the probability of data falling outside the mean ± 2.5 standard deviations is approximately 1.2%, which can effectively filter out true outliers without excessively rejecting data within the normal fluctuation range; when the noise level in the application scenario is high, it can be appropriately increased. (For example, use 3.0) to relax the judgment conditions and reduce false positives; when high data accuracy is required, the value can be reduced. (e.g., 2.0) to enhance the screening effect.

[0069] The minimum fluctuation threshold can be set based on the calibration accuracy of the measurement system, for example, 1 to 2 times the standard deviation of the system height measurement. If this standard deviation is 5 micrometers, then... It can be set to 5 to 10 micrometers. In near-zero conditions (such as on a smooth component top or bottom plane), even minute measurement fluctuations may trigger the judgment condition, but these fluctuations are within an acceptable range. The introduction of this allows for a reasonable minimum threshold when the standard deviation is extremely small.

[0070] In another implementation, isolation detection can be added, i.e., when the neighborhood... When the proportion of effective pixels is lower than the preset isolation ratio threshold (for example, when the proportion of effective pixels is lower than 30% to 50%, it indicates that the pixel is in a sparse area or at the edge of a large area of ​​hole, and its statistical information is unreliable), the pixel is also judged as an abnormal pixel and marked as an invalid value, to be processed uniformly in the subsequent filling stage.

[0071] Please see Figure 5 , Figure 5 This is a schematic diagram for statistical outlier removal, showing the statistical relationship between the central noise point within a local window and the surrounding stable surface, as well as the abnormal height points that are removed after being judged.

[0072] Understandably, removing abnormal height values ​​that deviate significantly from the local surface through this preprocessing step allows subsequent graded denoising and edge-preserving filling to be performed on cleaner input data, reducing the risk of interference from spikes and pits during the hole-filling stage.

[0073] S3: Perform edge-preserving void filling on the void areas formed after noise reduction processing.

[0074] After the hierarchical denoising process is completed, pixels marked as invalid in the original low-confidence region, as well as the existing invalid regions, will form several holes. These holes are filled to restore the integrity and continuity of the heightmap. In this embodiment, an asymmetric weighting strategy biased towards the local low-value side is used for edge-preserving filling.

[0075] Specifically, let the current position of the pixel to be filled be... Take Let the preset neighborhood window be centered, and let the set of height values ​​of all valid pixels within this neighborhood window be denoted as . ,from Find the minimum and maximum height values ​​in the range, and denote them as follows: and :

[0076] ,

[0077] in, Indicates the coordinate position of the pixel to be filled; Indicated by The set of all valid pixel height values ​​within the central neighborhood window; This represents the minimum height value in the set, which typically corresponds to the reference height of the side surface of the base plate in the interface area between the component and the base plate; This represents the maximum height value in the set, which typically corresponds to the height of the top surface of the component in the boundary area between the component and the base plate. In one specific embodiment, the size of the neighborhood window can be set to 5×5 to 11×11 pixels. A smaller window can be used when the holes are small and densely distributed (such as narrow gaps between pins), and a larger window can be used when the holes are large (such as large low-confidence areas) to obtain sufficient effective neighborhood information.

[0078] For any valid pixel in the neighborhood, let its height value be... The weight assigned to that pixel in the filling calculation. Determined by the following formula:

[0079]

[0080] in, Indicates the number of neighbors within the neighborhood. The height value of each effective pixel; The meaning is the same as above, which is the minimum value of the set of effective pixel height values ​​in the neighborhood; These are preset weight control parameters used to adjust the degree of bias towards the lower value side; This is a preset minimum constant used only to prevent the denominator from having a zero value.

[0081] The above weighting formula uses the minimum height value of the neighborhood. As a reference benchmark, it measures the deviation of the height value of each neighboring pixel from the lowest point. When the height value of a neighboring pixel is exactly equal to... hour, The pixel receives the highest weight value; when the height value of a neighboring pixel is far away... Approaching hour, As the value increases, in Under the influence of this effect, the weight of the pixel decreases accordingly. Therefore, the closer the height value of a pixel in the neighborhood is to the local minimum, the greater its contribution to the filling result; the further the height value of a pixel deviates from the local minimum, the smaller its contribution to the filling result.

[0082] In one specific embodiment, The value can be a real number between 1.0 and 3.0, preferably k=2.0. For scenarios with large boundary height steps (such as the junction between a high component and the base plate, where the step height exceeds 500 micrometers), the value of k can be appropriately increased, such as k=2.5 to 3.0, to enhance the bias effect; for areas with relatively gentle height changes, the value of k can be decreased, such as k=1.0 to 1.5, to obtain a smoother filling transition. Possible values to A very small positive number between these two values, much smaller than typical height measurements, to ensure that... When the value is greater than 0, the impact on weight calculation is negligible; only when the value is greater than 0 is the impact on weight calculation negligible. =0 serves to prevent the denominator from being zero.

[0083] After calculating the weights of each effective pixel in the neighborhood, the filling value for the pixel to be filled is given by the following formula:

[0084]

[0085] in, Indicates the pixel to be filled The fill value is a weighted average of the height values ​​of all valid pixels in the neighborhood; The meaning is the same as above, referring to the th neighboring domain. The weight of each effective pixel; The meaning is the same as above, referring to the th neighboring domain. The height value of each effective pixel; The meaning is the same as above, for the purpose of A neighborhood window centered on the center; This indicates traversing the neighborhood. Summation is performed on all valid pixels within the range. Due to weighting... Designed in the aforementioned asymmetric manner, the weighted average is intentionally biased towards the lower value side in terms of numerical value.

[0086] The above filling process can be uniformly represented in the following segmented form:

[0087]

[0088] in, This represents the final output height value of the current pixel; This represents the height value of the current pixel in the original fused height map. If the current pixel is a valid pixel, its original height value is directly retained; if the current pixel is an invalid pixel to be filled, the filling value is calculated and assigned according to the asymmetric weighting method described above.

[0089] Understandably, near the boundary between electronic components and the PCB substrate, the neighborhood of a void often contains two types of pixels: one type is high-height pixels from the component side, representing the height of the component's top surface; the other type is low-height pixels from the substrate side, representing the height of the PCB substrate. These two types of pixels physically belong to different surfaces, and there should be a clear height jump between them, rather than a smooth numerical transition. When using conventional mean interpolation or symmetric weighted interpolation for filling, it's equivalent to establishing a non-existent continuous transition between two different physical surfaces. The high height value from the component side will diffuse into the void area through the filling operation, causing the void, which should be close to the substrate height, to be assigned an excessively high filling value. This results in the substrate area being incorrectly raised, blurring the height boundary between the component and the substrate, and affecting the accuracy of subsequent component positioning and pin coplanarity detection, which rely on precise height step information. In this method, a higher weight is given to the local low-value side, making the filling result numerically closer to the local low-value side surface within the neighborhood, thereby suppressing the risk of the high-side height of the component crossing the boundary and spreading into the low-side area.

[0090] Specifically, in a scenario where there is a void near the root of a resistor element's sidewall, the void's neighborhood is bordered by the top surface of the resistor body (higher height) on one side and the PCB substrate area (lower height) on the other. When using conventional average fill, the void is assigned an intermediate value between the high and low values, resulting in incorrect elevation of the substrate side. However, with the asymmetric weighted fill method described in this paper, the low-height pixels on the substrate side are given greater weight, while the weight of high-height pixels on the element side is significantly suppressed. The void's fill value is closer to the actual height of the substrate, maintaining a clear height step between the resistor body and the substrate, effectively avoiding cross-boundary incorrect fill.

[0091] See Figure 7 , Figure 7 This is a comparison chart of ordinary mean fill and edge-preserving fill.

[0092] In a preferred embodiment, a multi-round or multi-scale filling strategy can also be used for filling. This strategy is used to balance the fine filling of small gaps and narrow fractures with the restoration of connectivity for larger cavities.

[0093] Specifically, different sized filling windows can be used in different rounds of filling. In one specific embodiment, the first round of filling uses a smaller neighborhood window (e.g., 3×3 to 5×5 pixels) to finely repair narrow gaps and small notches. After the first round of filling, remaining void areas still marked as invalid in the height map are detected, and a second round of filling is performed using a larger neighborhood window (e.g., 9×9 to 15×15 pixels). Alternatively, a round of Gaussian weighted average filling based on spatial distance can be performed first (the weight depends only on the spatial distance between neighboring pixels and the pixel to be filled, without distinguishing between height values) to restore connectivity in large areas, and then the aforementioned edge-preserving filling biased towards the lower value side is performed to correct boundary transition areas. The window size is selected to match the image resolution and component feature size. For example, if the image lateral resolution is 10 micrometers per pixel, a 5×5 window corresponds to an actual range of approximately 50 micrometers × 50 micrometers, which is sufficient to cover narrow gaps in typical pin pitches. The window size, number of executions, and execution order of multi-round filling can be adjusted according to the component size, pin spacing, detection resolution, and target accuracy requirements of the PCB product.

[0094] After the void filling is completed, boundary smoothing can be performed on the filled height map. Boundary smoothing is used to eliminate any minor discontinuities or burrs that may remain at the edges of the filled area, while preserving the height step characteristics of the component edges.

[0095] Specifically, the boundary smoothing can be achieved using bilateral filtering, guided filtering, or other edge smoothing techniques that take into account differences in spatial distance and height values. Taking bilateral filtering as an example, its processing procedure is as follows:

[0096]

[0097] in, For smoothed pixel positions The height value at that location; This is the current position of the smoothed pixel; For Centered neighborhood window A specific pixel position within; Let be the Gaussian kernel function in the spatial domain, and its expression is: , This is a spatial domain parameter, with values ​​ranging from 2 to 5 pixels; Let be the range Gaussian kernel function, and its expression is: , This is a range parameter, taking values ​​from 1 / 3 to 1 / 2 of the typical height step value; and Pixels and Height value before smoothing; As the normalization factor, .

[0098] Within flat areas, the height values ​​differ. Very small, range kernel Approaching 1, the filter's weights on neighboring pixels primarily depend on spatial distance, smoothing out minor fluctuations; at height transition boundaries, the height value difference... Very large, value range kernel Approaching 0, the pixels on both sides of the boundary have extremely low weights and do not participate in each other's smoothing calculations, thus protecting the height step features of the element edge.

[0099] Furthermore, a height range constraint is applied to the output results, which limits the height value after filling or smoothing to within the actual physical measurement range (for example, cropping the height value to between the lowest height of the PCB substrate and the highest height of the component), and rewrites the areas explicitly marked as invalid in the original blended height map as invalid to ensure that the output results do not exceed the actual measurement range.

[0100] See Figure 8 , Figure 8 The image shows a comparison before and after repair and smoothing. After the above processing, an optimized height map suitable for detecting the boundaries of resistors, capacitors, chip packages, and chip pins is finally obtained.

[0101] When quantitatively evaluating the optimization results, the local profile error evaluation formula can be used:

[0102]

[0103] in, This represents the average error of the local profile. This represents the total number of profile sampling points used in the evaluation. To optimize the first The height value of each sampling point; For the first The reference height value of each sampling point can be obtained by calibration using high-precision measuring equipment (such as a laser confocal microscope or a contact profilometer) or by manual annotation.

[0104] As can be understood, through the above embodiments, this method utilizes confidence information to classify the fused height map, performs differentiated denoising on regions with different confidence levels, and protects high-confidence regions from accidental damage; by performing a phased process of first removing outliers and then repairing holes, it reduces the contamination of the filling by abnormal noise; by using asymmetric weighted filling biased towards the local low-value side, and allocating weights based on the minimum neighborhood height value, it makes the filled value approach the surface of the low-value side, solving the problem of incorrect elevation of the base plate caused by the cross-boundary diffusion of high-side height during the filling process; by using multi-round or multi-scale filling, it takes into account both fine restoration of small gaps and continuous restoration of large holes; by maintaining the smoothness of the filled boundary and the result constraint, it maintains the component outline and height steps while reducing burrs. This method is particularly suitable for PCB fused height map scenarios containing resistors, capacitors, chip bodies, chip pins, and obvious height transition boundaries between them and the PCB base plate.

[0105] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made using the content of the present invention specification, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A hierarchical denoising and edge-preserving filling method for PCB fusion height maps, characterized in that, Includes the following steps: Obtain the PCB fusion height map to be processed, and the corresponding confidence map representing the confidence level of the height value of each pixel position. Based on the confidence map, divide the fusion height map into multiple regions with different confidence levels, and perform denoising processing with an intensity matching the confidence level of the region for each region with different confidence levels. The denoising processing intensity is higher for regions with lower confidence levels. For the void regions formed after denoising processing, perform edge-preserving void filling: for the pixel to be filled, obtain the height value of the effective pixels in its neighborhood, and use an asymmetric weighting strategy biased towards the local low value side to calculate the filling value, so that the filling value approaches the local low value side surface in the neighborhood, so as to suppress the diffusion of the height of the high side surface to the low side region during the filling process.

2. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, The confidence map is derived directly from the fusion stage of the multi-optical-mechanism height results, and is determined by the validity and consistency of the height values ​​of different optical-mechanisms at the same pixel position.

3. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, Before performing the step of hierarchical denoising based on the confidence map, the method further includes performing a first-stage statistical outlier removal on the fused height map: for each pixel, based on the local mean and local standard deviation of the effective pixels in its neighborhood, pixels whose height value deviates from the local statistics by more than a preset threshold are identified as outliers, and the pixels identified as outliers are set as invalid values ​​or values ​​to be repaired.

4. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 3, characterized in that, The statistical outlier removal is based on the following criteria: For the current pixel, let the local mean of the effective pixels in its neighborhood be 1. Local standard deviation is If satisfied If the value is an outlier, then the pixel is determined to be an outlier; where, This is the height value of the current pixel. The outlier determination coefficient. This is the minimum fluctuation threshold.

5. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, The asymmetric weighting strategy that biases towards local low values ​​includes: for any valid pixel in the neighborhood of the pixel to be filled, the reciprocal of the power of the absolute value of the difference between its height value and the minimum height value in the neighborhood is used as the weight of the pixel, so that the pixel whose height value is closer to the minimum height value in the neighborhood has a greater contribution weight in the filling calculation.

6. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 5, characterized in that, The asymmetric weighting strategy determines the weight of each effective pixel in the neighborhood using the following formula. : in, For the neighboring region The height value of each effective pixel. It is the minimum effective pixel height value within the neighborhood. These are the preset weight control parameters. This is a preset minimum constant.

7. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 6, characterized in that, Fill value of the pixel to be filled Calculate using the following formula: The summation process iterates through all valid pixels in the neighborhood.

8. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, After performing edge-preserving void filling on the void areas formed after noise reduction, the process also includes multiple rounds or multi-scale filling steps based on the defect size and area level.

9. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, After the void filling is completed, the process also includes performing boundary smoothing and result constraints on the filling results: the height map after filling is smoothed by adopting an edge preservation method that takes into account both spatial distance and height differences, and the original clearly invalid areas are rewritten as invalid markers.

10. The hierarchical denoising and edge-preserving filling method for PCB fusion height maps according to claim 1, characterized in that, After obtaining the fused height map and confidence map, and before performing the hierarchical denoising, the method further includes detecting invalid regions in the fused height map and generating a defect region mask, and performing a morphological cleaning operation on the defect region mask.