A method and system for detecting three-dimensional topography of surface defects of a rubber encapsulation
Patent Information
- Application Number
- CN202611070427.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-18
- Publication Date
- 2026-10-09
AI Technical Summary
[0008]本发明的目的在于,提供一种橡胶包胶件表面缺陷三维形貌检测方法与系统,以解决现有技术因橡胶材料表面通常呈现低纹理、低对比度特性,复杂形貌,导致传统聚焦评价函数在此类表面上表现不稳定,难以准确计算聚焦度,以及效率较低的问题
[0035]本发明与现有技术相比的有益效果:该方法首先对待测包胶件进行图像序列采集,再对所获取的图像进行预处理,然后通过聚焦评价生成整个视场的深度图,再进行图像融合,识别并分割出缺陷区域,最终将深度图与缺陷区域配准叠加,计算缺陷的多维度量化参数,并将缺陷参数与预设的合格阈值进行比对,自动判定产品是否合格;该方法既提高了橡胶包胶件表面三维形貌检测的完整性,又提高了缺陷检测的精度与效率。
Smart Images

Figure CN122887840A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and precision measurement technology, and in particular to a method and system for detecting three-dimensional morphology defects on the surface of rubber-coated parts. Background Technology
[0002] Rubber-coated parts are widely used in the automotive, aerospace, and consumer electronics industries, and their surface quality directly affects the product's sealing performance, aesthetics, and lifespan. Common surface defects include scratches, dents, protrusions, impurities, and missing materials. Currently, the detection of these defects mostly relies on manual visual inspection or two-dimensional machine vision methods. Manual visual inspection is inefficient, highly subjective, and prone to missing defects; while two-dimensional vision methods can detect some texture and color defects, they cannot obtain three-dimensional geometric information such as the depth, height, and volume of the defects, making it difficult to quantify key quality indicators such as dent depth and protrusion height, and they are insensitive to minor but critical three-dimensional morphological defects. Shape from Focus (SFF) microscopy is a technique that reconstructs the three-dimensional morphology of an object's surface by analyzing image sequences acquired by a microscope lens at different focal planes. This technique has advantages such as non-contact operation, high precision, and relatively simple system structure, making it very suitable for surface morphology inspection with micron-level precision. However, directly applying it to the surface defect detection of rubber-coated parts faces several shortcomings:
[0003] Surface characteristics challenge: Rubber material surfaces typically exhibit low texture and low contrast characteristics, and may have areas of high reflection or light absorption. Traditional focus evaluation functions are unstable on such surfaces, making it difficult to accurately calculate focus.
[0004] Challenges of complex morphology: Defects have diverse shapes and may contain both steep edges and gentle areas, which places extremely high demands on the detail preservation and noise resistance of 3D reconstruction algorithms.
[0005] The challenge of balancing efficiency and accuracy: The fast pace of industrial production necessitates an algorithm that can quickly and accurately reconstruct the complete surface morphology and extract defect parameters.
[0006] Multi-dimensional assessment of requirements: Point clouds or height maps alone are insufficient to guide production. It is necessary to automatically extract multi-dimensional quantitative parameters of defects (such as length, width, area, depth, height, volume, etc.) from the reconstruction results.
[0007] Existing zoom microscopy techniques have achieved good results in scenarios such as tool wear and turbine blade film pore measurement. However, the operators used, such as multi-segment Laplacian, ASMG, and NSST-EPCNN fusion, are not optimized for the characteristics of rubber materials. Directly applying these techniques makes it difficult to achieve optimal detection results and efficiency. Therefore, there is an urgent need for a high-precision, high-efficiency three-dimensional morphology detection method specifically designed for the surface defect characteristics of rubber-coated parts. Summary of the Invention
[0008] The purpose of this invention is to provide a method and system for detecting three-dimensional morphology defects on the surface of rubber-coated parts, in order to solve the problems of the existing technology, which is that the surface of rubber materials usually exhibits low texture, low contrast, and complex morphology, resulting in the instability of traditional focusing evaluation functions on such surfaces, difficulty in accurately calculating the focusing degree, and low efficiency.
[0009] The technical solution of the present invention: a method for detecting three-dimensional morphology of surface defects in rubber-coated parts, comprising the following steps:
[0010] S1, Image Sequence Acquisition: Using a high-precision Z-axis electrically controlled displacement stage, the microscope head is moved in precise steps relative to the rubber-coated part. At each step position, an industrial camera acquires a surface image, forming a series of zoomed image sequences covering the depth range of the entire area to be measured.
[0011] S2, Image preprocessing, preprocesses the acquired image sequence to enhance features and suppress noise;
[0012] S3, Focus Evaluation and Depth Map Reconstruction: For each image in the sequence, the GWML operator is used to calculate the focus evaluation value in the neighborhood of each pixel. By introducing the gradient magnitude of the image at that point as a weight, the response at strong edges is enhanced, while the noise interference in flat areas is weakened. Finally, depth mapping is performed to generate the depth map of the entire field of view.
[0013] S4, Image Fusion and Defect Segmentation: To assist in the localization and segmentation of two-dimensional defects, a method combining non-subsampled shear wave transform (NSST) and pulse coupled neural network (PCNN) is used to fuse the image sequence into a clear full-focus image. For the fused full-focus image, Otsu thresholding, Canny edge detection, or machine learning classifiers are used to automatically identify and segment the defect region.
[0014] S5, 3D reconstruction: The depth map obtained in step S3 is registered and superimposed with the defect area obtained in step S4 to obtain a high-precision 3D point cloud model of the defect area. Based on this model, the multi-dimensional quantization parameters of the defect are automatically calculated.
[0015] S6, Result Output and Judgment: The extracted defect parameters are compared with the preset pass threshold to automatically determine whether the product is qualified or not, generate an inspection report, and can visualize the defect location and morphology.
[0016] Further, the image sequence in step S1 is ;
[0017] In the formula , Let x be the total number of image frames, x be the horizontal coordinate of the pixel in the image, y be the vertical coordinate of the pixel in the image, and I(x,y,n) represent the gray value of the nth frame at pixel (x,y).
[0018] Furthermore, in step S2, a rolling guided filter (RGF) combined with an adaptive histogram equalization algorithm is used. RGF can effectively smooth noise while preserving important edge information, and is particularly suitable for handling minor texture interference that may exist on the rubber surface.
[0019] Furthermore, in step S3, the pixel is The focus evaluation value is The mathematical expression formula for the focused evaluation value is as follows:
[0020] ;
[0021] In the formula, The weighting coefficients are constructed based on the average gradient magnitude of the region. i and j are the horizontal and vertical offsets relative to the center pixel (x,y) within the neighborhood window, both taking values within the range of [-w,w]. w is the radius of the neighborhood window (in this invention, w=2, corresponding to a 5×5 neighborhood window). |∂²In / ∂x²| and |∂²In / ∂y²| are the absolute values of the second-order partial derivatives of the grayscale values of the corresponding pixel in the nth frame image In along the x and y directions, respectively. The sum of the two constitutes the modified Laplacian response, which characterizes the local sharpness of the point. Fn(x,y) is the focus evaluation value of the pixel (x,y) in the nth frame image after gradient weighting. The larger the value, the sharper the point is in the frame image.
[0022] Furthermore, in step S3, the depth mapping is performed for each pixel. Its focus evaluation value over the entire image sequence n A focusing curve is constructed, and the extreme points of this curve are found through Gaussian fitting or parabolic fitting. The number of frames corresponding to these extreme points is determined. This reflects the optimal focusing position of the point. Combined with the Z-axis stepping accuracy, the precise height and depth values of that point can be calculated. Finally, a depth map D(x,y) for the entire field of view is generated.
[0023] Furthermore, the multi-dimensional quantization parameters include:
[0024] Dimensional parameters: Evaluate the length, width, and area of defects based on the segmentation results;
[0025] (2) Depth / Height Parameters: The maximum depth, average depth, maximum height, and average height of the defect are obtained by calculating the height difference between the defect area and the surrounding normal surface.
[0026] (3) Volume parameters: The volume difference between the defect region and the reference surface is calculated by integration. The calculation formula is as follows: ;
[0027] In the formula, To segment out the defective area. The reference surface height is obtained by fitting a curved surface to the normal area around the defect; D(x,y) is the height value of the depth map obtained in step S3 at pixel (x,y); dxdy is the integral area micro-element, that is, the actual physical area corresponding to a single pixel, and the integration is performed in the entire defect area.
[0028] Morphological description: The cross-sectional profile curve of the defect.
[0029] A three-dimensional morphology detection system for surface defects of rubber-coated parts, characterized in that it includes:
[0030] The hardware unit includes an optical imaging module, a precision motion module, and a computing control module.
[0031] The software unit is a software platform that integrates algorithms and provides interfaces for human-computer interaction, data management, and result display.
[0032] Furthermore, the optical imaging module includes an industrial microscope, a high-resolution CCD / CMOS camera for imaging, a ring-shaped LED light source for providing illumination, and a polarizer for suppressing high reflectivity.
[0033] Furthermore, the precision motion module includes a Z1 axis for coarse adjustment, a high-precision Z2 axis electrically controlled displacement stage for precise focusing, and an XY platform for field-of-view switching or scanning of large-size workpieces.
[0034] Furthermore, the computing control module includes an industrial computer for controlling platform movement, image acquisition, and running detection algorithms.
[0035] The beneficial effects of this invention compared with the prior art are as follows: First, image sequence acquisition is performed on the rubber-coated part to be tested. Then, the acquired images are preprocessed. Next, a depth map of the entire field of view is generated through focusing evaluation. Then, image fusion is performed to identify and segment the defect area. Finally, the depth map and the defect area are registered and superimposed to calculate the multi-dimensional quantitative parameters of the defect. The defect parameters are compared with the preset pass threshold to automatically determine whether the product is qualified. This method not only improves the completeness of the three-dimensional morphology detection of the rubber-coated part surface, but also improves the accuracy and efficiency of defect detection. Attached Figure Description
[0036] Figure 1 This is a flowchart of the method of the present invention;
[0037] Figure 2 This is a schematic diagram illustrating the image preprocessing effect of the present invention;
[0038] Figure 3 This is a schematic diagram of the three-dimensional morphology reconstruction and cross-sectional contour analysis of a defect in this invention;
[0039] Figure 4 This is a schematic diagram of the optical path of the system of the present invention;
[0040] Figure 5 This is a schematic diagram of the system hardware structure in this invention.
[0041] In the diagram, LED-1; Imaging lens-2; Beam splitter-3; Part to be tested with rubber coating-4; Fixture-5; Microscope objective-6; Lens-7; Polarizer-8; Precision motion module-9; Optical imaging module-10. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0043] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0044] Furthermore, the use of terms such as "first" and "second" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0045] See Figure 1-5 The present invention discloses a method for three-dimensional morphological detection of surface defects in rubber-coated parts, comprising the following steps: S1, image sequence acquisition, using a high-precision Z-axis electrically controlled displacement stage to drive the microscope head to make precise stepping movements relative to the rubber-coated part, and at each stepping position, an industrial camera acquires a surface image, forming a series of zoom image sequences covering the entire depth range of the area to be measured. In the formula, Where n is the frame number, N is the total number of image frames, x and y are the horizontal and vertical coordinates of the pixel in the image, respectively, and I(x,y,n) represents the grayscale value of the nth frame at pixel (x,y); for the image acquisition in this step:
[0046] The microscope used was an MPlanAPO10× telecentric objective lens from Shanghai Microscope Home, with a numerical aperture (NA) of 0.28 and a working distance of 34.0 mm, to ensure sufficient depth of field and resolution to capture minute deformations on the rubber surface.
[0047] Industrial camera: Uses Daheng Mercury series CMOS camera with a resolution of 5120×5120, a pixel size of 3.45μm×3.45μm, equipped with a USB 3.0 interface, and a frame rate of up to 15fps at full resolution.
[0048] Light source: A white LED ring light source is used, which passes through lens 7, then through an internal polarizer 8, and finally through a diffuser plate to provide uniform illumination, effectively suppressing specular reflection caused by the high reflectivity of the rubber surface. Taking the inspection of surface defects in a certain O-ring as an example:
[0049] Based on the surface defect undulation range of the overmolded part, an estimate of ±50μm is made in this example, and the depth of field of the objective lens is approximately 5μm. The total Z-axis scanning stroke is then set accordingly. .
[0050] To ensure reconstruction accuracy, the step spacing is set. Therefore, the total number of captured frames frame.
[0051] Camera exposure time set The gain is set to 0 to ensure a high signal-to-noise ratio and avoid motion blur.
[0052] The sample of the coated part to be tested is fixed flat on the stage. The XY translation stage is controlled by the host computer software to move the sample so that the center of the camera's field of view is aligned with the area to be tested where there are suspected scratches or other defects.
[0053] Set the acquisition parameters: In this example, set the Z-axis travel to 100μm, the step size to 2μm, and the exposure time to 70ms. Click the "Start Acquisition" button, and the system will automatically control the Z-axis to move from the initial position (-50μm) to the final position (+50μm), triggering the camera to acquire one image at each step point, resulting in a total of 50 consecutive focused images. And store it in the computer.
[0054] S2, Image Preprocessing: The acquired image sequence is preprocessed to enhance features and suppress noise. Rolling Guided Filter (RGF) combined with an adaptive histogram equalization algorithm is preferred. RGF effectively smooths noise while preserving important edge information, making it particularly suitable for handling subtle texture interference that may exist on rubber surfaces. When using RGF, the parameters are: setting the initial Gaussian kernel standard deviation of the guided filter. Edge enhancement iteration count This allows for the smoothing of noise while preserving the edges of defects.
[0055] See Figure 2 The diagram illustrates the preprocessing effect of the image, matching the image preprocessing stage in step S2: the left side of the image shows the original surface image of the rubber-coated part acquired by the industrial camera, and the right side shows the image after processing with rolling guided filtering (RGF) combined with adaptive histogram equalization. The comparison shows that the original image is generally dark, with significant noise and low contrast between defects and the background; the processed image effectively suppresses random noise and interference from minute textures on the rubber surface, significantly improves brightness and contrast, and makes the edge features of the defect area more prominent. This reflects that the preprocessing method solves the problems of low contrast on the rubber surface and noise interference affecting subsequent processing, providing a high-quality input image for the following steps: focus evaluation in step S3 and defect segmentation in step S4.
[0056] S3 focuses on evaluation and depth map reconstruction. For each image in the sequence, a gradient intensity-weighted improved Laplacian operator (GWML) is used, applying the GWML operator to each pixel. Calculate the focused evaluation value within the neighborhood. By introducing the gradient magnitude of the image at that point as a weight, the response at strong edges is enhanced, while noise interference in flat areas is weakened.
[0057] Its mathematical expression is as follows:
[0058]
[0059] In the formula, The weighting coefficients are constructed based on the average gradient magnitude of the region. i and j are the horizontal and vertical offsets relative to the center pixel (x,y) within the neighborhood window, both taking values within the range of [-w,w]. w is the radius of the neighborhood window (in this invention, w=2, corresponding to a 5×5 neighborhood window). |∂²In / ∂x²| and |∂²In / ∂y²| are the absolute values of the second-order partial derivatives of the grayscale values of the corresponding pixel in the nth frame image In along the x and y directions, respectively. The sum of the two constitutes the modified Laplacian response, which characterizes the local sharpness of the point. Fn(x,y) is the focus evaluation value of the pixel (x,y) in the nth frame image after gradient weighting. The larger the value, the sharper the point is in the frame image.
[0060] As the core inventive point of step S3, the detailed description of the gradient-weighted modified Laplace (GWML) operator is as follows:
[0061] (1) Design motivation: Traditional improved Laplacian (SML) type focus evaluation operators sum the second derivative responses of all pixels within the window with equal weight. However, the surface of rubber-coated parts has the characteristics of low texture, low contrast and often accompanied by high reflectivity or light absorption areas. The noise response of flat areas is close to the magnitude of the real focus response, resulting in low signal-to-noise ratio of the focus curve and unstable peak positioning. It is difficult to obtain reliable depth reconstruction results by directly applying traditional operators.
[0062] (2) Improvement Approach: GWML introduces gradient intensity weights G(i,j) based on the improved Laplacian response. This weight is constructed by normalizing the mean of the Sobel gradient magnitudes of the image within the neighborhood window. Regions with large gradient magnitudes (with edge, texture, or defect features) receive larger weights, while regions with small gradient magnitudes (flat background) have lower weights, thereby achieving selective enhancement of effective focusing information.
[0063] (3) Calculation process: For each pixel (x,y) of the nth frame in the image sequence: a) Take a 5×5 neighborhood window (w=2) centered on the pixel; b) Calculate the sum of the absolute values of the second-order partial derivatives of the gray levels of each point in the window along the x and y directions to obtain the improved Laplace response; c) Calculate and normalize the mean value of the Sobel gradient magnitude in the window to obtain the weight coefficient G(i,j); d) Multiply the weight coefficient with the improved Laplace response point by point and sum them in the window to obtain the focus evaluation value Fn(x,y) of the pixel.
[0064] (4) Technical effect: By using gradient intensity weighting, the focusing response at strong edges of the defect contour is enhanced, while the noise interference in flat areas is weakened, making the peak of the focusing curve sharper and the single peak better. This significantly improves the accuracy and robustness of the zoom microscopy method for depth reconstruction on low-texture surfaces of rubber-coated parts, which is the core improvement of this invention that distinguishes it from the prior art.
[0065] Depth mapping: for each pixel Its focus evaluation value over the entire image sequence n This forms a focusing curve. The extreme points of this curve are found through Gaussian or parabolic fitting, and the number of frames corresponding to these extreme points is determined. This reflects the optimal focusing position of the point. Combined with the Z-axis stepping accuracy, the precise height of the point can be calculated. Finally, a depth map D(x,y) for the entire field of view is generated.
[0066] Depth map generation: For each pixel coordinate in the image The value of this point is extracted from 50 focus evaluation images to form a focus curve. This curve is then fitted with a quadratic curve to determine the frame number corresponding to the extreme point. Its depth value:
[0067]
[0068] In the formula, Using the initial position coordinates, iterate through all pixels to generate the final floating-point depth map. n_max(x,y) is the frame number corresponding to the best focus position of the pixel, and step is the Z-axis step distance (2μm in this example).
[0069] The improved GWML operator adopts... A neighborhood window of size 5×5, with weight coefficients. It is obtained by normalizing the mean of the Sobel gradient magnitude of the image within the window.
[0070] Full-focus image fusion: Simultaneously, the preprocessed image sequence is decomposed using NSST. Weighted average fusion is applied to the low-frequency subbands; for the high-frequency subbands, the GWML value is used as the external excitation input to the PCNN, and the fusion coefficients are determined by the pulse firing characteristics of the PCNN. Then, an inverse NSST transform is performed to obtain a clear, fully focused image. .
[0071] Focus curve fitting: For each pixel, 50 focus evaluation values are used to find the location of the extreme points using quadratic polynomial fitting. The calculation formula is as follows:
[0072]
[0073] In the formula, a and b are the fitted quadratic curves. The coefficients are: n is the image frame number (ranging from 1 to the total number of frames N, where N=50 in this example); c is the constant term coefficient of the fitted quadratic curve, determined by least squares fitting, which only affects the overall height of the curve and does not affect the determination of the extreme point position. The function of this formula in this invention is: after performing quadratic polynomial fitting on the discrete focus evaluation value sequence of each pixel, the continuous frame number n_max corresponding to the extreme point of the focus curve is analytically calculated, realizing the optimal focus position positioning with sub-frame accuracy and overcoming the quantization error caused by directly taking the frame number of the maximum focus value; the n_max(x,y) calculated by this formula is substituted into the depth calculation formula Z(x,y)=Z0+n_max(x,y)*step to calculate the surface height value of the pixel. After traversing all pixels, a high-precision depth map D(x,y) of the entire field of view is generated, providing a data basis for the three-dimensional reconstruction and defect parameter calculation in step S5.
[0074] S4, Image Fusion and Defect Segmentation: To assist in two-dimensional defect localization and segmentation, a method combining non-subsampled shear wave transform (NSST) and pulse coupled neural network (PCNN) is used to fuse the image sequence into a clear, fully focused image.
[0075] (1) Decompose each image into low-frequency subband and high-frequency subband using NSST.
[0076] (2) The low-frequency subband adopts weighted average fusion, while the high-frequency subband adopts an improved PCNN model to make fusion decisions based on its firing frequency. The input link strength of PCNN is adaptively adjusted by the output of the GWML operator to ensure that the regions with rich details are better preserved.
[0077] (3) For the fused full-focus image, use Otsu thresholding, Canny edge detection, or machine learning classifiers to automatically identify and segment defect areas. .
[0078] NSST decomposition: A "9 / 7" biorthogonal filter is used, with 3 decomposition layers and [4,4,8] directions.
[0079] PCNN parameters: The link strength coefficient β is adaptively adjusted according to the GWML value, and the dynamic threshold decay time constant is set to 0.8.
[0080] Defect segmentation: The fused full-focus image is first smoothed using Gaussian filtering (kernel size 5×5), and then Canny edge detection is applied (low threshold: 50; high threshold: 150). This set of thresholds is obtained by statistically calibrating the gradient magnitude distribution of full-focus images of typical defect samples: the high threshold is the gradient magnitude quantile that can completely preserve the defect edge while basically suppressing the background texture response, which is calibrated to 150 in this example; the low threshold is taken as about 1 / 3 of the high threshold according to the classic Canny algorithm criterion, which is 50 in this example, to ensure the continuity of the defect contour through hysteresis connection; in view of the difference in imaging contrast of different batches of workpieces, the software can also adaptively fine-tune around the above benchmark value based on the Otsu method. After the above processing, the defect contour is extracted.
[0081] S5, 3D reconstruction, using the depth map obtained in step S3. The defect area obtained in step S4 Registration and overlay. Since the depth map and the full-focus image originate from the same image sequence and the same camera coordinate system, they are naturally aligned at the pixel level without the need for additional geometric transformations. Registration and overlay are achieved by multiplying the binary defect mask with the depth map pixel by pixel to extract the depth data of the defect area and convert it into a 3D point cloud, thereby obtaining a high-precision 3D point cloud model of the defect area. Based on this model, the multi-dimensional quantization parameters of the defect are automatically calculated.
[0082] The specific registration and overlay method described above is as follows: Since the depth map D(x,y) and the fully focused image I_fused(x,y) are both generated pixel by pixel from the same zoom image sequence in the same camera coordinate system, they naturally have a one-to-one correspondence at the pixel level, and no additional geometric transformation registration is required. In specific operation, the binary defect mask M_defect(x,y) obtained by segmentation in step S4 (the defect area pixel value is 1, and the background pixel value is 0) is multiplied pixel by pixel with the depth map D(x,y) to extract the depth value of each pixel in the defect area. Then, the pixel coordinates are converted into actual physical coordinates by combining the actual physical size of the pixel (pixel size divided by optical magnification), thus obtaining a high-precision three-dimensional point cloud model of the defect area.
[0083] (1) Size parameters: The length, width and area of defects are evaluated based on the segmentation results.
[0084] (2) Depth / Height Parameters: The maximum depth, average depth, maximum height, and average height of the defect are obtained by calculating the height difference between the defect area and the surrounding normal surface.
[0085] (3) Volume parameters: The volume difference between the defect region and the reference surface is calculated by integration. The calculation formula is as follows:
[0086] In the formula, The reference surface height is obtained by fitting the normal area around the defect to a surface. R_defect is the defect area segmented in step S4; D(x,y) is the height value of the depth map obtained in step S3 at pixel (x,y); dxdy is the integral area micro-element, whose actual physical area is calculated by converting the pixel size and optical magnification.
[0087] Volume calculation: By traversing all pixels within the defect region, calculating the height difference between the defect and the reference surface, and performing numerical integration, the defect volume is obtained.
[0088] Full-focus image fusion: Simultaneously, the preprocessed image sequence is decomposed using NSST. Weighted average fusion is applied to the low-frequency subbands; for the high-frequency subbands, the GWML value is used as the external excitation input to the PCNN, and the fusion coefficients are determined by the pulse firing characteristics of the PCNN. Then, an inverse NSST transform is performed to obtain a clear, fully focused image. .
[0089] Defect extraction and quantitative analysis:
[0090] (1) Defect segmentation: for fully focused images Canny edge detection is performed to find the closed contour of the defect. Then, a contour filling algorithm is used to obtain a binarized defect mask image. .
[0091] (2) Three-dimensional parameter extraction: Combine the depth map D(x,y) with the defect mask Multiplying these values yields the 3D point cloud data of the defect area. The software automatically calculates and outputs the following parameters:
[0092] Scratch length ( ): Extract the spindle length of the defect area, in mm.
[0093] Maximum width ( ): The maximum width perpendicular to the main axis, in mm.
[0094] area( ): The total number of pixels in the defect mask multiplied by the actual physical area of a single pixel, in mm².
[0095] Maximum depth ( ): The absolute value of the difference between the minimum depth of all points within the defect region and the fitted value of the reference surface at that point, in μm.
[0096] volume( For all pixels within the defect area, calculate the difference between their depth values and the depth of the reference surface, and integrate the absolute values of all differences, with units of 10. -3 mm 3 .
[0097] All the above defect parameters are calculated based on the depth map D(x,y) according to the aforementioned formula within the defect region (i.e., the set of pixels where the defect mask M_defect(x,y) is 1). The defect region limits the pixel range for parameter calculation, while the defect parameters are a quantitative description of the three-dimensional data of the defect region. The two are related as "calculation range" and "calculation result". Taking a dent defect on the surface of the O-ring tested in this example as an example, the complete calculation and judgment chain is as follows: ① Calculate the depth map D(x,y) pixel by pixel using the focusing evaluation formula and depth calculation formula Z(x,y)=Z0+n_max(x,y)*step in step S3; ② Obtain the defect mask M_defect(x,y) by segmentation in step S4; ③ Multiply the two pixel by pixel to obtain the three-dimensional point cloud of the defect region, and calculate the following according to the above definition: scratch length L=1.25mm, maximum width W_max=0. 0.18mm, area A=0.21mm², maximum depth D_max=32μm, volume V=4.6×10⁻³mm³; ④ Compare the above calculated values with the preset qualified thresholds in the software (in this example, D_max≤50μm, A≤0.5mm², V≤8×10⁻³mm³). If all parameters do not exceed the corresponding threshold, the result is "qualified"; if any parameter exceeds the threshold, the result is "unqualified". In this example, all parameters are less than the corresponding thresholds, and the system automatically gives a "qualified" judgment. Thus, from the focus evaluation formula, depth calculation formula to the calculation formulas of each defect parameter, and then to the threshold comparison and qualified judgment, a complete and coherent calculation chain is formed.
[0098] Reference Figure 3 The diagram shows a 3D morphological reconstruction and cross-sectional contour analysis of a defect, matching the 3D reconstruction stage in step S5, and representing the output of that stage. The upper part of the diagram is a color-coded height mapping of the 3D morphology of the defect area; different colors represent different surface heights, intuitively reflecting the spatial location, extent, and degree of indentation of the defect. The lower part of the diagram shows the cross-sectional contour curve extracted along the principal axis of the defect; the horizontal axis represents the position along the cross-sectional direction, and the vertical axis represents the surface height. This curve directly provides key quantitative information such as the opening width and maximum depth of the defect. This diagram reflects the ability of this invention to achieve micron-level precision 3D morphological reconstruction and quantitative analysis of surface defects in rubber-coated parts, and serves as the data source for defect parameter calculation and qualification determination in step S6.
[0099] S6, Result Output and Judgment: The extracted defect parameters are compared with the preset pass threshold to automatically determine whether the product is qualified or not, generate an inspection report, and can visualize the defect location and morphology.
[0100] The host computer software interface will display the fused full-focus image, the 3D topography rendering (which can be rotated for viewing), the color height mapping of the defect area, and detailed parameter reports.
[0101] Users can pre-set the pass / fail thresholds for various parameters in the software. The software will automatically compare the measurement results with the thresholds and give a final judgment of "pass" or "fail". At the same time, it will generate a structured inspection report containing all data and charts. The depth map is generated pixel by pixel by the focus evaluation formula and the depth calculation formula. The calculation range is limited by the defect mask. The specific values are calculated according to the definition formula of each parameter. Then, the values are compared with the preset pass / fail thresholds to obtain the pass / fail conclusion.
[0102] To verify the accuracy of this system, a calibrated Keyence VK-X3000 laser confocal microscope was used to measure the same defect on the same sample as a benchmark. The comparison results showed that the defect depth error measured by this system was less than ±5μm, the relative error of volume measurement was less than 5%, and the standard deviation of depth of repeated measurements was less than 2μm, which fully meets the needs of precise three-dimensional inspection of surface defects of rubber parts in industrial production.
[0103] A three-dimensional morphology detection system for surface defects of rubber-coated parts, characterized in that it includes:
[0104] The hardware unit includes an optical imaging module, a precision motion module, and a computing control module.
[0105] The software unit is a software platform that integrates algorithms and provides interfaces for human-computer interaction, data management, and result display.
[0106] See the overall hardware structure of the system. Figure 5 As shown, Figure 5 The diagram illustrates the mounting arrangement of the optical imaging module and the precision motion module on the equipment frame. During testing, the rubber-coated part under test is placed flat on the stage, with the optical imaging module positioned directly above it. The precision motion module drives the Z-axis precision focusing scan and field-of-view switching.
[0107] Specifically, the optical imaging module includes an industrial microscope, a high-resolution CCD / CMOS camera for imaging, a ring LED light source for illumination, and a polarizer for suppressing high reflectivity. A Shanghai Microscope Home MPlanAPO10× telecentric objective lens with a numerical aperture (NA) of 0.28 and a working distance of 34.0 mm is selected to ensure sufficient depth of field and resolution to capture minute deformations of the rubber surface. The industrial camera is a Daheng Mercury series CMOS camera with a resolution of 5120×5120, a pixel size of 3.45μm×3.45μm, a USB 3.0 interface, and a frame rate of up to 15fps at full resolution. The light source is a white LED ring light source with a built-in polarizer, and uniform illumination is provided through a diffuser plate, effectively suppressing specular reflection caused by high reflectivity on the rubber surface.
[0108] Specifically, the precision motion module includes a Z1 axis for coarse adjustment, a high-precision Z2 axis electrically controlled displacement stage for precise focusing, and an XY platform for field-of-view switching or scanning of large workpieces. The Z-axis displacement stage is a Wanming automated precision electrically controlled displacement stage with a stroke of 25mm, repeatability of ±1μm, minimum step resolution of 0.1μm, and a motion control driver.
[0109] Sample stage: A manual precision XY translation stage is used to coarsely adjust the position of the O-ring under test and move the test area to the center of the field of view.
[0110] Specifically, the computing control module includes an industrial computer used to control platform movement, image acquisition, and run detection algorithms. The industrial control computer is equipped with an Intel Core i5-12600K processor, 32GB DDR4 memory, and an NVIDIA RTX 3060 graphics card (12GB VRAM) for running image processing algorithms and real-time control.
[0111] Control software: A host computer software developed in-house using C++ and OpenCV, integrating the HALCON machine vision library, used to control camera acquisition, displacement table movement, and algorithm processing.
[0112] See system optical path layout Figure 5 As shown, following the Kohler illumination principle, the light emitted by the LED light source passes through a diffuser and polarizer 8, is refracted 90 degrees by a beam splitter, and then shines perpendicularly onto the surface of the coated part 4, which is held by the fixture 5, through the microscope objective 6. The reflected light passes again through the microscope objective 6 and beam splitter 3, and finally the imaging lens 2 projects onto the camera target surface. The entire optical path is fixed on an optical vibration isolation platform to isolate it from environmental vibration interference.
[0113] In addition to the preferred embodiments described above, the present invention has other embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection claimed by the present invention.
Claims
1. A method for detecting three-dimensional morphology of surface defects in rubber-coated parts, characterized in that, Includes the following steps: S1, Image Sequence Acquisition: Using a high-precision Z-axis electrically controlled displacement stage, the microscope head is moved in precise steps relative to the rubber-coated part. At each step position, an industrial camera acquires a surface image, forming a series of zoomed image sequences covering the depth range of the entire area to be measured. S2, Image preprocessing, preprocesses the acquired image sequence to enhance features and suppress noise; S3, Focus Evaluation and Depth Map Reconstruction: For each image in the sequence, the GWML operator is used to calculate the focus evaluation value in the neighborhood of each pixel. By introducing the gradient magnitude of the image at that point as a weight, the response at strong edges is enhanced, while the noise interference in flat areas is weakened. Finally, depth mapping is performed to generate the depth map of the entire field of view. S4, Image Fusion and Defect Segmentation: To assist in the localization and segmentation of two-dimensional defects, a method combining non-subsampled shear wave transform (NSST) and pulse coupled neural network (PCNN) is used to fuse the image sequence into a clear full-focus image. For the fused full-focus image, Otsu thresholding, Canny edge detection, or machine learning classifiers are used to automatically identify and segment the defect region. S5, 3D reconstruction: The depth map obtained in step S3 is registered and superimposed with the defect area obtained in step S4 to obtain a high-precision 3D point cloud model of the defect area. Based on this model, the multi-dimensional quantization parameters of the defect are automatically calculated. S6, Result Output and Judgment: The extracted defect parameters are compared with the preset pass threshold to automatically determine whether the product is qualified or not, generate an inspection report, and can visualize the defect location and morphology.
2. The method for detecting three-dimensional morphology of surface defects in rubber-coated parts according to claim 1, characterized in that, The image sequence in step S1 is ; In the formula , y is the total number of image frames, x is the horizontal coordinate of a pixel in the image, and y is the vertical coordinate of a pixel in the image.
3. The method for detecting three-dimensional morphology of surface defects in rubber-coated parts according to claim 2, characterized in that, In step S2, a rolling guided filter (RGF) combined with an adaptive histogram equalization algorithm is used. RGF can effectively smooth noise while preserving important edge information, and is particularly suitable for handling the small texture interference that may exist on the rubber surface.
4. The method for detecting three-dimensional morphology of surface defects in rubber-coated parts according to claim 3, characterized in that, In step S3, the pixel points are The focus evaluation value is The mathematical expression formula for the focused evaluation value is: ; In the formula, The weighting coefficients are constructed based on the average gradient magnitude of the region. i and j are the horizontal and vertical offsets relative to the center pixel (x,y) within the neighborhood window; w is the radius of the neighborhood window, both taking values within the range of [-w,w]; |∂²In / ∂x²| and |∂²In / ∂y²| are the absolute values of the second-order partial derivatives of the grayscale values of the corresponding pixel in the nth frame image In along the x and y directions, respectively; Fn(x,y) is the focus evaluation value of the pixel (x,y) in the nth frame image after gradient weighting.
5. The method for detecting three-dimensional morphology of surface defects in rubber-coated parts according to claim 4, characterized in that, In step S3, depth mapping is performed on each pixel. Its focus evaluation value over the entire image sequence n A focusing curve is constructed, and the extreme points of this curve are found through Gaussian fitting or parabolic fitting. The number of frames corresponding to these extreme points is determined. This reflects the optimal focusing position of the point. Combined with the Z-axis stepping accuracy, the precise height and depth values of that point can be calculated. Finally, a depth map D(x,y) for the entire field of view is generated.
6. The method for detecting three-dimensional morphology of surface defects in rubber-coated parts according to claim 5, characterized in that, The multi-dimensional quantization parameters include: Dimensional parameters: Evaluate the length, width, and area of defects based on the segmentation results; (2) Depth / Height Parameters: The maximum depth, average depth, maximum height, and average height of the defect are obtained by calculating the height difference between the defect area and the surrounding normal surface. (3) Volume parameters: The volume difference between the defect region and the reference surface is calculated by integration. The calculation formula is as follows: ; In the formula, To segment out the defective area. The reference surface height is obtained by fitting a curved surface to the normal area around the defect; D(x,y) is the height value of the depth map obtained in step S3 at pixel (x,y); dxdy is the integral area micro-element, that is, the actual physical area corresponding to a single pixel, and the integration is performed in the entire defect area. Morphological description: The cross-sectional profile curve of the defect.
7. A three-dimensional morphology detection system for surface defects of rubber-coated parts, characterized in that, include: The hardware unit includes an optical imaging module, a precision motion module, and a computing control module. The software unit is a software platform that integrates algorithms and provides interfaces for human-computer interaction, data management, and result display.
8. The three-dimensional morphology detection system for surface defects of rubber-coated parts according to claim 7, characterized in that, The optical imaging module includes an industrial microscope, a high-resolution CCD / CMOS camera for imaging, a ring-shaped LED light source for providing illumination, and a polarizer for suppressing high reflectivity.
9. A three-dimensional morphology detection system for surface defects of rubber-coated parts according to claim 7, characterized in that, The precision motion module includes a Z1 axis for coarse adjustment, a high-precision Z2 axis electrically controlled displacement stage for precise focusing, and an XY platform for field-of-view switching or scanning of large workpieces.
10. A three-dimensional morphology detection system for surface defects of rubber-coated parts according to claim 7, characterized in that, The computing control module includes an industrial computer used to control platform movement, image acquisition, and the execution of detection algorithms.