A rapid assessment method for ship corrosion based on image recognition
By performing edge detection, circle fitting, brightness correction and random forest classification on ship corrosion images based on image recognition methods, the problem of quantitative evaluation of corrosion image data in the existing technology is solved, and the precise quantitative evaluation and rapid identification of corrosion damage are achieved.
Patent Information
- Application Number
- CN202411934205.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The existing technology lacks effective methods to conduct precise quantitative evaluation of corrosion image data obtained based on pulsed digital X-ray and ultrasonic phased array technology, making it difficult to quickly and efficiently assess the corrosion status of ships.
An image recognition-based method, including edge detection, circle fitting, brightness field correction, random forest classification and other technologies, is used to segment and analyze the corrosion image and calculate the depth and area of corrosion damage.
It achieves a precise quantitative assessment of corrosion damage, improves the ship's corrosion protection and maintenance support capabilities, and can identify corrosion defects from any direction.
Smart Images

Figure CN119741293B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a ship corrosion protection technology, and in particular to a ship corrosion rapid assessment method based on image recognition. Background Art
[0002] Corrosion in the marine environment has always been a major challenge plaguing shipbuilding and maintenance worldwide. The hull structure and seawater piping systems are key and challenging areas for corrosion protection. While the hull structure is crucial for safe navigation, its corrosion risks are often difficult to detect. Seawater piping, including fire water lines, seawater cooling lines for various electromechanical equipment, gravity toilet flushing lines, and bilge drainage lines, is located throughout the vessel. Corrosion and damage to these piping can impact the normal operation of equipment and even the safety of the vessel.
[0003] Therefore, having a corrosion monitoring system is an important prerequisite and basic guarantee for ships to maintain a good operating condition for a long time. According to their different working methods, they can be divided into two categories: one is to track the corrosion behavior of materials in the actual environment in situ, monitor the speed at which equipment corrodes due to the action of the medium, and obtain relevant information about the material corrosion process. This is called on-site corrosion monitoring. Currently, the more widely used methods include weightlessness coupons, resistance probes, inductance probes, potential probes, and linear polarization resistance probes. The second is to detect the presence of corrosion defects after the equipment has been running for a certain period of time, and obtain corrosion results indirectly. This is called offline corrosion testing (abbreviated as testing). Currently, non-destructive testing (NDT) technologies such as magnetic powder, ultrasonic, eddy current, magnetic leakage, and X-ray are commonly used.
[0004] A portable ship corrosion monitoring system based on pulsed digital X-ray and ultrasonic phased array technology offers certain advantages in nondestructive testing (NDT). Its operating principle is to emit high-frequency X-ray pulses. After the rays pass through the object being inspected, they appear as different photosensitive pixels on the photosensitive plate. The pixel value is positively correlated with the intensity of the rays incident on the plate. At the same time, the intensity of the rays incident on the plate is negatively correlated with the thickness of the device being tested. Therefore, after passing through the device being tested, the rays appear as pixels of different sizes on the plate. The image acquisition backend reads the pixel information of the plate and displays it as a two-dimensional image through a digital display. This allows for visual quantitative inspection of coating defects on the actual ship and obtains corrosion image data. However, there is currently no effective technical means to accurately quantify the obtained corrosion image data and quickly and efficiently assess its corrosion status. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method for rapid assessment of ship corrosion based on image recognition in view of the defects in the prior art.
[0006] The technical solution adopted by the present invention to solve the technical problem is: a rapid ship corrosion assessment method based on image recognition, comprising the following steps:
[0007] 1) performing edge detection on a collected digital corrosion image to be evaluated; the digital corrosion image is a digital radiographic image obtained by a ship corrosion detection device during nondestructive testing;
[0008] 2) Fit a circle to the edge points as a reference ball;
[0009] 2.1) Randomly sample edge points and use the sampled points to fit a circle;
[0010] 2.2) Classify all edge points into outer points and inner points according to the fitted circle;
[0011] 2.3) Set a threshold. If the distance between an outlier point and the fitted circle is less than the preset threshold, the outlier point is considered an inlier point. Traverse all edge points in the edge detection result graph to obtain an updated set of inliers.
[0012] 2.4) Refit the circular edge based on the latest set of inliers;
[0013] 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, obtaining the final fitted circle; and count the number of its inliers and outliers;
[0014] 3) Segmentation of corrosion damage;
[0015] The basic process of corrosion damage area segmentation is: first, reduce the interference caused by the uneven brightness field through brightness field non-uniformity correction; then extract features pixel by pixel; finally, classify the pixels based on the extracted features to achieve corrosion damage area segmentation; the details are as follows:
[0016] 3.1) Before segmentation, the image is first corrected for uneven brightness to filter out uneven background brightness.
[0017] Brightness non-uniform field correction includes the following two steps: brightness field calculation and brightness correction;
[0018] 3.1.1) Luminance field calculation
[0019] Obtaining a grayscale image of the digital radiographic image, and then performing erosion and dilation operations on the grayscale image. The grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital radiographic image.
[0020] The brightness field is represented as the background grayscale image of the brightness in the digital radiographic image. The background grayscale image is calculated through the morphological transformation of the image. The specific process includes the erosion and dilation of the grayscale image.
[0021] The erosion process of the grayscale image is as follows;
[0022] Step 1: Define a structural element with a set shape;
[0023] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, where the grayscale values of the pixels at each position have been marked.
[0024] Step 3: Assign the minimum grayscale value within the coverage of the structural element to the pixel at the center of the structural element;
[0025] Step 4: Repeat steps 2 and 3 above until all pixels are traversed to obtain the grayscale image after the corrosion operation;
[0026] The expansion process of the grayscale image is as follows:
[0027] Step 1: Define a structural element of a certain shape;
[0028] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, where the grayscale values of the pixels at each position have been marked.
[0029] Step 3: Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element;
[0030] Step 4: Repeat steps 2 and 3 above until all pixels are traversed to obtain the grayscale image after the dilation operation;
[0031] 3.1.2) Brightness Correction
[0032] That is, brightness correction is performed by subtracting the original image from the background grayscale image;
[0033] 3.2) Extract features and classify pixels to segment the corrosion area;
[0034] The corrosion area is segmented by classifying pixels one by one. The pixel features based on which pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature.
[0035] The global feature used is the grayscale histogram of the approximate area of corrosion damage circled manually in the digital radiographic image;
[0036] The calculation process of the grayscale histogram is as follows:
[0037] Step 1: Divide the grayscale into K intervals;
[0038] Step 2: Traverse all pixels in the roughly circled corrosion damage area and count the number of pixels whose grayscale values fall into each grayscale interval. Assume that the number of pixels falling into the kth grayscale interval is n. k ;
[0039] Step 3: Calculate the proportion of pixel grayscale values in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is N. pixel , then the proportion of pixels in the kth grayscale interval is Array {p1,p2,p3,…,p K} That is, the grayscale histogram of the approximate area of corrosion damage;
[0040] The local feature used in the present invention is the mean value of the grayscale value of pixels in a local area with the pixel as the center and the manually set threshold as the radius;
[0041] 3.3) Region Segmentation
[0042] Region segmentation is achieved through pixel-by-pixel classification based on extracted pixel features, using a random forest classifier. The basic idea of a random forest is to train a decision tree by randomly extracting a certain number of samples from the original training set with replacement through resampling. This process is repeated to train a certain number of decision trees to form a random forest. The classification result of the random forest is determined by voting among the decision trees.
[0043] The corrosion damage area segmentation is performed by using random forest for classification prediction. Each decision tree in the random forest is used in turn for classification prediction. Then, the voting results of the decision tree classification prediction are used as the classification prediction results of the random forest.
[0044] 4) Based on the detection results of the benchmark ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the collected digital image;
[0045] 4.1) Calculation of corrosion damage depth;
[0046] Step 1: Calculate the minimum grayscale value of the reference ball area in the reference ball detection results We believe that the minimum grayscale value of the reference ball area corresponds to the diameter of the reference ball. In practical applications, the actual diameter of the reference ball d ball known;
[0047] Step 2: Based on the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage and will As the grayscale value that the photographed object should have when it is not damaged;
[0048] Step 3: Based on the corrosion damage segmentation results, the corrosion depth of the corresponding corrosion area is calculated pixel by pixel;
[0049] Assume that the gray value of the i-th pixel in the eroded area is g i , the corrosion depth of the area corresponding to the pixel
[0050] Step 4: Perform basic corrosion depth analysis based on the corrosion depth corresponding to the corrosion area pixels calculated in step 3, including calculating the minimum, maximum, and mean corrosion depths and calculating the corrosion depth histogram. The calculation process of the corrosion depth histogram is consistent with the grayscale histogram calculation process shown in step 3.2);
[0051] 4.2) Calculation of corrosion damage area;
[0052] The detection results for the reference spheres can be used to determine the number of pixels occupied by the reference spheres in the digital radiographic image. Since the actual diameter of the reference spheres is known, the area of their maximum cross-section is also known. We assume that the maximum cross-section of the reference sphere corresponds to the reference sphere detected in the digital radiographic image. Furthermore, the corrosion damage segmentation results can be used to determine the number of pixels occupied by the corrosion damage in the digital radiographic image. Based on this, the corrosion damage area can be proportionally calculated.
[0053] The calculation process of corrosion damage area is as follows:
[0054] Step 1: According to the actual diameter d of the reference ball ball , calculate the actual area of the maximum cross section of the reference ball as
[0055] Step 2: Based on the detection results of the reference balls, count the number of pixels N occupied by the reference balls in the digital radiographic image. ball ;
[0056] Step 3: Based on the corrosion damage segmentation results, count the number of pixels N occupied by corrosion damage in the digital radiographic image. erosion ;
[0057] Step 4: Calculate the corrosion damage area
[0058] The beneficial effects produced by the present invention are:
[0059] The present invention proposes a rapid assessment method for ship corrosion based on deep learning image recognition technology. It can precisely quantify the depth and area of corrosion damage by conducting benchmark ball detection, intelligent segmentation of corrosion damage areas and corrosion damage analysis under conditions of weak artificial intervention. It realizes artificial intelligence analysis of corrosion defect data in digital radiographic images, evaluates the collected corrosion images, and can identify corrosion defects in images from any direction, angle or edge position, which can greatly improve the ship corrosion protection and maintenance guarantee capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0061] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0062] Figure 2 is a schematic diagram of the corrosion process of an embodiment of the present invention;
[0063] Figure 3 is a schematic diagram of the expansion process of an embodiment of the present invention;
[0064] Figure 4 2 is a schematic diagram of the brightness correction effect of an embodiment of the present invention;
[0065] Figure 5 Schematic diagram of the corrosion damage area segmentation effect according to an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0067] like Figure 1 As shown, a rapid ship corrosion assessment method based on image recognition includes the following steps:
[0068] 1) performing edge detection on a collected digital corrosion image to be evaluated; the digital corrosion image is a digital radiographic image obtained by a ship corrosion detection device during nondestructive testing;
[0069] Edge detection specifically includes the following steps:
[0070] Step 1: Gaussian filtering
[0071] The noise in the image is generally a high-frequency signal and is therefore easily identified as a false edge. To reduce the impact of noise on edge detection, this embodiment uses Gaussian filtering to filter out the noise. During the filtering process, a discretized two-dimensional Gaussian window is used to slide the convolution over the entire image. The specific formula is as follows:
[0072] I G =I o *G σ (1)
[0073] Among them, I o Represents the original image before Gaussian filtering, G σ represents a discretized two-dimensional Gaussian window, * represents convolution, I G represents the image after Gaussian filtering.
[0074] Step 2: Calculate the gradient
[0075] At the edge position, the pixel grayscale value generally changes greatly, so calculating the gradient of the pixel grayscale value in the image helps detect the edge.
[0076] When calculating the gradient, first, convolve the image using the horizontal and vertical discretized one-dimensional Gaussian first-order derivative sequences to obtain the horizontal gradient map and the vertical gradient map. The specific formula is as follows:
[0077] d x =I G *G xσ ′ (2)
[0078] d y =I G *G yσ ′ (3)
[0079] Among them, G xσ ′ and G yσ ′ represents the one-dimensional Gaussian first-order derivative sequence of the horizontal and vertical discretization, d x and d y Represent the horizontal gradient map and the vertical gradient map respectively.
[0080] Next, calculate the gradient magnitude and direction, the calculation formulas are:
[0081]
[0082] Step 3: Non-maximum suppression
[0083] Non-maximum suppression is an edge refinement method. Typically, edges detected by gradient calculations are wider than a single pixel. To reduce the edge response and render the edge as a single-pixel-wide line, non-maximum suppression is performed on the gradient. During non-maximum suppression, each pixel is checked to see if its gradient magnitude is the maximum within a certain range of its gradient direction. If so, the pixel is retained; otherwise, it is discarded.
[0084] Step 4: Dual Threshold Detection
[0085] Dual-threshold detection screens edges based on a gradient magnitude map after non-maximum suppression. The dual threshold consists of a preset high and low threshold. If the gradient magnitude of an edge pixel is greater than the high threshold, the pixel is considered a strong edge and retained. If the gradient magnitude is less than the low threshold, the pixel is considered a non-edge and deleted. If the gradient magnitude is between the high and low thresholds, the pixel is considered a weak edge and awaits further processing.
[0086] Step 5: Hysteresis Edge Tracking
[0087] Hysteresis edge tracking is used to process weak edge points whose gradient amplitudes fall between the upper and lower thresholds in the previous step. Weak edge points can be true edges or artifacts caused by noise. Generally, true weak edges are connected to strong edges, while artifacts caused by noise are not. Therefore, the specific method of hysteresis edge tracking is to search for all connected weak edges. If any point on a weak edge is connected to a strong edge, the weak edge is retained; otherwise, it is deleted. This completes the edge detection process.
[0088] 2) Fit a circle to the edge points as a reference ball;
[0089] 2.1) Randomly sample edge points and use the sampled points to fit a circle;
[0090] A circle can be represented by the following equation:
[0091] a1·x 2 +a2·y 2 +a3+a4·2xy+a5·2x+a6·2y=0 (6)
[0092] Among them, (x, y) is the pixel coordinate, a1, a2, a3, a4, a5, a6 are the parameters in the circle equation. Using random sampling, randomly sample M>6 points from the edge detection result image, the coordinates of the point are (x n ,y n ), n=1,2,…,M. Use the coordinates of the sampling points to fit the circle, that is, solve the following equation:
[0093]
[0094] If symbol B is used M×6 Represents the matrix on the left side of the above equation, which can be rewritten as in The equation can be solved by the singular value decomposition of the matrix. The solution process is as follows: Assume that the matrix B M×6 The singular value decomposition of M×6 =U M×M Σ M×6 V 6×6 T , where U M×M and V 6×6 are all orthogonal matrices, Σ M×6 is the matrix B M×6 The singular values of are arranged in descending order to form a diagonal matrix, equation The optimal solution Equal to V 6×6 The last column vector of V. 6×6 The last column vector of
[0095] 2.2) Classify all edge points into outer points and inner points according to the fitted circle;
[0096] Assume that the coordinates of the i-th edge point in the edge detection result graph are (x i ,y i ), substitute the above coordinates into the following formula to solve the error e i :
[0097]
[0098] If the error is less than the preset threshold e T , then the changed point is considered to be an interior point, otherwise it is considered to be an exterior point.
[0099] 2.3) Set a threshold. If the distance between an outlier point and the fitted circle is less than the preset threshold, the outlier point is considered an inlier point. Traverse all edge points in the edge detection result graph to obtain an updated set of inliers.
[0100] 2.4) Refit the circular edge based on the latest set of inliers;
[0101] 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, obtaining the final fitted circle; and count the number of its inliers and outliers;
[0102] The circular edge enclosed area fitted through the above steps is the detected reference ball area.
[0103] 3) Segmentation of corrosion damage;
[0104] In digital radiographic images, corrosion damage appears as abnormal highlights;
[0105] The basic process of corrosion damage area segmentation is: first, reduce the interference caused by the uneven brightness field through brightness field non-uniformity correction; then extract features pixel by pixel; finally, classify the pixels according to the extracted features to achieve corrosion damage area segmentation.
[0106] 3.1) Perform brightness non-uniformity field correction on the image before segmentation. In the present invention, brightness non-uniformity field correction includes the following two steps: brightness field calculation and brightness correction.
[0107] 3.1.1) Luminance field calculation
[0108] Obtaining a grayscale image of the digital radiographic image, and then performing erosion and dilation operations on the grayscale image. The grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital radiographic image.
[0109] The brightness field represents the overall trend of brightness changes in a digital radiographic image. Here, we interpret the brightness field as the background grayscale image of the digital radiographic image. The present invention calculates the background grayscale image through morphological transformation of the image, specifically by eroding and dilating the grayscale image.
[0110] Erosion of grayscale images;
[0111] Figure 2 A simple example shows the erosion process of a grayscale image:
[0112] Step 1: Define a structure element with a set shape, such as Figure 2 (a);
[0113] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, such as Figure 2 (b), the grayscale values of pixels at each position are marked in the figure;
[0114] Step 3: Assign the minimum grayscale value within the coverage of the structural element to the pixel at the center of the structural element, such as Figure 2 In (b), the grayscale minimum value 0 within the coverage of the yellow structure element is assigned to the center pixel indicated by the red border.
[0115] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the corrosion operation, such as Figure 2 (c) shown.
[0116] Dilation of grayscale images
[0117] Down Figure 3 A simple example shows the expansion process of the grayscale image:
[0118] Step 1: Define a structural element of a certain shape, such as Figure 3 -(a);
[0119] Step 2: Place the center of the structure element at a certain pixel position in the grayscale image, such as Figure 3 (b), the grayscale values of pixels at each position are marked in the figure;
[0120] Step 3: Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element, such as Figure 3 In (b), the maximum grayscale value 0 within the coverage of the green structure element is assigned to the center pixel indicated by the red border.
[0121] Step 4: Repeat the above steps 2 and 3 until all pixels are traversed to obtain the grayscale image after the expansion operation, such as Figure 3 (c) shown.
[0122] In summary, Figure 2(b) is the original image to be processed, Figure 3 (c) is the background grayscale image obtained by the corrosion and expansion operation. It can be seen that Figure 3 The brightness in (c) can reflect Figure 2 (b) The overall change trend of brightness.
[0123] 3.2) Brightness Correction
[0124] That is, brightness correction is performed by subtracting the original image from the background grayscale image;
[0125] After the erosion and expansion of the grayscale image, Figure 2 (b) The original image to be processed is obtained Figure 3 (c) shows the background grayscale image. This embodiment adopts a simple brightness correction method, that is, brightness correction is performed by subtracting the original image from the background grayscale image. Figure 4 As shown, Figure 4 (a) with Figure 2 (b) is the same, which is the original image to be processed; Figure 4 (b) with Figure 3 (c) is the same, which is the background grayscale image; Figure 4 (c) is the image after brightness correction. It can be seen that Figure 4 In (c), the uneven field in the background brightness has been filtered out and the local highlights have been highlighted.
[0126] 3.3) Feature Extraction
[0127] The corrosion area is segmented by classifying pixels one by one. The pixel features based on which pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature.
[0128] The global feature used is the grayscale histogram of the corrosion damage area circled manually in the digital radiographic image.
[0129] The calculation process of the grayscale histogram is as follows:
[0130] Step 1: Divide the grayscale into K intervals;
[0131] Step 2: Traverse all pixels in the roughly circled corrosion damage area and count the number of pixels whose grayscale values fall into each grayscale interval. Assume that the number of pixels falling into the kth grayscale interval is n. k ;
[0132] Step 3: Calculate the proportion of pixel grayscale values in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is N. pixel , then the proportion of pixels in the kth grayscale interval is Array {p1,p2,p3,…,pK}That is, the grayscale histogram of the approximate area of corrosion damage.
[0133] The local feature used in the present invention is the average value of the grayscale value of pixels in a local area formed with a pixel as the center and an artificially set threshold as the radius.
[0134] 3.4) Region Segmentation
[0135] Region segmentation is achieved through pixel-by-pixel classification based on extracted pixel features, using a random forest classifier. The basic idea of a random forest is to train a decision tree by randomly extracting a certain number of samples from the original training set with replacement through resampling. This process is repeated to train a certain number of decision trees to form a random forest. The classification result of the random forest is determined by voting among the decision trees.
[0136] The training process of the decision tree is as follows:
[0137] Step 1: For the sample set D of the current node (if in the initial stage of training, start from the root node), if the number of samples is less than the threshold or there is no feature, the recursion of the current node stops;
[0138] Step 2: Calculate the Gini coefficient of sample set D. Pixels are classified into two categories: normal and corroded. Assuming that the subset of sample set D that belongs to normal is D1 and the subset that belongs to corroded is D2, the Gini coefficient calculation formula of sample set D is as follows:
[0139]
[0140] Among them, |D1|, |D2| and |D| represent the number of samples in D, D1 and D2 respectively. If the Gini coefficient is less than the threshold, the current node stops recursion;
[0141] Step 3: Calculate the Gini coefficient of each partition point of each feature of the current node for the sample set D. The calculation method is as follows:
[0142] Arrange the eigenvalues of feature F of each sample in sample set D from small to large, f1, f2, f3, ..., f |D| , each dividing point of feature F is the average value of two adjacent eigenvalues. If the dividing point T i The sample set D is divided into two subsets D′ and D″ as the boundary, then the partition point T for feature F is i The Gini coefficient calculation formula is:
[0143]
[0144] The calculation formula of the Gini coefficient of subsets D′ and D″ is the same as the calculation method of the Gini coefficient shown in formula (9).
[0145] Step 4: Select the feature and corresponding split point with the smallest Gini coefficient from the calculated Gini coefficients of each feature and split point for sample set D. Then, divide sample set D into two subsets based on the selected features and split points, and create two new child nodes.
[0146] Step 5: Recursively call steps 1 to 4 for the two new child nodes created in step 4 until the recursive stop condition is met.
[0147] When a decision tree makes classification predictions, it uses the features and partitioning points selected by each node of the decision tree to divide the samples to be classified into a certain terminal node, and then takes the category with the largest number of training sample subsets that fall into this node during the training process as the predicted category of the sample to be classified.
[0148] The training process of random forest is as follows:
[0149] Step 1: Randomly sample a certain number of samples with replacement from the training sample set;
[0150] Step 2: Randomly select N features from all features and use these features to build a decision tree for the selected samples;
[0151] Step 3: Repeat the above two steps until M is generated tree decision trees to form a random forest.
[0152] In this embodiment, the corrosion damage area segmentation is done by random forest classification prediction, and each decision tree in the random forest is used in turn to make classification predictions, and then the voting results of the decision tree classification predictions are used as the classification prediction results of the random forest. Figure 5 shown. Figure 5 middle, Figure 5 (a) shows the approximate area of the corrosion damage manually circled with a box. It can be seen that there is an obvious brightness uneven field in the original digital ray image, and the contrast between the corrosion damage and the background is not very obvious; Figure 5 (b) is the effect image after correction using the brightness non-uniform field correction method. It can be seen that this method significantly corrects the uneven background brightness and increases the brightness contrast between the damaged area and the background area; Figure 5 The area surrounded by red lines in (c) is the segmented corrosion damage area.
[0153] 4) Based on the detection results of the benchmark ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the collected digital image;
[0154] 4.1 Calculation of corrosion damage depth;
[0155] In digital radiographic images, the thicker the object, the smaller the grayscale value of the corresponding area in the image, and the brighter the image. It is generally believed that corrosion causes the thickness of an object to decrease, so corrosion appears as abnormally bright areas in the image. The depth of corrosion damage can be calculated by converting grayscale values.
[0156] Step 1: Calculate the minimum grayscale value of the reference ball area in the reference ball detection results We believe that the minimum grayscale value of the reference ball area corresponds to the diameter of the reference ball. In practical applications, the actual diameter of the reference ball d bell known;
[0157] Step 2: Based on the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage and will As the grayscale value that the photographed object should have when it is not damaged;
[0158] Step 3: Based on the corrosion damage segmentation results, calculate the corrosion depth of the corresponding corrosion area pixel by pixel. Assume that the gray value of the i-th pixel in the corrosion area is g i , the corrosion depth of the area corresponding to the pixel
[0159] Step 4: Perform basic corrosion depth analysis based on the corrosion depth corresponding to the corrosion area pixels calculated in the third step, including calculating the minimum, maximum, and mean corrosion depths and calculating the corrosion depth histogram. The calculation process of the corrosion depth histogram is consistent with the grayscale histogram calculation process mentioned above.
[0160] 4.2 Calculation of corrosion damage area;
[0161] The detection results for the reference spheres can be used to determine the number of pixels occupied by the reference spheres in the digital radiographic image. Since the actual diameter of the reference spheres is known, the area of their maximum cross-section is also known. We assume that the maximum cross-section of the reference sphere corresponds to the reference sphere detected in the digital radiographic image. Furthermore, the corrosion damage segmentation results can be used to determine the number of pixels occupied by the corrosion damage in the digital radiographic image. Based on this, the corrosion damage area can be proportionally calculated.
[0162] The calculation process of corrosion damage area is as follows:
[0163] Step 1: According to the actual diameter d of the reference ball ball , calculate the actual area of the maximum cross section of the reference ball as
[0164] Step 2: Based on the detection results of the reference balls, count the number of pixels N occupied by the reference balls in the digital radiographic image. ball ;
[0165] Step 3: Based on the corrosion damage segmentation results, count the number of pixels N occupied by corrosion damage in the digital radiographic image. erosion ;
[0166] Step 4: Calculate the corrosion damage area
[0167] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention.
Claims
1. A method for rapid assessment of ship corrosion based on image recognition, characterized in that: The following steps are involved: 1) Performing edge detection on the collected digital corrosion image to be evaluated; the digital corrosion image is a digital radiographic image obtained by a ship corrosion detection device during non-destructive testing; 2) Fit a circle to the edge points as a reference ball; 3) Segmentation of corrosion damage; The basic process of corrosion damage area segmentation is: first, reduce the interference caused by the uneven brightness field through brightness field correction; then extract features pixel by pixel; Finally, the pixels are classified according to the extracted features to achieve the segmentation of the corrosion damage area; 4) Based on the detection results of the benchmark ball and the segmentation results of the corrosion damage, the corrosion damage depth and area are calculated for the acquired digital image; The number of pixels occupied by the reference ball in the digital radiographic image is obtained, and the actual corrosion position, area, and thickness are obtained based on the area and diameter of the reference ball. The corrosion damage depth is calculated as follows: Calculate the minimum grayscale value of the reference ball area in the reference ball detection result , the minimum gray value of the reference ball area corresponds to the diameter of the reference ball, and the actual diameter of the reference ball is ; According to the corrosion damage segmentation results, calculate the grayscale mean of the non-damaged area around the corrosion damage , and As the grayscale value that the photographed object should have when it is not damaged; According to the corrosion damage segmentation results, the corrosion depth of the corresponding corrosion area is calculated pixel by pixel; Assume that the corrosion area The gray value of a pixel is , the corrosion depth of the area corresponding to the pixel ; Perform basic corrosion depth analysis based on the corrosion depth corresponding to the corrosion area pixels calculated in the third step, calculate the minimum, maximum, and mean corrosion depths, and calculate a histogram of the corrosion depths; The calculation process of corrosion damage area is as follows: According to the actual diameter of the reference ball , calculate the actual area of the maximum cross section of the reference ball as ; According to the detection results of the benchmark balls, the number of pixels occupied by the benchmark balls in the digital radiographic image is counted. ; According to the corrosion damage segmentation results, the number of pixels occupied by corrosion damage in the digital radiographic image is counted. ; Calculation of corrosion damage area .
2. The method for rapid ship corrosion assessment based on image recognition according to claim 1, characterized in that: The step 2) is specifically as follows: 2.1) Randomly sample edge points and use the sampled points to fit a circle; 2.2) Classify all edge points into outer points and inner points according to the fitted circle; 2.3) Set a threshold. If the distance between an outlier point and the fitted circle is less than the preset threshold, the outlier point is considered an inlier point. Traverse all edge points in the edge detection result graph to obtain an updated set of inliers. 2.4) Refit the circular edge based on the latest set of inliers; 2.5) Repeat steps 2.2) to 2.4) until the fitted circle no longer changes, obtaining the final fitted circle; count the number of inliers and outliers.
3. The method for rapid ship corrosion assessment based on image recognition according to claim 1, characterized in that: The step 3) is as follows: 3.1) Before segmentation, the image is first corrected for uneven brightness to filter out uneven background brightness. 3.2) Feature extraction; 3.3) Classify pixels according to features to achieve segmentation of the corrosion area.
4. The method for rapid ship corrosion assessment based on image recognition according to claim 3 is characterized in that: The steps 3.1) are as follows: The correction of brightness non-uniform field includes the following steps: brightness field calculation and brightness correction; 3.1.1) Luminance field calculation Obtaining a grayscale image of the digital radiographic image, and then performing erosion and dilation operations on the grayscale image. The grayscale image after the dilation operation reflects the overall change trend of the brightness in the digital radiographic image. The brightness field is represented as the background grayscale image of the brightness in the digital radiographic image. The background grayscale image is calculated through the morphological transformation of the image. The specific process includes the erosion and dilation of the grayscale image. The erosion process of the grayscale image is as follows; Define a structure element of a set shape; The center of the structural element is placed at a certain pixel position in the grayscale image, and the grayscale value of each pixel position is marked in the grayscale image; Assign the minimum grayscale value within the coverage of the structural element to the pixel at the center of the structural element; Repeat the above process until all pixels are traversed to obtain the grayscale image after the corrosion operation; The expansion process of the grayscale image is as follows: Define a structural element of a certain shape; The center of the structural element is placed at a certain pixel position in the grayscale image, and the grayscale value of each pixel position is marked in the grayscale image; Assign the maximum grayscale value within the coverage of the structural element to the pixel at the center of the structural element; Repeat the above process until all pixels are traversed to obtain the grayscale image after the expansion operation; 3.1.2) Brightness Correction That is, brightness correction is performed by subtracting the original image from the background grayscale image.
5. The method for rapid ship corrosion assessment based on image recognition according to claim 3 is characterized in that: The steps 3.2) are as follows: The corrosion area is segmented by classifying pixels one by one. The pixel features based on which the pixel classification is performed are divided into two parts: one is the global feature and the other is the local feature. The global feature used is the grayscale histogram of the approximate area of corrosion damage circled manually in the digital radiographic image; The local feature is the mean of the pixel grayscale values in a local area with the pixel as the center and the manually set threshold as the radius.
6. The method for rapid ship corrosion assessment based on image recognition according to claim 5 is characterized in that: The calculation process of the grayscale histogram is as follows: Step 1: Divide the grayscale into intervals; Step 2: Traverse all pixels in the roughly corroded area circled manually, and count the number of pixels whose grayscale values fall into each grayscale interval. The number of pixels in a grayscale interval is ; Step 3: Calculate the proportion of pixel grayscale values in each grayscale interval in the roughly circled corrosion damage area. Assume that the total number of pixels in the roughly circled corrosion damage area is , then The proportion of pixels in the grayscale interval is , array That is, the grayscale histogram of the approximate area of corrosion damage.
7. An electronic device, characterized in that: include: one or more processors; as well as a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to perform the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for recognizing position of spherical object based on contour
CN106446894A
On-line monitoring IED system for transformer substation insulation equipment
CN114092430A