Method and device for measuring pitting size based on machine vision
By using a machine vision-based pitting corrosion size measurement device and method, and employing a line laser scanner and Gaussian filtering algorithm, the problem of low sensitivity of pitting corrosion signals in nondestructive testing is solved, enabling accurate measurement and quantitative analysis of pitting corrosion, and improving the accuracy and safety of the inspection.
Patent Information
- Application Number
- CN202511018090.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-07-14
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-31
AI Technical Summary
Existing non-destructive testing methods are not very sensitive to pitting defects in chlor-alkali chemical production and are difficult to quantify, especially at the location of pitting damage on stainless steel surfaces, which poses a safety hazard.
A machine vision-based device and method for measuring pitting corrosion size was adopted. Micrometer-level point cloud data was acquired using a line laser scanner, and data processing was performed by combining Gaussian filtering and machine learning algorithms. The three-dimensional morphology information of pitting corrosion was obtained through fitting and segmentation, thereby achieving accurate measurement of pitting corrosion size.
It improves the sensitivity and accuracy of pitting corrosion measurement, can accurately obtain the three-dimensional morphology information of pitting corrosion, complete the quantitative analysis of pitting corrosion, control the error at the micron level, and realize a more comprehensive pitting corrosion assessment.
Smart Images

Figure CN120868908A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pitting size measurement technology, specifically relating to a pitting size measurement method and device based on machine vision. Background Technology
[0002] Chlor-alkali chemical production equipment operates for extended periods in corrosive environments characterized by high chlorine levels and strong acids and alkalis, making corrosion particularly severe. Stainless steel, with its excellent corrosion resistance, is widely used in critical equipment and pipelines in chlor-alkali chemical processes. However, in chlorine-containing environments, stainless steel surfaces frequently suffer pitting corrosion, especially at welds and seals, posing potential risks to the safe operation of equipment. Existing non-destructive testing (NDT) methods generally suffer from low signal sensitivity, and improving sensitivity is often susceptible to interference. Furthermore, the quantitative analysis of pitting defects is a critical issue urgently needing resolution in the field of NDT. Summary of the Invention
[0003] To overcome the problems of low signal sensitivity and difficulty in quantifying defects in existing nondestructive testing methods for pitting corrosion, the present invention aims to provide a machine vision-based method and apparatus for measuring pitting corrosion size. This method is more sensitive to pitting corrosion signals and can provide three-dimensional morphological information of pitting corrosion, thereby completing the quantitative measurement of pitting corrosion size.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] A machine vision-based pitting size measurement device includes a line laser scanner, a line laser scanner controller, a slide table, a lead screw guide, a stepper motor, a stepper motor driver, and a data processing device.
[0006] The line laser scanner is mounted on a slide table, which is mounted on a lead screw guide rail. The stepper motor is connected to the lead screw guide rail, and the line laser scanner is connected to the line laser scanner controller.
[0007] Furthermore, it also includes a stepper motor controller connected to the stepper motor.
[0008] Furthermore, the stepper motor controller is connected to a stepper motor driver.
[0009] Furthermore, it also includes a DC switching power supply, a line laser scanner controller, a stepper motor controller, and a stepper motor driver connected to the DC switching power supply.
[0010] Furthermore, the line laser scanner is also connected to data processing equipment.
[0011] A machine vision-based method for measuring pitting corrosion dimensions includes the following steps:
[0012] The machine vision-based pitting size measurement device is used to acquire point cloud data corresponding to the pitting corrosion under test at the micron level.
[0013] Gaussian filtering algorithm is used to filter and reduce noise in the acquired point cloud data;
[0014] The filtered and denoised point cloud data is segmented to distinguish between point cloud data in pitted areas and point cloud data in non-pitted areas;
[0015] The segmented pitting boundary is fitted to approximate the pitting boundary, and the pitting diameter is obtained.
[0016] The point cloud data of the pitting area and the point cloud data of the non-pitting area are fitted to obtain the fitting results;
[0017] Based on the fitting results, the maximum distance between the fitting surface of the pitting region and the fitting surface of the non-pitting region is calculated to obtain the pitting depth.
[0018] Furthermore, machine learning methods are used to segment the filtered and denoised point cloud data.
[0019] Furthermore, a two-dimensional circle was used to fit the pitting boundary.
[0020] Furthermore, the fitting results include: the fitting surface of the non-pitting region and the fitting surface of the pitting region;
[0021] The fitting surface for the non-pitting region is obtained through the following process: Based on the least squares method, a plane is used to fit the point cloud data of the non-pitting region to obtain the fitting surface for the non-pitting region.
[0022] Furthermore, the pitting region fitting surface is obtained through the following process: the point cloud data of the pitting region is fitted using a quadratic polynomial to obtain the pitting region fitting surface.
[0023] Compared with the prior art, the beneficial effects of the present invention are:
[0024] This invention proposes a machine vision-based pitting corrosion size measurement device, which has higher sensitivity for pitting corrosion measurement and can obtain three-dimensional morphological information of pitting corrosion. The measurement device uses line laser scanning technology. A laser emitter of a laser scanner emits a laser beam onto the surface to be measured, and a receiver receives the reflected laser beam. Point cloud data of the surface morphology is obtained by calculating the reception time. Compared with traditional hole depth gauges that can only measure the pitting corrosion depth at one location, this device can obtain the complete surface morphology of the surface where the pitting corrosion occurs, and the error is controlled within the micrometer level.
[0025] This invention proposes a machine vision-based method for measuring pitting corrosion dimensions. By acquiring high-precision (micrometer-level) point cloud data and processing the point cloud data of the pitting corrosion three-dimensional topography using a Gaussian filtering algorithm, singular and discrete points in the overall point cloud data are removed, resulting in smoother processed point cloud data. This makes the method more accurate in measuring pitting corrosion dimensions and reduces the error value.
[0026] Furthermore, the present invention can perform quantitative analysis of pitting corrosion by using a machine learning algorithm (K-means clustering algorithm) to segment the processed three-dimensional morphology information and automatically separate the point cloud data of the surface under test and the pitting pits, so as to achieve a more comprehensive and accurate pitting corrosion assessment.
[0027] Furthermore, the present invention can measure the size of pitting corrosion by fitting point cloud data of pitting and non-pitting areas using a quadratic polynomial and a three-dimensional plane equation, calculating the maximum distance from the quadratic polynomial to the plane to be measured, and obtaining the diameter of the pitting circle using a circular fitting formula, thereby realizing the measurement of the depth and diameter of pitting corrosion pits. Attached Figure Description
[0028] Figure 1 This is a component of the machine vision-based pitting size measurement device described in this invention;
[0029] Figure 2 This is a technical flowchart of a pitting size measurement technology based on machine vision as described in this invention;
[0030] Figure 3 This is the main structure of a pitting size measurement device based on machine vision as described in this invention;
[0031] Figure 4 These are schematic diagrams of the pitting point cloud before and after filtering according to the present invention; wherein, (a) is the point cloud before Gaussian filtering, and (b) is the point cloud after Gaussian filtering;
[0032] Figure 5 This is a schematic diagram of pitting point cloud data segmentation as described in this invention;
[0033] Figure 6 This is a schematic diagram of the fitting of the pitting and non-pitting regions described in this invention;
[0034] Figure 3 In the diagram, 1 is a DC switching power supply, 2 is a stepper motor controller, 3 is a stepper motor driver, 4 is a line laser scanner controller, 5 is a data processing device, 6 is a line laser scanner, 7 is a stepper motor, 8 is a lead screw guide, and 9 is a slide table. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are merely for explaining the invention and making it clearer and more specific. Any improvements made without departing from the concept of the technical solution of this application, as well as various non-creative achievements, are all within the protection scope of this application.
[0036] In the description of this invention, it should be understood that the terms "front", "rear", "left", "right", "up", "down", "vertical", "horizontal", "high", "low", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting the scope of protection of this invention.
[0037] The use of terms such as "first," "second," and "third" in terminology is merely for distinguishing descriptions of identical or similar components and should not be interpreted as emphasizing or implying the relative importance of a particular component. In the description of specific embodiments, "several," "multiple," or "a number" represent at least two. The number can be any number, including three, four, five, six, seven, eight, nine, or even more than nine.
[0038] Machine vision-based optical measurement technology is widely recognized as the most promising three-dimensional surface shape measurement method due to its advantages such as high sensitivity, high precision, high speed, non-destructive operation, and large data acquisition capacity. It can become an important tool for pitting corrosion detection and quantitative analysis. Machine vision measurement technology can provide three-dimensional morphological information of pitting corrosion, including depth, volume, and surface morphology, thereby enabling more comprehensive and accurate pitting corrosion assessment.
[0039] See Figure 1 The invention discloses a machine vision-based pitting size measurement device, comprising: a line laser scanner 6, a line laser scanner controller 4, a slide table 9, a lead screw guide rail 8, a stepper motor 7, a stepper motor controller 2, a stepper motor driver 3, a DC switching power supply 1, a supporting tripod, and a data processing device 5.
[0040] The line laser scanner 6 is mounted on a slide table 9, which is mounted on a lead screw guide rail 8. A stepper motor 7 is connected to the lead screw guide rail 8 and is connected to a stepper motor controller 2 via a signal line. The stepper motor controller 2 is connected to a stepper motor driver 3 via a signal line. The line laser scanner 6 is connected to a line laser scanner controller 4 via a signal line. The line laser scanner controller 4, stepper motor controller 2, and stepper motor driver 3 are connected to a DC switching power supply 1 via power lines. The line laser scanner controller 4 is connected to a data processing device 5 via a network cable.
[0041] The line laser scanner 6 is used to acquire the height and grayscale information of the pitting corrosion being tested;
[0042] The line laser scanner controller 4 is used to output control signals for the line laser scanner 6, or to convert the data acquired by the line laser scanner 6.
[0043] The slide 9 is fixedly connected to the line laser scanner 6 by bolts and is used to mount the line laser scanner 6.
[0044] The lead screw guide 8 and the slide table 9 body are connected by a thread to drive the linear motion of the slide table 9, which in turn drives the linear motion of the line laser scanner 6.
[0045] The stepper motor 7 is connected to the lead screw guide rail 8 via a coupling, which drives the lead screw to rotate at a constant speed, thereby driving the slide table 9 to move linearly at a constant speed, and in turn driving the line laser scanner 6 to move linearly at a constant speed.
[0046] The stepper motor controller 2 is used to output motor control signals to control the rotation speed and direction of the stepper motor 7;
[0047] Stepper motor driver 3 is used to amplify or convert stepper motor controller signals;
[0048] The DC switching power supply 1 is used to supply DC power to the line laser scanner controller 4, the stepper motor controller 2, and the stepper motor driver 3.
[0049] Data processing device 5 is used to receive, store, and process point cloud data measured by line laser scanner 6;
[0050] The tripod is used to control the position of the main body of the measuring device (line laser scanner 6, slide table 9, lead screw guide rail 8 and stepper motor 7) in a direction perpendicular to the ground.
[0051] See Figure 2 The present invention discloses a machine vision-based method for measuring pitting dimensions, comprising the following steps:
[0052] S1. By using the machine vision-based pitting size measurement device, more accurate (micron-level) point cloud data corresponding to the pitting to be measured can be obtained;
[0053] S2. Use the Gaussian filtering algorithm to preprocess the acquired point cloud data (filtering and noise reduction) to remove existing data noise or outliers. After processing the data by the Gaussian filtering algorithm, a more accurate pitting surface morphology can be obtained.
[0054] S3. Use machine learning methods (K-Means clustering algorithm) to segment the filtered and denoised point cloud data, and distinguish the point cloud data of the pitted area from the point cloud data of the non-pitted area;
[0055] S4. Use quadratic polynomials and three-dimensional plane equations to fit the point cloud data of the pitting region and the point cloud data of the non-pitting region respectively to approximate the pitting region and the non-pitting region, and obtain the fitting results.
[0056] S5. Based on the fitting results, calculate the diameter of the fitted circle to approximate the diameter of the pitting corrosion; calculate the maximum distance from the fitted surface of the pitting region to the fitted surface of the non-pitting region to approximate the depth of the pitting corrosion.
[0057] Step 1 and Step 3 have a significant impact on the measurement results. Step 1 obtains point cloud data with high accuracy (micrometer level), while Step 3 is used to identify and classify the point cloud data.
[0058] This invention can acquire three-dimensional morphological information of pitting corrosion and measure the size and depth of pitting corrosion, thereby completing the quantitative analysis of pitting corrosion.
[0059] Example 1
[0060] The physical example of the machine vision-based pitting size measurement device of the present invention is shown below. Figure 3 As shown. The measuring device includes a line laser scanner 6, a line laser scanner controller 4, a slide table 9, a lead screw guide rail 8, a stepper motor 7, a stepper motor controller 2, a stepper motor driver 3, a DC switching power supply 1, a support tripod, and a data processing device 5. The line laser scanner controller 4 is used to output control signals for the line laser scanner 6, or to convert the data acquired by the line laser scanner 6; the stepper motor controller 2 is used to output control signals for the motor, including controlling the rotation speed and direction of the stepper motor 7; the stepper motor driver 3 is used to amplify or convert the control signals of the stepper motor controller 2; the DC switching power supply 1 provides a stable DC power supply to the line laser scanner controller 4, the stepper motor controller 2, and the stepper motor driver 3. Two support tripods are used to determine the position of the main body in the direction perpendicular to the ground. The data processing device 5 is connected to the scanner 6, receives and stores point cloud data in real time, facilitating subsequent processing of the point cloud data. The line laser scanner 6 is used to scan and acquire the height and grayscale information of the pitting corrosion being measured. The top of the slide table 9 and the bottom of the line laser are fixedly connected by bolts to mount the line laser scanner 6. The center of the slide table 9 is machined with an internal thread, and the lead screw passes through the center of the slide table 9 and is tightly connected to the slide table 9 through the threaded engagement. The stepper motor 7 is connected to the lead screw guide rail 8 through a coupling. When the stepper motor 7 rotates at a constant speed, it drives the lead screw to rotate at a constant speed, which in turn drives the slide table 9 to perform uniform linear motion, which in turn drives the line laser scanner 6 mounted on the slide table 9 to perform uniform linear motion, thus completing the scanning and acquisition of the pitting corrosion morphology.
[0061] Example 2
[0062] A machine vision-based method for measuring the size of pitting corrosion includes: using a pitting corrosion size measuring device to scan and acquire surface morphology information of a pitted corrosion sample. In this embodiment, the pitted corrosion sample is a 50mm × 50mm × 2mm 304 stainless steel specimen with pre-formed pitting corrosion pits on its front side. During the acquisition process, the scanning line laser generated by the line laser scanner 7 is perpendicular to the lead screw guide rail 9, and the stepper motor 8 rotates to drive the line laser scanner 7 to move linearly, completing the scanning and acquisition of the pitting corrosion morphology and obtaining pitting corrosion point cloud data.
[0063] After the scanning and acquisition process is complete, the acquired pitting point cloud data is denoised using a Gaussian filter algorithm to remove data noise and outliers. A visual comparison of the pitting point clouds before and after Gaussian filtering is provided. Figure 4 As shown in (a) and (b), it can be seen that after Gaussian filtering, the noise in the point cloud data is reduced, and the shape becomes more continuous and smooth.
[0064] After filtering and denoising the pitting point cloud, the commonly used unsupervised learning method, K-Means clustering algorithm, is used to segment the filtered and denoised point cloud data, distinguishing the point cloud data of the pitting region from the point cloud data of the non-pitting region. Figure 5 As shown.
[0065] After segmenting the point cloud data, a two-dimensional circle was used to fit the outer contour of the pitting region, resulting in a pitting diameter of 0.532 mm.
[0066] Based on the least squares method, a plane is used to fit the point cloud data of the non-pitting areas to obtain the plane equation of the non-pitting areas. Assume there are a total of n point cloud data points for the non-pitting areas, with spatial coordinates (x... i ,y i ,z i x), where i = 1, 2, 3, ..., n. i x-axis coordinates, y i The y-axis coordinate is z i Let be the z-axis coordinate. The goal is to find a plane that best fits these data points, which can be represented as:
[0067] z = ax + by + c
[0068] Here, a, b, and c are the first, second, and third coefficients that need to be solved. The goal of the fitting is to minimize the difference between the actual z-values and the predicted z-values in the plane, and the residual r is defined as... i for:
[0069] r i =z i -(ax i +by i +c)
[0070] In the formula, z i Let be the spatial coordinates of the point cloud data of the i-th non-pitting region.
[0071] The fitting process is to minimize the sum of squared residuals at all points:
[0072]
[0073] In the formula, i = 1, 2, 3, ..., n represents the count of point cloud data, n is the total number of point cloud data, and r i Let E be the residual and E be the variance.
[0074] By taking the partial derivative of the error function (i.e., variance) and setting it to zero, the point where the partial derivative is zero is the minimum value of the error function.
[0075]
[0076] Solving the above system of linear equations yields the parameter values (a, b, c) that minimize the sum of squared residuals, and thus the plane equation for the non-pitting region.
[0077] Next, a quadratic polynomial is used to fit the point cloud data of the pitting region to obtain the planar equation of the pitting region, i.e., the fitting surface of the non-pitting region. Assume there are a total of n point cloud data points for pitting regions, with spatial coordinates (x... i ,y i ,z i (x, y) where i = 1, 2, 3, ..., n. The goal is to find a quadratic polynomial surface z = f(x, y) to approximate these points. The quadratic polynomial can be expressed as:
[0078] z = ax 2 +by 2 +cxy+dx+ey+f
[0079] Where a, b, c, d, e, and f are the first, second, third, fourth, fifth, and sixth coefficients to be solved. The goal of the fitting is to minimize the difference between the actual z-values at the actual points and the z-values predicted by the polynomial surface. The residual r is defined as... i for:
[0080]
[0081] The fitting process is to minimize the sum of squared residuals at all points:
[0082]
[0083] By taking the partial derivative of the error function and setting it to zero, the point where the partial derivative is zero is the minimum value of the error function. Further solving this problem yields the parameter values (a, b, c, d, e, f) that minimize the sum of squared residuals, thus obtaining the planar equation of the pitting region, i.e., the fitting surface of the pitting region.
[0084] After fitting the pitted and non-pitted regions, the plane equations of the non-pitted regions and the pitted regions together form the fitting result. The fitting result is visualized as follows: Figure 6 As shown. Based on the fitting results, the maximum distance between the fitting surface of the pitting area and the fitting surface of the non-pitting area was calculated, and the pitting depth was approximately 0.651 mm.
[0085] The diameter of the pitting was measured using a 50-division vernier caliper with an accuracy of 0.02 mm; the depth of the pitting was measured using a digital mechanical depth gauge with an accuracy of 0.02 mm. Three consecutive measurements were taken and averaged, resulting in an actual measured diameter of 0.50 mm and an actual measured depth of 0.68 mm. It can be seen that the diameter measurement error in this invention is +0.032 mm, and the depth measurement error is -0.029 mm.
[0086] The above description is only of the preferred embodiment of the present invention and should not be construed as limiting the scope of the claims. The present invention is not limited to the above embodiments, and variations in its specific structure are permitted. All variations made within the scope of the independent claims of the present invention are also within the scope of protection of the present invention.
[0087] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
Claims
1. A machine vision-based device for measuring the size of pitting corrosion, characterized in that, Includes a line laser scanner (6), a line laser scanner controller (4), a slide table (9), a lead screw guide (8), a stepper motor (7), a stepper motor driver (3), and a data processing device (5); The line laser scanner (6) is mounted on the slide table (9), the slide table (9) is mounted on the lead screw guide rail (8), the stepper motor (7) is connected to the lead screw guide rail (8), and the line laser scanner (6) is connected to the line laser scanner controller.
2. The machine vision-based pitting size measurement device according to claim 1, characterized in that, It also includes a stepper motor controller connected to the stepper motor (7).
3. The machine vision-based pitting size measurement device according to claim 1, characterized in that, The stepper motor controller (2) is connected to the stepper motor driver (3).
4. The machine vision-based pitting size measurement device according to claim 1, characterized in that, It also includes a DC switching power supply (1), a line laser scanner controller (4), a stepper motor controller (2), and a stepper motor driver (3) connected to the DC switching power supply (1).
5. The machine vision-based pitting size measurement device according to claim 1, characterized in that, The line laser scanner (6) is also connected to a data processing device.
6. A machine vision-based method for measuring pitting dimensions using the apparatus of claim 1, characterized in that, Includes the following steps: The machine vision-based pitting size measurement device is used to acquire point cloud data corresponding to the pitting corrosion under test at the micron level. Gaussian filtering algorithm is used to filter and reduce noise in the acquired point cloud data; The filtered and denoised point cloud data is segmented to distinguish between point cloud data in pitted areas and point cloud data in non-pitted areas; The segmented pitting boundary is fitted to approximate the pitting boundary, and the pitting diameter is obtained. The point cloud data of the pitting area and the point cloud data of the non-pitting area are fitted to obtain the fitting results; Based on the fitting results, the maximum distance between the fitting surface of the pitting region and the fitting surface of the non-pitting region is calculated to obtain the pitting depth.
7. The machine vision-based method for measuring pitting dimensions according to claim 6, characterized in that, Machine learning methods are used to segment the filtered and denoised point cloud data.
8. The machine vision-based method for measuring pitting dimensions according to claim 6, characterized in that, The pitting boundary was fitted using a two-dimensional circle.
9. The machine vision-based method for measuring pitting dimensions according to claim 1, characterized in that, The fitting results include: the fitting surface of the non-pitting region and the fitting surface of the pitting region; The fitting surface for the non-pitting region is obtained through the following process: Based on the least squares method, a plane is used to fit the point cloud data of the non-pitting region to obtain the fitting surface for the non-pitting region.
10. The machine vision-based method for measuring pitting dimensions according to claim 9, characterized in that, The pitting region fitting surface is obtained through the following process: the point cloud data of the pitting region is fitted using a quadratic polynomial to obtain the pitting region fitting surface.
Citation Information
Patent Citations
Automatic three-dimensional laser scanning system and method for object
CN110906880A
Workpiece plane wear measurement method and system
CN112284256A
Method for calculating diameter distribution of pitting pits on surface of passivated metal after polarization corrosion
CN114913521A
Method for evaluating corrosion depth of structural steel based on three-dimensional shape scanning
CN117664918A
Surface defect detection method and system based on line spectrum confocal scanning
CN118533842A