Ship secondary rust removal surface rust grade analysis method, device, equipment and medium

CN122887761APending Publication Date: 2026-10-09SHIPBUILDING TECHNOLOGY RESEARCH INSITITUTE (NO 11 INSTITUTE OF CSSC) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610712025.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-22
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0009]本发明旨在克服现有技术中锈蚀等级评估主观性强、频谱分析对象为整体区域、采用单一频带特征、仅用于除锈后检验、分级粒度粗放的缺陷,提供一种船舶二次除锈表面锈蚀等级分析方法、装置、设备及介质

Benefits of technology

[0021]与现有技术相比,本发明具有以下有益效果:通过图像预处理、像素级精细分割、独立区域频谱分析、空间分布特征提取、锈蚀等级分类及除锈效果判定的完整流程,能够精准剔除无锈蚀背景干扰,从多维度刻画锈蚀状态,实现船舶二次除锈前五级锈蚀等级的自动化精细评估与除锈后效果的量化判定,同时可区分激光除锈表面与自然锈蚀表面、识别周期性表面缺陷,为激光除锈工艺参数设置与质量验收提供可靠依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887761A_ABST
    Figure CN122887761A_ABST
Patent Text Reader

Abstract

The application discloses a ship secondary rust removal surface rust grade analysis method, device, equipment and medium. Through the complete process of image preprocessing, pixel-level fine segmentation, independent region spectrum analysis, spatial distribution feature extraction, rust grade classification and rust removal effect determination, the application can accurately remove non-rust background interference, depict the rust state from multiple dimensions, realize the automatic fine evaluation of the five-grade rust grade before the secondary rust removal of the ship and the quantitative determination of the effect after the rust removal, and can distinguish the laser rust removal surface and the natural rust surface, identify the periodic surface defects, and provide reliable basis for laser rust removal process parameter setting and quality acceptance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ship section manufacturing technology, and in particular to a method, apparatus, equipment and medium for analyzing the rust level of a ship's secondary rust removal surface. Background Technology

[0002] Sectional manufacturing is a core part of shipbuilding and repair, and the quality of secondary rust removal on the large surface areas of these sections directly affects the adhesion of subsequent coatings and the overall corrosion resistance of the ship. Traditional rust removal methods for section surfaces mainly employ sandblasting, high-pressure jetting, or manual grinding, which suffer from serious dust pollution, harsh working environments, high labor intensity, low efficiency, and difficulties in waste recycling. Furthermore, these methods fail to meet the environmental protection and automation requirements of modern green shipbuilding.

[0003] In the process of ship section manufacturing, the assessment of rust level before secondary rust removal is an important basis for formulating rust removal process plans. At present, rust level assessment mainly relies on manual visual inspection and comparison with GB / T 8923 or ISO 8501 standards, which has problems such as strong subjectivity, poor consistency and low efficiency.

[0004] In recent years, automated rust detection methods based on machine vision have received widespread attention. Existing technologies include methods that apply spectral analysis to verify the effectiveness of laser rust removal. These methods calculate the average energy of the low-frequency band in the post-removal image and compare it with a preset threshold to determine whether the rust removal meets the standards. However, existing methods have the following shortcomings: First, the spectral analysis targets the entire image region. Existing techniques typically perform Fourier transforms on the entire image or a roughly divided ROI region, without considering the independent characteristics of each rusted area. Since the spectral characteristics of non-rusted background areas and rusted areas differ significantly, overall analysis is prone to introducing background interference, reducing the accuracy and stability of feature extraction.

[0005] Second, the use of single-frequency band characteristics for judgment. Existing technologies mostly extract only the single energy value of the mid-to-low frequency band as an evaluation indicator, failing to fully utilize the multi-dimensional characteristics of spectrum information. The degree of corrosion varies in low-frequency, mid-frequency, and high-frequency bands, and a single feature is insufficient to comprehensively reflect the complexity of corrosion.

[0006] Third, its application is limited to the inspection of rust removal results. Existing technology is only used to determine the pass / fail status of rust removal, lacking refined assessment methods for the pre-rust removal stage. It cannot provide a quantitative basis for differentiated setting of process parameters before rust removal operations.

[0007] Fourth, the grading granularity is relatively coarse. Existing technologies classify rust conditions into a few categories (such as light, medium, and heavy), which is insufficient to meet the needs of refined process control and quality traceability.

[0008] To address the aforementioned shortcomings, this invention proposes a method for analyzing the rust level of ship secondary rust removal surfaces based on finely segmented regional spectral analysis. Summary of the Invention

[0009] This invention aims to overcome the shortcomings of existing technologies, such as strong subjectivity in rust grade assessment, spectral analysis of the entire region, use of single frequency band characteristics, use only for post-rust removal inspection, and coarse grading. It provides a method, device, equipment, and medium for analyzing the rust grade of a ship's secondary rust removal surface.

[0010] This application provides a method for analyzing the rust level of a ship's secondary rust removal surface, which includes the following steps: The original image of the planar working area of ​​the ship section is acquired, and the original image is preprocessed by grayscale conversion, median filtering for noise reduction and histogram equalization to obtain the surface image; An arbitrary segmentation model finely tuned and optimized from a ship corrosion image dataset is used to perform pixel-level segmentation of the corrosion region in the surface image, and several corrosion region masks are extracted. Two-dimensional discrete Fourier transform is performed on the image pixel data of each rusted region mask to transform the surface image from the spatial domain to the frequency domain, and the spectrum of each rusted region mask is obtained. The spectrum is divided into low frequency band, mid frequency band and high frequency band. The average energy of mid frequency band, the energy ratio of low frequency band, the energy attenuation rate of high frequency band, radial power spectrum and frequency domain peak value are extracted to construct multi-dimensional spectrum features. Extract the red high-energy points in the spectrum whose energy values ​​are greater than the global maximum value by the first proportion, and calculate the spatial uniformity index, directionality index, density distribution uniformity index, and brightness uniformity index of the red high-energy points to form spatial distribution characteristics; The multidimensional spectral features and the spatial distribution features are combined to construct a spectral feature vector before rust removal. The spectral feature vector before rust removal is then input into the rust level classification model to determine the rust level corresponding to each rust area mask. The rust levels corresponding to the masks of each rusted area are summarized, and the rust levels are superimposed on the original image to generate a rust level distribution map before rust removal. After the laser rust removal operation is completed, the image after rust removal is acquired again. The spectral feature vector after rust removal is determined based on the image after rust removal. The spectral feature change rate before and after rust removal is calculated based on the spectral feature vector before and after rust removal. The rust removal effect level is determined based on the comparison result of the spectral feature change rate with the preset threshold.

[0011] Furthermore, the preprocessing of the original image to obtain the surface image by grayscale conversion, median filtering for noise reduction, and histogram equalization includes: The original image is converted from a color image to a grayscale image, and the grayscale image is then filtered using median filtering to remove salt-and-pepper noise introduced during the image acquisition process. Histogram equalization is applied to the denoised grayscale image to enhance image contrast. Apply Gaussian blur to an equalized grayscale image.

[0012] Furthermore, the arbitrary segmentation model, fine-tuned and optimized using a ship corrosion image dataset, is used to perform pixel-level segmentation of the corrosion region in the surface image, extracting several corrosion region masks, including: Deploy an arbitrary segmentation model on an airborne industrial control computer, finely tuned through transfer learning; A ship corrosion image dataset is formed by pixel-level annotation of planar images of ship sections covering rust at the closure joint, thick rust, light surface rust, no rust, and different lighting conditions. The annotation areas include the boundaries of the rusted areas and the boundaries of the closure joint. The arbitrary segmentation model was fine-tuned using the aforementioned ship rust image dataset; The surface image is input into the fine-tuned arbitrary segmentation model, which outputs a rust region mask after pixel-level segmentation of each rust region. The rust region mask is stored in the form of a binary image, where a region with a pixel value of 1 represents rust and a region with a pixel value of 0 represents the background. For a surface image containing multiple rust regions, the arbitrary segmentation model outputs multiple rust region masks, and the rust region masks do not overlap with each other.

[0013] Furthermore, a two-dimensional discrete Fourier transform is performed on the image pixel data of each rusted region mask to convert the surface image from the spatial domain to the frequency domain, obtaining the spectrum of each rusted region mask. The spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band. The average energy of the mid-frequency band, the energy proportion of the low-frequency band, the energy attenuation rate of the high-frequency band, the radial power spectrum, and the frequency domain peak value are extracted to construct multi-dimensional spectral features, including: For each rusted area mask, the corresponding image pixel data is extracted, and spectral analysis is performed on each. The image area covered by the rusted area mask is extracted and its size is normalized to obtain a grayscale image matrix. A two-dimensional discrete Fourier transform is performed on the grayscale image matrix to obtain a spectrum, which contains the amplitude and phase information of each frequency component. The zero-frequency component is shifted to the center of the spectrum to obtain the frequency-shifted spectrum. The frequency-shifted spectrum is then divided into low-frequency band, mid-frequency band, and high-frequency band. Calculate the sum of squared amplitudes of all pixels in the mid-frequency band, divide by the total number of pixels in the mid-frequency band, and obtain the average energy of the mid-frequency band. Calculate the proportion of the total spectral energy to the sum of squared amplitudes of all pixels in the low-frequency band to obtain the energy proportion of the low-frequency band. Extract the energy values ​​of different frequency bands within the high-frequency band, fit the attenuation curve of energy as a function of frequency, perform power-law fitting on the energy change of the high-frequency band as a function of frequency, calculate the attenuation exponent, and obtain the energy attenuation rate of the high-frequency band. Using the center of the spectrum as the origin, the average energy at each radial distance is calculated to generate a radial power spectrum curve; Peak detection is performed on the radial power spectrum to identify periodic frequency components that are greater than the peak height threshold as the frequencies corresponding to the peaks, and the spatial period corresponding to the frequencies corresponding to the peaks is calculated.

[0014] Furthermore, the step of extracting red high-energy points with energy values ​​greater than the global maximum in the spectrum image at a first proportion, and calculating the spatial uniformity index, directionality index, density distribution uniformity index, and brightness uniformity index of the red high-energy points to constitute spatial distribution characteristics includes: Extract the pixels in the spectrum whose energy values ​​are greater than the first proportion of the global maximum value as red high-energy points, and obtain the point coordinate matrix of the red high-energy points; Calculate the distance from each red high-energy point to its nearest neighbor, calculate the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors, and determine the spatial uniformity index of each red high-energy point based on the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors. The point coordinate matrix is ​​centered, the covariance matrix is ​​calculated, the covariance matrix is ​​decomposed into eigenvalues ​​to obtain eigenvalues ​​and their corresponding eigenvectors, the directional index is determined based on the eigenvalues, and the principal direction angle of the red high-energy point is determined based on the eigenvectors. The spectrum is divided into grids, the number of red high-energy points in each grid is calculated to obtain the density matrix, the mean and standard deviation of the density matrix are calculated, the density variation coefficient is determined based on the mean and standard deviation of the density matrix, and the density variation coefficient is used as an index of density distribution uniformity. Calculate the coefficient of variation of the intensity of each red high-energy point, and use the coefficient of variation of the intensity of the red high-energy point as an index of brightness uniformity.

[0015] Furthermore, the step of inputting the pre-rust removal spectral feature vector into the rust level classification model to determine the rust level corresponding to each rust region mask includes: Multiple samples from rusted areas were collected, and the rust levels for each sample were set as follows: Level I: no rust or very slight rust; Level II: light surface rust; Level III: moderate rust; Level IV: relatively thick rust; and Level V: severe rust. A corrosion level classification model was trained using a support vector machine based on the corrosion area samples. A radial basis function kernel was selected as the kernel function. The penalty parameter and kernel parameter were optimized through five-fold cross-validation to obtain the trained corrosion level classification model. The spectral feature vector before rust removal is input into the trained rust level classification model, and the rust level corresponding to each rust area mask is output.

[0016] Furthermore, the step of calculating the rate of change of spectral features before and after rust removal based on the spectral feature vector before and after rust removal, and determining the rust removal effect level based on the comparison result of the rate of change of spectral features with a preset threshold, includes: Calculate the Euclidean distance between the feature vector before rust removal and the feature vector after rust removal, calculate the magnitude of the feature vector before rust removal, and divide the Euclidean distance by the magnitude of the feature vector before rust removal to obtain the spectral feature change rate.

[0017] Select steel plate samples that meet the ship target rust removal process standards, calculate their spectral feature vector as the reference vector, and use the second proportion of the reference vector magnitude as the preset compliance threshold. When the rate of change of the spectral characteristics is greater than the preset threshold, the rust removal is deemed qualified and the rust removal effect level is identified; otherwise, the rust removal is deemed unqualified and a re-cleaning prompt message is sent.

[0018] This application also provides a device for analyzing the surface rust level during secondary rust removal on ships, including: The image acquisition module includes an industrial camera installed on a wall-climbing robot or a handheld terminal, used to acquire original images of the planar working area of ​​the ship section, and to perform grayscale conversion, median filtering for noise reduction and histogram equalization preprocessing on the original images to obtain surface images. The fine segmentation module, deployed on an airborne industrial control computer, has a built-in arbitrary segmentation model finely tuned and optimized from a ship corrosion image dataset. It is used to perform pixel-level segmentation of the corrosion area in the surface image and extract several corrosion area masks. The spectrum analysis module is used to perform two-dimensional discrete Fourier transform on the image pixel data of each rusted area mask, transform the surface image from the spatial domain to the frequency domain, obtain the spectrum map of each rusted area mask, divide the spectrum map into low frequency band, mid frequency band, and high frequency band, and extract multi-dimensional spectrum features. The distribution feature analysis module is used to extract red high-energy points with energy values ​​greater than the first proportion of the global maximum value in the spectrum, and calculate the spatial uniformity index, directionality index, density distribution uniformity index and brightness uniformity index of the red high-energy points to form spatial distribution features; The classification module has a built-in rust level classification model trained on rust area samples. It is used to combine the multi-dimensional spectral features with the spatial distribution features to construct a spectral feature vector before rust removal. The spectral feature vector before rust removal is then input into the rust level classification model to determine the rust level corresponding to each rust area mask. The evaluation output module is used to summarize the rust levels corresponding to the masks of each rusted area, overlay the rust levels on the original image to generate a rust level distribution map before rust removal, and acquire the image after rust removal again after the laser rust removal operation is completed. The spectral feature vector after rust removal is determined based on the image after rust removal. The spectral feature change rate before and after rust removal is calculated based on the spectral feature vector before and after rust removal. The rust removal effect level is determined based on the comparison result of the spectral feature change rate with the preset threshold.

[0019] This application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described methods for analyzing the surface rust level of secondary rust removal on ships.

[0020] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described methods for analyzing the surface rust level of secondary rust removal for ships.

[0021] Compared with existing technologies, the present invention has the following advantages: through a complete process of image preprocessing, pixel-level fine segmentation, independent region spectrum analysis, spatial distribution feature extraction, rust level classification and rust removal effect judgment, it can accurately eliminate background interference without rust, characterize the rust state from multiple dimensions, realize the automated and fine evaluation of the five rust levels before secondary rust removal of ships and the quantitative judgment of the effect after rust removal, and at the same time, it can distinguish between laser rust removal surfaces and natural rust surfaces, identify periodic surface defects, and provide a reliable basis for setting laser rust removal process parameters and quality acceptance. Attached Figure Description

[0022] Figure 1 This is a flowchart of a method for analyzing the surface rust level during secondary rust removal of ships, as described in one embodiment of this application. Figure 2 This is a schematic diagram of the spectrum analysis and feature extraction process in one embodiment of this application; Figure 3 This is a schematic diagram of the distribution analysis of red high-energy points in one embodiment of this application; Figure 4 This is a flowchart of a method for analyzing the surface rust level during secondary rust removal of ships, as described in another embodiment of this application. Figure 5This is a structural block diagram of a ship secondary rust removal surface rust level analysis device in one embodiment of this application; Figure 6 This is an internal structural diagram of a computer device in one embodiment of this application. Detailed Implementation

[0023] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] Example 1 Embodiment 1 of this application provides a method for analyzing the rust level of a ship's secondary rust removal surface based on finely segmented regional spectrum analysis, including the following steps S100-S600.

[0025] Step S100: Image acquisition and preprocessing.

[0026] The original images of the planar working area of ​​the ship section are acquired by an industrial camera. The images are then converted to grayscale, denoised by median filtering, and enhanced by histogram equalization to improve contrast, resulting in a preprocessed image.

[0027] Step S200: Finely segment and extract individual rusted areas.

[0028] The SAM (Segment Anything Model) model, which is finely tuned and optimized using a ship corrosion image dataset, is used to perform pixel-level fine segmentation of the corrosion region in the image, extracting several independent corrosion region masks that do not overlap with each other.

[0029] Step S300: Spectral analysis and feature extraction of each independent corrosion area.

[0030] Two-dimensional discrete Fourier transforms are performed on the image data of each independent corrosion region to convert the image from the spatial domain to the frequency domain, obtaining the spectrum of each region. Multi-dimensional spectral feature parameters are extracted based on the spectrum to construct a multi-dimensional feature vector reflecting the degree of corrosion. The feature vector includes: (1) Average energy in the mid-frequency band: The spectrum is divided into low-frequency bands (0-0.2). ), mid-frequency band (0.2) -0.6 ), high frequency band (0.6) - The average value of the sum of squares of the amplitudes of all pixels in the mid-frequency band is calculated in three frequency band regions to reflect the texture roughness of the rusted area. (2) Low-frequency band energy ratio: Calculate the proportion of low-frequency band energy to the total spectrum energy, which reflects the area size and distribution uniformity of the corrosion area; (3) High-frequency band energy attenuation rate: Calculate the rate at which the high-frequency band energy attenuates as the frequency increases, reflecting the sharpness of the edge of the rusted area; (4) Radial power spectrum: Taking the center of the spectrum as the origin, the average energy at each radial distance is calculated to generate a radial power spectrum curve, which is used to analyze the periodic characteristics of the rust texture; (5) Frequency domain peak detection: Peak detection is performed on the radial power spectrum to identify significant periodic frequency components, and the presence of regular surface defects is determined based on the spatial period corresponding to the peak.

[0031] Step S400: Analysis of the distribution characteristics of red high-energy points.

[0032] Extract red high-energy points from the spectrum whose energy values ​​are greater than 85% of the global maximum, and calculate their spatial distribution characteristics, including: (1) Spatial uniformity index: Calculate the coefficient of variation of the nearest neighbor distance of the red high-energy points to reflect the uniformity of the point distribution; (2) Directional index: The main direction of the distribution of red high-energy points and its contribution rate are calculated by principal component analysis to reflect whether there is obvious directional texture; (3) Density distribution uniformity: Divide the spectrum into grids and calculate the density variation coefficient of the red high-energy points in each grid to reflect the concentration of energy distribution; (4) Brightness uniformity index: Calculate the coefficient of variation of the intensity of red high-energy points to reflect the stability of energy intensity.

[0033] Step S500: Corrosion level classification based on multidimensional feature vectors.

[0034] The mid-frequency band average energy, low-frequency band energy ratio, high-frequency band energy attenuation rate, radial power spectrum peak intensity, red high-energy point uniformity index, directional index, density uniformity index, and brightness uniformity index extracted in step S300 are used to construct a multi-dimensional feature vector, which is then input into the pre-trained corrosion level classification model to output the fine corrosion level corresponding to each independent corrosion area.

[0035] Step S600: Generate a rust level distribution map and evaluate the effect.

[0036] The rust levels of each area are summarized and overlaid on the original image to generate a rust level distribution map before rust removal. After the laser rust removal operation is completed, steps S100 to S500 are repeated to obtain the spectral feature vectors of each area after rust removal. The rate of change of spectral features before and after rust removal is calculated, and the rust removal effect level is determined based on the comparison result of the rate of change with the preset threshold. The classification model is built based on support vector machine (SVM) and uses a training sample set labeled with standard rust levels for supervised learning to establish a nonlinear mapping relationship between spectral feature vectors and rust levels. The model outputs the fine rust level corresponding to each independent rust area, which is divided into five levels: Level I (no rust or very slight rust), Level II (light surface rust), Level III (moderate rust), Level IV (thick rust), and Level V (severe rust).

[0037] This embodiment provides an implementation method for image acquisition and preprocessing in step S100, including steps S110-S140.

[0038] Step S110: Image acquisition.

[0039] The wall-climbing robot is equipped with an industrial camera to collect original images of the working area on the plane of the ship section. The industrial camera is installed at the front of the robot, with the optical center fixed at a vertical distance of 300mm from the section plane, a vertical field of view of 80°, and a horizontal field of view of 50°.

[0040] Step S120: Grayscale conversion and noise reduction.

[0041] The acquired color image was converted to a grayscale image, and a 3×3 median filter was applied to the grayscale image. The image edges were well preserved after filtering, and the salt-and-pepper noise introduced during the acquisition process was removed.

[0042] Step S130: Histogram equalization.

[0043] Histogram equalization is applied to the denoised grayscale image to enhance image contrast. After equalization, the contrast between the rusted area and the background is significantly enhanced, providing better input for subsequent fine segmentation.

[0044] Step S140: Gaussian blur.

[0045] To reduce the impact of high-frequency noise on the Fourier transform, Gaussian blur is applied to the image using a 5×5 Gaussian kernel and a standard deviation σ=0. ​​The blurred image is then used as the input for spectral analysis.

[0046] This embodiment provides a method for implementing fine segmentation of the SAM model in step S200, including steps S210-S230.

[0047] Step S210: Model loading and configuration.

[0048] The airborne industrial control computer deploys a SAM model finely tuned through transfer learning. The SAM model adopts the Segment Anything Model architecture released by Meta, with the base version being SAM-Base.

[0049] Step S220: Fine-tuning of transfer learning.

[0050] The SAM model was fine-tuned using a self-built ship corrosion image dataset. The dataset contains 2000 planar images of ship sections, covering four working conditions: rust at the closure joint, thick rust, light surface rust, and no rust, as well as different lighting conditions (cloudy, sunny, and artificial lighting). Each image is pixel-level annotated, with the annotated areas including the boundaries of the rusted areas and the boundaries of the closure joint.

[0051] The fine-tuning process uses the Adam optimizer, with an initial learning rate set to 1e. -5 The batch size is 8, and the training lasts for 50 epochs. The loss function is a combination of cross-entropy loss and Dice loss. ; The Dice loss is defined as follows: ; P is the predicted mask, and G is the ground truth mask.

[0052] Step S230: Inference and Mask Output.

[0053] The preprocessed image is input into the fine-tuned SAM model, which outputs a pixel-level segmentation mask for each rust region. The mask is stored as a binary image, where a pixel value of 1 represents rust and a pixel value of 0 represents the background. For an image containing multiple independent rust regions, the model outputs multiple masks, which do not overlap.

[0054] This embodiment provides a method for implementing the spectral analysis and multidimensional feature extraction of each independent rust region in step S300, including steps S310-S370.

[0055] Step S310: Two-dimensional discrete Fourier transform.

[0056] For each rust-covered region mask output in step S230, the corresponding image pixel data is extracted and spectral analysis is performed. First, the image region covered by the rust mask is extracted and its size is normalized to 256×256 pixels to obtain the grayscale image matrix I(x,y).

[0057] Perform a two-dimensional discrete Fourier transform on this matrix: ; Where M and N are the image dimensions (M=N=256 in this embodiment), and u and v are frequency variables. The transformed spectrum F(u,v) is obtained, which contains the amplitude and phase information of each frequency component.

[0058] Step S320: Spectrum visualization and frequency band division.

[0059] The zero-frequency component is shifted to the center of the spectrum to obtain the frequency-shifted spectrum F. shift (u,v). For easier visualization, calculate the logarithmic transform of the amplitude spectrum: ; The spectrum is divided into three frequency bands: Low frequency band: 0-0.2 This corresponds to a smooth change in the overall brightness of the image; Mid-frequency band: 0.2 -0.6 This corresponds to the texture details and mid-scale features of the image; high-frequency band: 0.6 - This corresponds to image edges and noise.

[0060] Step S330: Calculation of average energy in the mid-frequency band.

[0061] Calculate the sum of squared amplitudes of all pixels in the mid-frequency band, divide by the total number of pixels in the mid-frequency band, and obtain the average energy of the mid-frequency band.

[0062] Step S340: Calculation of Low-Frequency Band Energy Ratio ; Calculate the proportion R of the sum of squared amplitudes of all pixels in the low-frequency band to the total spectral energy. low Large areas of corrosion have a high proportion of low-frequency energy due to their uniform spatial distribution. low Values ​​can reach above 0.6; small-area pitting corrosion R low The value is usually below 0.3.

[0063] Step S350: Calculation of high-frequency band energy attenuation rate.

[0064] Energy values ​​at different frequency bands within the high-frequency band are extracted, and attenuation curves of energy as a function of frequency are fitted. For the high-frequency region, energy exhibits a power-law attenuation with increasing frequency. ; Logarithmic fitting: ; The slope α is the high-frequency band energy attenuation rate. α reflects the sharpness of the corrosion edge: active corrosion edges are clear, with abundant high-frequency components, and the α value is small (about 0.5-0.8); passivated corrosion edges are blurry, with rapid high-frequency attenuation, and the α value is large (about 1.2-1.8).

[0065] Step S360: Radial power spectrum calculation.

[0066] Using the center of the spectrum as the origin, the average energy at each radial distance is calculated to generate a radial power spectrum curve. The specific calculation method is as follows: Create a distance matrix of the same size as the spectrogram, where the radial distance for each pixel (i,j) is: ; Among them, (c row , c col ( ) represents the center coordinates of the spectrogram. Rounding the distances to the nearest integer, the average energy of pixels at the same distance is calculated. ; Where, N r The x-axis represents the number of pixels at a distance of r, the y-axis represents the spatial frequency, and the y-axis represents the amplitude (dB).

[0067] Step S370: Frequency domain peak detection.

[0068] Peak detection was performed on the radial power spectrum curve to identify significant periodic frequency components. The `scipy.signal.find_peaks` function was used, with the peak height threshold set to the mean plus standard deviation of the radial power spectrum, and the minimum peak distance set to 10 frequency units. The detected peak positions corresponded to the spatial frequencies of periodic textures in the image.

[0069] For the detected peak value, calculate its corresponding spatial period: ; Where N is the image size (256 pixels) and f is the frequency corresponding to the peak.

[0070] This embodiment provides a method for implementing the red high-energy point distribution feature analysis in step S400, including steps S410-S440.

[0071] Step S410: Extraction of red high-energy spots.

[0072] Statistical analysis of the spectrum S(u,v) is performed, and pixels with energy values ​​greater than 85% of the global maximum are extracted as red high-energy points. The threshold calculation formula is as follows: ; Generate a binary mask M red (u,v): ; Obtain the coordinate set of red high-energy points to form a point coordinate matrix.

[0073] Step S420: Calculation of spatial uniformity index.

[0074] Calculate the coefficient of variation of the nearest neighbor distances of the red high-energy points, reflecting the uniformity of the point distribution. First, construct a KD-tree to accelerate the nearest neighbor search. For each point p... i Calculate its distance to the nearest neighbor p. j distance d i : ; Calculate the mean μ of the distances to all nearest neighbors. d and standard deviation σ d The uniformity index is defined as: ; Laser-removed rust surfaces have a uniform distribution of red high-energy points due to regular scanning marks, and the U value is usually less than 0.5; naturally rusted surfaces have a randomness, and the U value is usually greater than 0.7.

[0075] Step S430: Calculation of directional indicators.

[0076] Principal component analysis (PCA) was used to calculate the principal directions and their contribution rates of the red high-energy point distribution. The point coordinate matrix P was centered, and the covariance matrix was calculated. ; Eigenvalue decomposition of the covariance matrix yields eigenvalues ​​λ1 ≥ λ2 and their corresponding eigenvectors v1 and v2. The directionality index is defined as: ; The high-energy red spots on the laser-scanned surface are distributed along the scanning direction, with a high D value (>0.7); the high-energy red spots on the naturally corroded surface are isotropically distributed, with a low D value (<0.4). The principal direction angle θ is calculated from v1: ; Step S440: Calculation of density distribution uniformity.

[0077] The spectrogram is divided into an 8×8 grid. The number of red high-energy points in each grid is calculated to obtain the density matrix ρ(i,j). The mean μ of the density matrix is ​​then calculated. ρ and standard deviation σ ρ The density variation coefficient is defined as: The red high-energy spots on the laser-removed surface exhibit high uniformity in intensity, V intensity The value is usually less than 0.4; the intensity of red high-energy spots on naturally corroded surfaces varies greatly, V intensity The value is usually greater than 0.6.

[0078] This embodiment provides a method for constructing multidimensional feature vectors and classifying corrosion levels in step S500, including steps S510-S520.

[0079] Step S510: Feature vector construction.

[0080] The spectral features extracted in steps S330 to S370 are combined with the distribution features extracted in steps S420 to S450 to form a 14-dimensional feature vector: ; in: E mid Mid-frequency average energy; R low Low-frequency energy percentage; α: High-frequency band energy decay rate; P peak1 , P peak2 , P peak3 The intensity of the first three peaks in the radial power spectrum; U: Spatial uniformity index; D: Directional indicator; θ: Principal direction angle; V density Density variation coefficient; V intensity : Coefficient of variation of brightness; N red : Number of red high-energy points; σ red Standard deviation of the spatial distribution of red high-energy points; T period Dominant spatial cycle; Min-max normalization is used to map each feature value to the [0,1] interval: .

[0081] Step S520: Classification model training.

[0082] Two thousand samples of rusted areas were collected and evaluated according to ISO 8501-1 standard by a surface cleanliness tester and three engineers with marine coating inspection qualifications. The standard rust grade of each sample was determined, and the rust grades were divided into five levels: Grade I: No rust or very slight rust; Grade II: Light surface rust; Grade III: Moderate corrosion; Grade IV: Thick rust; Grade V: Severe corrosion.

[0083] For each sample, steps S100 to S500 are performed to extract a 14-dimensional feature vector. A support vector machine is used to train the classification model, with a radial basis function kernel selected. The penalty parameter C and the kernel parameter γ are optimized through five-fold cross-validation during training.

[0084] This embodiment provides a method for implementing batch image classification and rust removal effect verification in step S600, including steps S610-S620.

[0085] Step S610: Batch classification.

[0086] Perform batch analysis on all images within the specified folder, sequentially executing steps S100 to S500, and output the surface type classification result for each image. The classification results include three categories: laser cleaned Laser-removed rust surfaces; natural rust Naturally rusted surface; regular defect : Regular defect surface.

[0087] The classification results are saved as a CSV file, including image name, surface type, confidence score, and various feature metrics. A visual comparison chart is also generated, such as... Figure 6 As shown, the spectrum, red dot distribution map, and feature radar map of different surface types are compared.

[0088] Step S620: Verification of rust removal effect.

[0089] For paired images before and after rust removal, spectral analysis is performed separately to calculate the rate of change of spectral features before and after rust removal. Taking a certain area as an example, the feature vector V before rust removal... pre = [0.85, 0.72, 0.68, ...], the feature vector V after rust removal post =[0.12, 0.18, 0.25, ...]. Calculate the Euclidean distance: ; eigenvector magnitude before rust removal: ; Rate of change of spectral characteristics: .

[0090] A steel plate sample conforming to the ship rust removal process standard Sa2.5 was selected, and its spectral eigenvector was calculated as the reference vector V. ref The threshold for compliance is set at 12% of the baseline vector magnitude. When R... change If the value exceeds the threshold, the rust removal is deemed satisfactory; otherwise, a re-cleaning prompt is triggered.

[0091] This invention is primarily applied to the assessment of rust levels before and the verification of rust removal effects on the planes of ship sections during the manufacturing process. Specifically, it involves a technical solution for pixel-level fine segmentation of rusted areas based on an arbitrary segmentation model, and for extracting multi-dimensional spectral feature vectors by performing spectral analysis on each independent rusted area. Furthermore, this invention also involves constructing a three-dimensional spectral feature vector using mid-frequency band average energy, low-frequency band energy proportion, and high-frequency band energy attenuation rate; and a quantitative grading method for establishing a nonlinear mapping relationship between spectral features and rust levels using a pre-trained classification model. It also includes methods for calculating the rate of change of spectral features before and after rust removal and for determining the rust removal effect level. This invention can be widely applied to the automated assessment of surface rust levels and the quantitative acceptance of rust removal quality for large structures such as shipbuilding, marine engineering equipment, steel bridges, and storage tank facilities. It provides a quantitative basis for the differentiated setting of laser rust removal process parameters, improving the digitalization and intelligence level of surface treatment operations.

[0092] Example 2 The content of Embodiment 2 of this application includes all the technical features of Embodiment 1. For example... Figure 4 As shown in Embodiment 2 of this application, a method for analyzing the rust level of a ship's secondary rust removal surface is provided, comprising the following steps: S1. Acquire the original image of the planar area to be operated on the ship section, and perform grayscale conversion, median filtering for noise reduction and histogram equalization preprocessing on the original image to obtain the surface image; S2. The arbitrary segmentation (SAM) model, which has been fine-tuned and optimized using a ship corrosion image dataset, is used to perform pixel-level segmentation of the corrosion region in the surface image and extract several corrosion region masks. S3. Perform two-dimensional discrete Fourier transform on the image pixel data of each rusted area mask to convert the surface image from the spatial domain to the frequency domain, obtain the spectrum of each rusted area mask, divide the spectrum into low frequency band, mid frequency band and high frequency band, extract the average energy of mid frequency band, the energy ratio of low frequency band, the energy attenuation rate of high frequency band, radial power spectrum and frequency domain peak value, and construct multi-dimensional spectrum features; S4. Extract the red high-energy points in the spectrum whose energy values ​​are greater than the first proportion of the global maximum value, and calculate the spatial uniformity index, directionality index, density distribution uniformity index and brightness uniformity index of the red high-energy points to form spatial distribution characteristics; S5. Combine the multidimensional spectral features with the spatial distribution features to construct a spectral feature vector before rust removal, and input the spectral feature vector before rust removal into the rust level classification model to determine the rust level corresponding to each rust area mask. S6. Summarize the rust levels corresponding to the masks of each rusted area, overlay the rust levels on the original image to generate a rust level distribution map before rust removal, and collect the image after rust removal again after the laser rust removal operation is completed. Determine the spectral feature vector after rust removal based on the image after rust removal. Calculate the spectral feature change rate before and after rust removal based on the spectral feature vector before and after rust removal. Determine the rust removal effect level based on the comparison result of the spectral feature change rate and the preset threshold.

[0093] The preferred ratio is 85%. When determining the spectral feature vector after rust removal based on the image after rust removal, steps S1-S5 are repeated based on the image after rust removal to obtain the spectral feature vector after rust removal.

[0094] The complete process, including image preprocessing, pixel-level fine segmentation, independent region spectrum analysis, spatial distribution feature extraction, rust level classification, and rust removal effect judgment, can accurately eliminate interference from non-rusted backgrounds, characterize the rust state from multiple dimensions, and achieve automated and precise evaluation of the five rust levels before secondary rust removal on ships and quantitative judgment of the rust removal effect. At the same time, it can distinguish between laser-treated rust surfaces and naturally rusted surfaces, identify periodic surface defects, and provide a reliable basis for setting laser rust removal process parameters and quality acceptance.

[0095] Furthermore, the preprocessing of the original image to obtain the surface image by grayscale conversion, median filtering for noise reduction, and histogram equalization includes: The original image is converted from a color image to a grayscale image, and the grayscale image is then filtered using median filtering to remove salt-and-pepper noise introduced during the image acquisition process. Histogram equalization is applied to the denoised grayscale image to enhance image contrast. Apply Gaussian blur to an equalized grayscale image.

[0096] Among them, the combined preprocessing method of grayscale conversion, median filtering for noise reduction, histogram equalization and Gaussian blur can effectively remove salt-and-pepper noise in the image acquisition process, significantly enhance the contrast between the rusted area and the background, reduce the interference of high-frequency noise on subsequent Fourier transform and feature extraction, and improve the image data quality and the accuracy of subsequent analysis.

[0097] Furthermore, the arbitrary segmentation model, fine-tuned and optimized using a ship corrosion image dataset, is used to perform pixel-level segmentation of the corrosion region in the surface image, extracting several corrosion region masks, including: Deploy an arbitrary segmentation model on an airborne industrial control computer, finely tuned through transfer learning; A ship corrosion image dataset is formed by pixel-level annotation of planar images of ship sections covering rust at the closure joint, thick rust, light surface rust, no rust, and different lighting conditions. The annotation areas include the boundaries of the rusted areas and the boundaries of the closure joint. The arbitrary segmentation model was fine-tuned using the aforementioned ship rust image dataset; The surface image is input into the fine-tuned arbitrary segmentation model, which outputs a rust region mask after pixel-level segmentation of each rust region. The rust region mask is stored in the form of a binary image, where a region with a pixel value of 1 represents rust and a region with a pixel value of 0 represents the background. For a surface image containing multiple rust regions, the arbitrary segmentation model outputs multiple rust region masks, and the rust region masks do not overlap with each other.

[0098] Among them, the arbitrary segmentation model finely tuned by the ship corrosion image dataset can achieve pixel-level accurate segmentation of corrosion areas under different working conditions and lighting on the surface of ship sections, outputting independent binary masks of non-overlapping corrosion areas, completely separating the corrosion areas from the background, providing a clean analysis object for subsequent independent spectral analysis, and ensuring the accuracy of feature extraction.

[0099] Furthermore, a two-dimensional discrete Fourier transform is performed on the image pixel data of each rusted region mask to convert the surface image from the spatial domain to the frequency domain, obtaining the spectrum of each rusted region mask. The spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band. The average energy of the mid-frequency band, the energy proportion of the low-frequency band, the energy attenuation rate of the high-frequency band, the radial power spectrum, and the frequency domain peak value are extracted to construct multi-dimensional spectral features, including: For each rusted area mask, the corresponding image pixel data is extracted, and spectral analysis is performed on each. The image area covered by the rusted area mask is extracted and its size is normalized to obtain a grayscale image matrix. A two-dimensional discrete Fourier transform is performed on the grayscale image matrix to obtain a spectrum, which contains the amplitude and phase information of each frequency component. The zero-frequency component is shifted to the center of the spectrum to obtain the frequency-shifted spectrum. The frequency-shifted spectrum is then divided into low-frequency band, mid-frequency band, and high-frequency band. Calculate the sum of squared amplitudes of all pixels in the mid-frequency band, divide by the total number of pixels in the mid-frequency band, and obtain the average energy of the mid-frequency band. Calculate the proportion of the total spectral energy to the sum of squared amplitudes of all pixels in the low-frequency band to obtain the energy proportion of the low-frequency band. Extract the energy values ​​of different frequency bands within the high-frequency band, fit the attenuation curve of energy as a function of frequency, perform power-law fitting on the energy change of the high-frequency band as a function of frequency, calculate the attenuation exponent, and obtain the energy attenuation rate of the high-frequency band. Using the center of the spectrum as the origin, the average energy at each radial distance is calculated to generate a radial power spectrum curve; Peak detection is performed on the radial power spectrum to identify periodic frequency components that are greater than the peak height threshold as the frequencies corresponding to the peaks, and the spatial period corresponding to the frequencies corresponding to the peaks is calculated.

[0100] Among them, a two-dimensional discrete Fourier transform is performed on each independent rust region and frequency bands are divided to extract multi-dimensional spectral features. This can comprehensively quantify rust characteristics from dimensions such as texture roughness, area distribution, edge sharpness, and periodicity, accurately reflecting the frequency domain differences of different rust degrees, and providing rich and reliable feature basis for rust grade classification.

[0101] Furthermore, the step of extracting red high-energy points with energy values ​​greater than the global maximum in the spectrum image at a first proportion, and calculating the spatial uniformity index, directionality index, density distribution uniformity index, and brightness uniformity index of the red high-energy points to constitute spatial distribution characteristics includes: Extract the pixels in the spectrum whose energy values ​​are greater than the first proportion of the global maximum value as red high-energy points, and obtain the point coordinate matrix of the red high-energy points; Calculate the distance from each red high-energy point to its nearest neighbor, calculate the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors, and determine the spatial uniformity index of each red high-energy point based on the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors. The point coordinate matrix is ​​centered, the covariance matrix is ​​calculated, the covariance matrix is ​​decomposed into eigenvalues ​​to obtain eigenvalues ​​and their corresponding eigenvectors, the directional index is determined based on the eigenvalues, and the principal direction angle of the red high-energy point is determined based on the eigenvectors. The spectrum is divided into grids, the number of red high-energy points in each grid is calculated to obtain the density matrix, the mean and standard deviation of the density matrix are calculated, the density variation coefficient is determined based on the mean and standard deviation of the density matrix, and the density variation coefficient is used as an index of density distribution uniformity. Calculate the coefficient of variation of the intensity of each red high-energy point, and use the coefficient of variation of the intensity of the red high-energy point as an index of brightness uniformity.

[0102] By extracting the red high-energy points from the spectrum and calculating their spatial uniformity, directionality, density distribution uniformity, and brightness uniformity, the distribution characteristics of the micro-texture of the rusted surface can be accurately depicted, effectively distinguishing the subtle differences in the frequency domain between natural rust and laser-treated surfaces, and further improving the accuracy of rust level classification and surface type identification.

[0103] Furthermore, the step of inputting the pre-rust removal spectral feature vector into the rust level classification model to determine the rust level corresponding to each rust region mask includes: Multiple samples from rusted areas were collected, and the rust levels for each sample were set as follows: Level I: no rust or very slight rust; Level II: light surface rust; Level III: moderate rust; Level IV: relatively thick rust; and Level V: severe rust. A corrosion level classification model was trained using a support vector machine (SVM) with radial basis function (RBF) kernel selected. The penalty parameter and kernel parameter were optimized by five-fold cross-validation to obtain the trained corrosion level classification model. The spectral feature vector before rust removal is input into the trained rust level classification model, and the rust level corresponding to each rust area mask is output.

[0104] Among them, based on the five-level rust grade samples and the optimized support vector machine classification model, a nonlinear mapping relationship between spectral features and rust grade can be established, realizing automated and high-precision determination of rust grade. The grading standard is compatible with international standards, meeting the needs of refined process control and quality traceability for secondary rust removal in ships.

[0105] Furthermore, the step of calculating the rate of change of spectral features before and after rust removal based on the spectral feature vector before and after rust removal, and determining the rust removal effect level based on the comparison result of the rate of change of spectral features with a preset threshold, includes: Calculate the Euclidean distance between the feature vector before rust removal and the feature vector after rust removal, calculate the magnitude of the feature vector before rust removal, and divide the Euclidean distance by the magnitude of the feature vector before rust removal to obtain the spectral feature change rate.

[0106] Select steel plate samples that meet the ship target rust removal process standards, calculate their spectral feature vector as the reference vector, and use the second proportion of the reference vector magnitude as the preset compliance threshold. When the rate of change of the spectral characteristics is greater than the preset threshold, the rust removal is deemed qualified and the rust removal effect level is identified; otherwise, the rust removal is deemed unqualified and a re-cleaning prompt message is sent.

[0107] The second ratio is preferably 10% to 15%. By calculating the rate of change of spectral characteristics before and after rust removal and comparing it with the preset threshold, the effectiveness level of laser rust removal can be quantitatively determined, unqualified areas can be accurately identified and trigger a cleaning reminder, ensuring that the rust removal quality meets the shipbuilding process standards and realizing automated acceptance of rust removal quality.

[0108] like Figure 5 As shown, this application also provides a surface rust level analysis device 10 for secondary rust removal on ships, comprising: Image acquisition module 1 includes an industrial camera installed on a wall-climbing robot or a handheld terminal, used to acquire original images of the planar working area of ​​the ship section, and to perform grayscale conversion, median filtering for noise reduction and histogram equalization preprocessing on the original images to obtain surface images. The fine segmentation module 2 is deployed on the airborne industrial control computer. It has a built-in arbitrary segmentation model that has been finely tuned and optimized by the ship corrosion image dataset. It is used to perform pixel-level segmentation of the corrosion area in the surface image and extract several corrosion area masks. The spectrum analysis module 3 is used to perform two-dimensional discrete Fourier transform on the image pixel data of each rusted area mask, transform the surface image from the spatial domain to the frequency domain, obtain the spectrum map of each rusted area mask, divide the spectrum map into low frequency band, mid frequency band and high frequency band, and extract multi-dimensional spectrum features. The distribution feature analysis module 4 is used to extract red high-energy points with energy values ​​greater than the first proportion of the global maximum value in the spectrum, and calculate the spatial uniformity index, directionality index, density distribution uniformity index and brightness uniformity index of the red high-energy points to form spatial distribution features. The classification module 5 has a built-in rust level classification model trained on rust area samples. It is used to combine the multi-dimensional spectral features with the spatial distribution features to construct a spectral feature vector before rust removal. The spectral feature vector before rust removal is input into the rust level classification model to determine the rust level corresponding to each rust area mask. Evaluation output module 6 is used to summarize the rust levels corresponding to the masks of each rusted area, overlay the rust levels on the original image to generate a rust level distribution map before rust removal, and acquire the image after rust removal again after the laser rust removal operation is completed. The spectral feature vector after rust removal is determined based on the image after rust removal. The spectral feature change rate before and after rust removal is calculated based on the spectral feature vector before and after rust removal. The rust removal effect level is determined based on the comparison result of the spectral feature change rate and the preset threshold.

[0109] For a description of the features in the embodiment of the ship secondary rust removal surface rust level analysis device, please refer to the relevant description of the embodiment of the ship secondary rust removal surface rust level analysis method, which will not be repeated here.

[0110] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the method for analyzing the surface rust level of secondary rust removal for ships.

[0111] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores rust level analysis data for secondary rust removal surfaces on ships. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for analyzing the rust level of secondary rust removal surfaces on ships.

[0112] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the method for analyzing the surface rust level of secondary rust removal for ships.

[0113] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0114] Compared with the prior art, the present invention has the following beneficial effects: 1. Region-independent spectral analysis for purer feature extraction. Existing technologies perform spectral analysis on the entire image or a roughly divided ROI region. The spectral characteristics of areas without rust backgrounds differ significantly from those of rusted areas, making overall analysis susceptible to background interference and reducing the accuracy and stability of feature extraction. This invention uses a SAM model to perform pixel-level fine segmentation of the rusted region and performs spectral analysis on each independent rusted region separately, significantly reducing the impact of background interference on the evaluation results.

[0115] 2. Multi-dimensional feature vectors enable more precise hierarchical classification. Existing technologies often rely on a single method for judgment, which is insufficient to fully reflect the complexity of corrosion. This invention extracts multi-dimensional spectral features such as average energy in the mid-frequency band, energy proportion in the low-frequency band, energy attenuation rate in the high-frequency band, peak intensity of the radial power spectrum, and dominant spatial period to construct a multi-dimensional feature vector, comprehensively characterizing the corrosion state from multiple dimensions such as texture roughness, area distribution, edge sharpness, and periodicity.

[0116] 3. Introduce the distribution features of red high-energy points to improve classification accuracy. Existing technologies only focus on the overall energy distribution of the spectrum, without in-depth analysis of the local distribution characteristics of high-energy regions, making it difficult to distinguish the subtle differences in the frequency domain between laser-treated and naturally rusted surfaces. This invention proposes a method for analyzing the distribution characteristics of red high-energy points. It extracts pixels with energy values ​​in the high-energy range of the spectrum and constructs a distribution feature vector reflecting the surface's micro-texture characteristics by calculating multi-dimensional distribution features such as spatial uniformity, distribution directionality, density uniformity, and intensity consistency of these high-energy points.

[0117] 4. Automatic detection of periodic defects ensures rust removal quality. This invention automatically identifies significant periodic frequency components in the spectrum through radial power spectral analysis and frequency domain peak detection, calculates the corresponding spatial period, and automatically alerts if the spatial period is less than 50 pixels, indicating a possible regular surface defect. This function can also effectively detect scanning marks caused by improper equipment parameters or mechanical failures during laser rust removal, providing a quantitative basis for process parameter optimization and ensuring rust removal quality.

[0118] 5. Five-level fine grading to meet the needs of refined processes. This invention classifies rust levels into five grades (Grade I: no rust or very slight rust; Grade II: light surface rust; Grade III: moderate rust; Grade IV: relatively thick rust; Grade V: severe rust). The finer grading allows for the matching of differentiated laser rust removal process parameters to areas of different grades, achieving refined rust removal operations. Furthermore, the five-grade grading standard is compatible with the ISO 8501-1 international standard, facilitating quality acceptance and digital management.

[0119] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

Claims

1. A method for analyzing the rust grade of a ship's secondary rust removal surface, characterized in that, Includes the following steps: The original image of the planar working area of ​​the ship section is acquired, and the original image is preprocessed by grayscale conversion, median filtering for noise reduction and histogram equalization to obtain the surface image; An arbitrary segmentation model finely tuned and optimized from a ship corrosion image dataset is used to perform pixel-level segmentation of the corrosion region in the surface image, and several corrosion region masks are extracted. Two-dimensional discrete Fourier transform is performed on the image pixel data of each rusted region mask to transform the surface image from the spatial domain to the frequency domain, and the spectrum of each rusted region mask is obtained. The spectrum is divided into low frequency band, mid frequency band and high frequency band. The average energy of mid frequency band, the energy ratio of low frequency band, the energy attenuation rate of high frequency band, radial power spectrum and frequency domain peak value are extracted to construct multi-dimensional spectrum features. Extract the red high-energy points in the spectrum whose energy values ​​are greater than the global maximum value by the first proportion, and calculate the spatial uniformity index, directionality index, density distribution uniformity index, and brightness uniformity index of the red high-energy points to form spatial distribution characteristics; The multidimensional spectral features and the spatial distribution features are combined to construct a spectral feature vector before rust removal. The spectral feature vector before rust removal is then input into the rust level classification model to determine the rust level corresponding to each rust area mask. The rust levels corresponding to the masks of each rusted area are summarized, and the rust levels are superimposed on the original image to generate a rust level distribution map before rust removal. After the laser rust removal operation is completed, the image after rust removal is acquired again. The spectral feature vector after rust removal is determined based on the image after rust removal. The spectral feature change rate before and after rust removal is calculated based on the spectral feature vector before and after rust removal. The rust removal effect level is determined based on the comparison result of the spectral feature change rate with the preset threshold.

2. The method according to claim 1, characterized in that, The process of performing grayscale conversion, median filtering for noise reduction, and histogram equalization preprocessing on the original image to obtain the surface image includes: The original image is converted from a color image to a grayscale image, and the grayscale image is then filtered using median filtering to remove salt-and-pepper noise introduced during the image acquisition process. Histogram equalization is applied to the denoised grayscale image to enhance image contrast. Apply Gaussian blur to an equalized grayscale image.

3. The method according to claim 1, characterized in that, The arbitrary segmentation model, fine-tuned and optimized using a ship corrosion image dataset, performs pixel-level segmentation of the corrosion region in the surface image, extracting several corrosion region masks, including: Deploy an arbitrary segmentation model on an airborne industrial control computer, finely tuned through transfer learning; A ship corrosion image dataset is formed by pixel-level annotation of planar images of ship sections covering rust at the closure joint, thick rust, light surface rust, no rust, and different lighting conditions. The annotation areas include the boundaries of the rusted areas and the boundaries of the closure joint. The arbitrary segmentation model was fine-tuned using the aforementioned ship rust image dataset; The surface image is input into the fine-tuned arbitrary segmentation model, which outputs a rust region mask after pixel-level segmentation of each rust region. The rust region mask is stored in the form of a binary image, where a region with a pixel value of 1 represents rust and a region with a pixel value of 0 represents the background. For a surface image containing multiple rust regions, the arbitrary segmentation model outputs multiple rust region masks, and the rust region masks do not overlap with each other.

4. The method according to claim 1, characterized in that, The image pixel data of each rusted region mask are subjected to a two-dimensional discrete Fourier transform to convert the surface image from the spatial domain to the frequency domain, obtaining the spectrum of each rusted region mask. The spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band. The average energy of the mid-frequency band, the energy proportion of the low-frequency band, the energy attenuation rate of the high-frequency band, the radial power spectrum, and the frequency domain peak value are extracted to construct multi-dimensional spectral features, including: For each rusted area mask, the corresponding image pixel data is extracted, and spectral analysis is performed on each. The image area covered by the rusted area mask is extracted and its size is normalized to obtain a grayscale image matrix. A two-dimensional discrete Fourier transform is performed on the grayscale image matrix to obtain a spectrum, which contains the amplitude and phase information of each frequency component. The zero-frequency component is shifted to the center of the spectrum to obtain the frequency-shifted spectrum. The frequency-shifted spectrum is then divided into low-frequency band, mid-frequency band, and high-frequency band. Calculate the sum of squared amplitudes of all pixels in the mid-frequency band, divide by the total number of pixels in the mid-frequency band, and obtain the average energy of the mid-frequency band. Calculate the proportion of the total spectral energy to the sum of squared amplitudes of all pixels in the low-frequency band to obtain the energy proportion of the low-frequency band. Extract the energy values ​​of different frequency bands within the high-frequency band, fit the attenuation curve of energy as a function of frequency, perform power-law fitting on the energy change of the high-frequency band as a function of frequency, calculate the attenuation exponent, and obtain the energy attenuation rate of the high-frequency band. Using the center of the spectrum as the origin, the average energy at each radial distance is calculated to generate a radial power spectrum curve; Peak detection is performed on the radial power spectrum to identify periodic frequency components that are greater than the peak height threshold as the frequencies corresponding to the peaks, and the spatial period corresponding to the frequencies corresponding to the peaks is calculated.

5. The method according to claim 1, characterized in that, The process involves extracting red high-energy points from the spectrum whose energy values ​​are greater than the global maximum by a first proportion, and calculating the spatial uniformity index, directional index, density distribution uniformity index, and brightness uniformity index of these red high-energy points to constitute spatial distribution characteristics, including: Extract the pixels in the spectrum whose energy values ​​are greater than the first proportion of the global maximum value as red high-energy points, and obtain the point coordinate matrix of the red high-energy points; Calculate the distance from each red high-energy point to its nearest neighbor, calculate the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors, and determine the spatial uniformity index of each red high-energy point based on the mean and standard deviation of the distance from each red high-energy point to all its nearest neighbors. The point coordinate matrix is ​​centered, the covariance matrix is ​​calculated, the covariance matrix is ​​decomposed into eigenvalues ​​to obtain eigenvalues ​​and their corresponding eigenvectors, the directional index is determined based on the eigenvalues, and the principal direction angle of the red high-energy point is determined based on the eigenvectors. The spectrum is divided into grids, the number of red high-energy points in each grid is calculated to obtain the density matrix, the mean and standard deviation of the density matrix are calculated, the density variation coefficient is determined based on the mean and standard deviation of the density matrix, and the density variation coefficient is used as an index of density distribution uniformity. Calculate the coefficient of variation of the intensity of each red high-energy point, and use the coefficient of variation of the intensity of the red high-energy point as an index of brightness uniformity.

6. The method according to claim 1, characterized in that, The step of inputting the pre-rust removal spectral feature vector into the rust level classification model to determine the rust level corresponding to each rust region mask includes: Multiple samples from rusted areas were collected, and the rust levels for each sample were set as follows: Level I: no rust or very slight rust; Level II: light surface rust; Level III: moderate rust; Level IV: relatively thick rust; and Level V: severe rust. A corrosion level classification model was trained using a support vector machine based on the corrosion area samples. A radial basis function kernel was selected as the kernel function. The penalty parameter and kernel parameter were optimized through five-fold cross-validation to obtain the trained corrosion level classification model. The spectral feature vector before rust removal is input into the trained rust level classification model, and the rust level corresponding to each rust area mask is output.

7. The method according to claim 1, characterized in that, The step of calculating the rate of change of spectral features before and after rust removal based on the spectral feature vectors before and after rust removal, and determining the rust removal effect level based on the comparison result of the rate of change of spectral features with a preset threshold, includes: Calculate the Euclidean distance between the feature vector before rust removal and the feature vector after rust removal, calculate the magnitude of the feature vector before rust removal, and divide the Euclidean distance by the magnitude of the feature vector before rust removal to obtain the spectral feature change rate. Select steel plate samples that meet the ship target rust removal process standards, calculate their spectral feature vector as the reference vector, and use the second proportion of the reference vector magnitude as the preset compliance threshold. When the rate of change of the spectral characteristics is greater than the preset threshold, the rust removal is deemed qualified and the rust removal effect level is identified; otherwise, the rust removal is deemed unqualified and a re-cleaning prompt message is sent.

8. A device for analyzing the surface rust level during secondary rust removal on ships, characterized in that, include: The image acquisition module includes an industrial camera installed on a wall-climbing robot or a handheld terminal, used to acquire original images of the planar working area of ​​the ship section, and to perform grayscale conversion, median filtering for noise reduction and histogram equalization preprocessing on the original images to obtain surface images. The fine segmentation module, deployed on an airborne industrial control computer, has a built-in arbitrary segmentation model finely tuned and optimized from a ship corrosion image dataset. It is used to perform pixel-level segmentation of the corrosion area in the surface image and extract several corrosion area masks. The spectrum analysis module is used to perform two-dimensional discrete Fourier transform on the image pixel data of each rusted area mask, transform the surface image from the spatial domain to the frequency domain, obtain the spectrum map of each rusted area mask, divide the spectrum map into low frequency band, mid frequency band, and high frequency band, and extract multi-dimensional spectrum features. The distribution feature analysis module is used to extract red high-energy points with energy values ​​greater than the first proportion of the global maximum value in the spectrum, and calculate the spatial uniformity index, directionality index, density distribution uniformity index and brightness uniformity index of the red high-energy points to form spatial distribution features; The classification module has a built-in rust level classification model trained on rust area samples. It is used to combine the multi-dimensional spectral features with the spatial distribution features to construct a spectral feature vector before rust removal. The spectral feature vector before rust removal is then input into the rust level classification model to determine the rust level corresponding to each rust area mask. The evaluation output module is used to summarize the rust levels corresponding to the masks of each rusted area, overlay the rust levels on the original image to generate a rust level distribution map before rust removal, and acquire the image after rust removal again after the laser rust removal operation is completed. The spectral feature vector after rust removal is determined based on the image after rust removal. The spectral feature change rate before and after rust removal is calculated based on the spectral feature vector before and after rust removal. The rust removal effect level is determined based on the comparison result of the spectral feature change rate with the preset threshold.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for analyzing the surface rust level of secondary rust removal of ships as described in any one of claims 1 to X.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method for analyzing the surface rust level of secondary rust removal of ships as described in any one of claims 1 to X.