Corrosion diagnosis method, device and equipment based on machine vision

By adopting horizontal set function and energy functional model in machine vision technology and combining machine learning technology, the problem of poor accuracy in corrosion diagnosis is solved, and high accuracy and automated corrosion diagnosis is achieved.

CN119625370APending Publication Date: 2025-03-14CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411476062.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing machine vision technologies have poor accuracy in corrosion diagnosis, especially in dealing with non-rigid object profiles and topological changes, and the consistency and accuracy of traditional algorithms still need to be improved.

Method used

The energy functional model based on the horizontal set function is adopted to update the horizontal set function iteratively, accurately capture the outline of the corrosion area, and combine machine learning technology to classify and judge the corrosion type.

Benefits of technology

It realizes high accuracy judgment of corrosion images, improves the segmentation accuracy of corrosion areas and diagnostic accuracy, reduces the intervention of human operations, and realizes the automation of the diagnostic process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625370A_ABST
    Figure CN119625370A_ABST
Patent Text Reader

Abstract

The invention relates to the field of machine vision, and provides a corrosion diagnosis method, device and equipment based on machine vision, and the method comprises the steps: obtaining an input image, and carrying out the preprocessing of the image; selecting an initial contour in the preprocessed image as an initial range of a corrosion area; defining a level set function according to the initial contour; iteratively updating the level set function based on the selected energy functional model; after iterative optimization is completed, a final contour is extracted as a segmentation result, and a final corrosion area is obtained; and performing corrosion diagnosis according to the final corrosion area to obtain a corrosion report. According to the invention, the problem of poor accuracy of the traditional machine vision technology in corrosion diagnosis in the prior art is solved, and high-accuracy judgment of the corrosion image is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to a corrosion diagnosis method, device and equipment based on machine vision. Background Art

[0002] In today's rapidly developing industrial modernization, various equipment and components play a vital role in production operations. However, these equipment and components will inevitably suffer from multiple influences such as environmental factors and usage conditions during long-term use, thus causing corrosion problems. Corrosion not only seriously affects the appearance and normal operation of the equipment, but may also cause equipment performance degradation and even cause serious safety hazards. Therefore, accurate identification and timely diagnosis of corrosion phenomena have become an important issue to ensure industrial safety production and extend the service life of equipment.

[0003] Traditional corrosion identification methods mainly rely on manual inspection or simple image processing technology. Although these methods can achieve preliminary identification of corrosion to a certain extent, they have many limitations. First, manual inspection is not only inefficient, but also relies on the experience and subjective judgment of inspectors, making it difficult to ensure the accuracy and consistency of identification. Secondly, simple image processing technology often cannot effectively handle actual situations such as complex backgrounds, uneven lighting, and diverse corrosion morphologies, resulting in poor recognition results. In recent years, with the rapid development of machine vision technology, corrosion identification methods based on machine vision have gradually become a research hotspot. This type of method realizes the automatic identification and diagnosis of corrosion phenomena through image acquisition, processing and analysis, greatly improving the recognition efficiency and accuracy. However, existing machine vision technology still faces many challenges in dealing with corrosion identification, especially in dealing with non-rigid object contours, topological changes, etc. The consistency and accuracy of traditional algorithms still need to be improved. Summary of the invention

[0004] The present invention provides a corrosion diagnosis method, device and equipment based on machine vision, which solves the problem of poor accuracy of traditional machine vision technology in corrosion diagnosis in the prior art and achieves high-accuracy judgment of corrosion images.

[0005] The present invention provides a corrosion diagnosis method based on machine vision, comprising the following steps: Acquire an input image and preprocess the image; Select the initial contour in the preprocessed image as the initial range of the erosion area; defining a level set function according to the initial contour; Iteratively update the level set function based on the selected energy functional model; When the iterative optimization is completed, the final contour is extracted as the segmentation result to obtain the final corrosion area; Corrosion diagnosis is performed based on the final corrosion area to obtain a corrosion report.

[0006] According to a corrosion diagnosis method based on machine vision provided by the present invention, the iterative updating of the level set function based on the selected energy functional model specifically includes: determining the energy value corresponding to the current contour according to the selected energy functional model; determining the gradient information of the energy functional according to the direction in which the energy value changes fastest; updating the level set function according to the gradient information to evolve the contour; iteratively calculating the energy functional and evolving the contour until a preset number of iterations is reached or a convergence condition is met.

[0007] According to a corrosion diagnosis method based on machine vision provided by the present invention, corrosion diagnosis is performed according to the final corrosion area to obtain a corrosion report, which specifically includes: extracting key features from the final corrosion area; analyzing the key features to determine the type of corrosion; generating a diagnosis result according to the type of corrosion to determine the corrosion report.

[0008] According to a corrosion diagnosis method based on machine vision provided by the present invention, the key features are extracted from the final corrosion area, the key features are analyzed, and the type of corrosion is determined, which specifically includes: extracting key features from the final corrosion area through a trained classification model, analyzing the key features, and determining the type of corrosion; the trained classification model is obtained by training based on a training set, and the training set is corrosion images of different types.

[0009] According to a corrosion diagnosis method based on machine vision provided by the present invention, a classification model is trained according to different types of corrosion images, specifically including: obtaining a plurality of different types of corrosion images to form a training set, each type of corrosion image includes key features of that type of corrosion; preprocessing the corrosion images in the training set; using the preprocessed training set to train the classification model, extracting key features from the corrosion images, and analyzing the key features to determine the predicted value of the corrosion type; determining the difference between the predicted value and the true value through a defined loss function; iteratively adjusting the model parameters according to the difference to minimize the loss function; when a preset number of iterations is reached or a convergence condition is met, a trained classification model is obtained.

[0010] According to a corrosion diagnosis method based on machine vision provided by the present invention, the preprocessing of the image specifically includes: performing a first filtering process on the image to obtain a denoised image; performing a second filtering process on the denoised image to obtain a smoothed image; performing a contrast enhancement process on the smoothed image; and performing a normalization process on the contrast enhanced image to obtain an image that has completed the preprocessing.

[0011] The present invention also provides a corrosion diagnosis device based on machine vision, comprising the following modules: An image preprocessing module, used to obtain an input image and preprocess the image; The corrosion region identification module is used to select an initial contour in the preprocessed image as the initial range of the corrosion region; define a level set function according to the initial contour; iteratively update the level set function based on the selected energy functional model; after the iterative optimization is completed, extract the final contour as the segmentation result to obtain the final corrosion region; The corrosion diagnosis module is used to perform corrosion diagnosis according to the final corrosion area to obtain a corrosion report.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the corrosion diagnosis method based on machine vision as described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the corrosion diagnosis method based on machine vision as described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned machine vision-based corrosion diagnosis methods.

[0015] The present invention provides a corrosion diagnosis method, device and equipment based on machine vision, which include the following beneficial effects: through machine vision technology, the corrosion area in the image can be automatically and accurately identified and segmented, which not only improves the accuracy of diagnosis, but also greatly reduces the intervention of human operation, and realizes the automation of the diagnosis process. By iteratively updating the level set function, the contour of the corrosion area can be accurately captured, so as to accurately locate the corrosion site. The automated corrosion diagnosis method can work continuously and stably for a long time, reducing the cost of regular manual inspection and bringing long-term economic benefits to the enterprise. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a flow chart of the corrosion diagnosis method based on machine vision provided by the present invention.

[0018] Figure 2 It is a structural schematic diagram of the corrosion diagnosis device based on machine vision provided by the present invention.

[0019] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] The defects of existing machine vision technology in corrosion identification are mainly reflected in the following aspects: first, the limitations of feature extraction make it difficult to capture the subtle features of corrosion, affecting the precision and accuracy of identification. Second, some methods rely on manually set rules and thresholds, which increases subjectivity and non-reproducibility, as well as increases labor costs and time consumption. In view of these defects and challenges, how to improve the accuracy and stability of corrosion identification based on machine vision has become an important issue that needs to be solved in the current industry.

[0022] The present invention aims to solve the accuracy and stability problems faced by traditional machine vision technology in corrosion identification, especially the challenges of implicit representation, segmentation and merging of non-rigid object contours, and accurate tracking of topological changes.

[0023] In order to solve the above problems, the present invention proposes a corrosion identification and diagnosis method and device based on machine vision, which adopts the level set method of object segmentation. The entire area information is captured by embedding functions instead of relying solely on edge detection, so as to implicitly represent, segment and merge the contours of non-rigid objects. This method has higher flexibility and accuracy in dealing with topological changes, contour tracking, segmentation and merging. The characteristics of the level set method are used to ensure that the boundary points are reproduced as accurately as possible, so that they can be accurately matched and located with corresponding points of similar corrosion.

[0024] Combining advanced image processing technology and machine learning algorithms, the automation and accuracy of corrosion identification and diagnosis can be further improved.

[0025] Combine the following Figure 1-Figure 3 Embodiments of the present invention are described in detail.

[0026] Figure 1 is one of the flow charts of the corrosion diagnosis method based on machine vision provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: S110: Obtain an input image and pre-process the image.

[0027] According to a corrosion diagnosis method based on machine vision provided by the present invention, an image is preprocessed, specifically including: performing a first filtering process on the image to obtain a denoised image; performing a second filtering process on the denoised image to obtain a smoothed image; performing a contrast enhancement process on the smoothed image; and performing a normalization process on the contrast enhanced image to obtain an image that has completed the preprocessing.

[0028] Specifically, Gaussian filtering, median filtering, bilateral filtering, etc. may be used for image denoising.

[0029] Gaussian filtering: The Gaussian function is used as the impulse response function of the filter to convolve the image to achieve the effect of smoothing the image and removing noise. Gaussian filtering is very effective in suppressing noise that follows a normal distribution.

[0030] Median filtering: Sort the pixels in the neighborhood by grayscale, and then select the middle value of the group as the output pixel value. Median filtering is particularly effective for removing salt and pepper noise (impulse noise).

[0031] Bilateral filtering: A compromise process that considers both the spatial proximity of pixels and the similarity of pixel values ​​to achieve edge-preserving denoising.

[0032] Image smoothing can be done by using mean filtering, anisotropic filtering, etc.

[0033] Mean filtering: Take the average value of all pixels under the filter kernel area to replace the value of the central pixel to achieve the effect of smoothing the image. However, it may cause blurred image edges.

[0034] Anisotropic Filtering: A filtering method based on partial differential equations that can smooth noise while preserving the edge information of the image.

[0035] The contrast enhancement processing of the image can adopt histogram equalization, contrast-limited adaptive histogram equalization, etc.

[0036] Histogram equalization: Enhances the global contrast of an image by stretching the pixel intensity distribution, especially when the contrast of the useful data of the image is quite close.

[0037] Contrast Limited Adaptive Histogram Equalization (CLAHE): It is an improved algorithm of histogram equalization, which overcomes the noise amplification problem in histogram equalization by limiting the height of the local histogram.

[0038] Normalize the image: Scale the pixel values ​​of the image to a specific range (such as between 0 and 1) so that images obtained from different sources or under different conditions can be processed uniformly in subsequent processing.

[0039] The above preprocessing steps can be selected and combined according to specific application scenarios and image characteristics to achieve the best preprocessing effect.

[0040] S120 , selecting an initial contour in the preprocessed image as an initial range of the erosion area, and defining a level set function according to the initial contour.

[0041] Specifically, the level set method of object segmentation implicitly represents the contours of objects in the image by introducing an embedding function (usually called the level set function). This representation not only focuses on the edges of the object, but also on the information of the entire region, so that the shape of the object can be more comprehensively described. In the level set method, the contour of the object is regarded as a set of zero level sets of the embedding function. By iteratively updating the value of the embedding function, the evolution of the contour can be driven so that it gradually approaches the true boundary of the object in the image. Compared with traditional edge detection methods, the level set method has higher flexibility in dealing with topological changes (such as object merging, splitting, hole formation, etc.). For non-rigid objects (such as corroded surfaces), their contours often have complex shapes and dynamic changes. The level set method can more accurately capture and reproduce the contours of these non-rigid objects through implicit representation and flexible contour evolution mechanism, thereby improving the accuracy and stability of corrosion identification.

[0042] Specifically, an initial contour is selected in the image, usually a simple geometric shape such as a circle or rectangle. This initial contour will serve as the starting point for the evolution of the level set function. Based on the initial contour, a level set function is defined. This function takes positive values ​​inside the contour, negative values ​​outside the contour, and zero values ​​on the contour.

[0043] S130. Iteratively update the level set function based on the selected energy functional model.

[0044] According to a corrosion diagnosis method based on machine vision provided by the present invention, a level set function is iteratively updated based on a selected energy functional model, specifically including: determining an energy value corresponding to a current contour according to the selected energy functional model; determining the gradient information of the energy functional according to the direction in which the energy value changes fastest; updating the level set function according to the gradient information to evolve the contour; iteratively calculating the energy functional and evolving the contour until a preset number of iterations is reached or a convergence condition is met.

[0045] Specifically, the energy value corresponding to the current contour is calculated according to the selected energy functional model (such as edge-based model, region-based model, etc.). The energy functional is a function that maps the distribution of the system state to the energy value, and the energy value reflects the degree of match between the current contour and the boundary of the target object in the image.

[0046] According to the gradient information of the energy functional, the level set function is updated to make the contour evolve in the direction of energy reduction. In this process, the contour will gradually approach the boundary of the target object. The gradient is a vector that points to the direction in which the function value increases fastest. In the present invention, the gradient of the energy functional points to the direction in which the energy value increases fastest. Therefore, the contour can be updated in the opposite direction of the gradient to make it evolve in the direction of energy reduction.

[0047] The steps of calculating the energy functional and evolving the profile are repeated until a preset number of iterations is reached or convergence conditions are met. In each iteration, the energy functional is adjusted based on the current profile and image information to more accurately guide the evolution of the profile.

[0048] Assuming that the current contour is C and the energy functional is E(C), the contour can be updated according to the following iterative formula: C_new = C_old - α * ∇E(C_old)

[0049] Among them, α represents the step size, which is a positive number; ∇E(C_old) represents the gradient at the current contour C_old, and C_new represents the updated contour. Through continuous iterative updates, the contour can gradually approach the boundary of the target object, thereby achieving image segmentation.

[0050] S140, when the iterative optimization is completed, extract the final contour as the segmentation result to obtain the final corrosion area.

[0051] By iteratively optimizing the level set function and extracting the final contour, the corroded area in the image can be accurately segmented. This segmentation result has high boundary accuracy and detail retention, which is helpful for the subsequent analysis and processing of the corroded area. The above process makes the corrosion area identification process automated. Compared with manual segmentation, automated processing not only improves work efficiency, but also reduces the errors introduced by human factors, making the results more objective and reliable. After successfully identifying the corrosion area, it can be quantitatively evaluated, such as calculating the area, perimeter, shape factor and other parameters of the corrosion area. These quantitative data can provide strong support for the determination of the degree of corrosion, the calculation of the corrosion rate and the prediction of the corrosion trend.

[0052] After the corrosion area is successfully identified, the corrosion type and other conditions can be judged based on the identified corrosion area. In order to further improve the automation capability of corrosion judgment and reduce labor costs, the present invention uses machine learning technology to classify and judge the corrosion type based on the identified corrosion area.

[0053] Before applying a machine learning model, the model needs to be trained.

[0054] According to a corrosion diagnosis method based on machine vision provided by the present invention, a classification model is trained according to different types of corrosion images, specifically including: obtaining a plurality of different types of corrosion images to form a training set, each type of corrosion image includes key features of that type of corrosion; preprocessing the corrosion images in the training set; using the preprocessed training set to train the classification model, extracting key features from the corrosion images, and analyzing the key features to determine the predicted value of the corrosion type; determining the difference between the predicted value and the true value through a defined loss function; iteratively adjusting the model parameters according to the difference to minimize the loss function; when a preset number of iterations is reached or a convergence condition is met, a trained classification model is obtained.

[0055] Specifically, first, collect an image dataset for training and testing classification models. This dataset contains multiple categories of eroded images, and the number of eroded images in each category should be relatively balanced. For supervised learning, each image in the dataset needs to be labeled, that is, a corresponding category label is assigned to it. These labels are used to guide model learning during the training process. For image classification, the convolutional neural network CNN algorithm can be selected. After determining to use CNN, design the specific structure of the network, including the number and configuration of convolutional layers, pooling layers, and fully connected layers, as well as the selection of activation functions. Define the loss function (such as the cross entropy loss function) and optimizer (such as the Adam optimizer) used in the training process. The loss function measures the difference between the model prediction and the true label, while the optimizer is responsible for updating the parameters of the model based on the loss.

[0056] After completing the above preparations, the eroded images in the original image dataset are preprocessed as necessary, such as resizing and normalization, to ensure that they meet the input requirements of the model. In order to improve the generalization ability of the model, data augmentation techniques can be used to expand the dataset, such as rotation, flipping, scaling and other transformations. The preprocessed image dataset is divided into a training set, a validation set and a test set. The training set is used to train the model, the validation set is used to adjust hyperparameters and monitor the training process, and the test set is used to evaluate the final performance of the model.

[0057] The model is iteratively trained using the training set. In each iteration, the model forward propagates to calculate the prediction results, then calculates the loss and performs backpropagation to update the model parameters. This process is repeated for multiple cycles until a satisfactory training effect is achieved. During the training process, hyperparameters such as learning rate and batch size need to be adjusted according to the performance of the validation set to optimize the training effect of the model.

[0058] The test set is used to evaluate the performance of the model. Common evaluation indicators include accuracy, precision, recall, and F1 score. Based on the evaluation results, the classification model can be further optimized, such as adjusting the network structure, adding regularization terms, and using more complex optimization algorithms.

[0059] After the training is completed, the parameters and structure of the classification model are saved, and the trained model is deployed to the actual application.

[0060] S150. Perform corrosion diagnosis based on the final corrosion area to obtain a corrosion report.

[0061] According to a corrosion diagnosis method based on machine vision provided by the present invention, corrosion diagnosis is performed according to the final corrosion area to obtain a corrosion report, which specifically includes: extracting key features from the final corrosion area; analyzing the key features to determine the type of corrosion; generating a diagnosis result according to the type of corrosion to determine the corrosion report.

[0062] According to a corrosion diagnosis method based on machine vision provided by the present invention, key features are extracted from the final corrosion area, the key features are analyzed, and the type of corrosion is determined, which specifically includes: extracting key features from the final corrosion area through a trained classification model, analyzing the key features, and determining the type of corrosion; the trained classification model is obtained based on a training set, and the training set is corrosion images of different types.

[0063] Specifically, during the application process, the trained classification model will first receive the final corrosion area as input data. Then, the convolution layer inside the model will perform feature extraction on these input data, and gradually abstract high-level features related to the corrosion type through layer-by-layer convolution and pooling operations. These high-level features can capture key information such as the shape, texture, and color distribution of the corrosion area, providing strong support for subsequent corrosion type determination.

[0064] After feature extraction is completed, the fully connected layer of the classification model will integrate and transform the extracted features to form a feature vector. This feature vector contains all the key information of the input corrosion area and is an important basis for classification decisions.

[0065] The model then inputs this feature vector into the classification layer. The classification layer generally uses a softmax function to map the feature vector to the probability distribution of each corrosion type. In this way, for each input corrosion area, the model can output a probability vector, and each element in the vector represents the probability that the area belongs to a specific corrosion type.

[0066] Finally, according to the set threshold or the maximum probability principle, the final corrosion type is determined from the probability vector. This corrosion type is the model's diagnosis result for the input corrosion area and will be used to generate a corrosion report. In this way, the trained classification model can achieve fast and accurate automatic diagnosis of the corrosion area.

[0067] The corrosion diagnosis device based on machine vision provided by the present invention is described below. The corrosion diagnosis device based on machine vision described below and the corrosion diagnosis method based on machine vision described above can refer to each other.

[0068] like Figure 2 The present invention provides a corrosion diagnosis device based on machine vision, comprising: The image preprocessing module 210 is used to obtain an input image and preprocess the image; The corrosion region identification module 220 is used to select an initial contour in the preprocessed image as the initial range of the corrosion region; define a level set function according to the initial contour; iteratively update the level set function based on the selected energy functional model; after the iterative optimization is completed, extract the final contour as the segmentation result to obtain the final corrosion region; The corrosion diagnosis module 230 is used to perform corrosion diagnosis according to the final corrosion area and obtain a corrosion report.

[0069] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a corrosion diagnosis method based on machine vision, the method comprising: acquiring an input image and preprocessing the image; selecting an initial contour in the preprocessed image as the initial range of the corrosion area; defining a level set function according to the initial contour; iteratively updating the level set function based on the selected energy functional model; after the iterative optimization is completed, extracting the final contour as the segmentation result to obtain the final corrosion area; performing corrosion diagnosis according to the final corrosion area to obtain a corrosion report.

[0070] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0071] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the machine vision-based corrosion diagnosis method provided by the above methods, which includes: acquiring an input image and preprocessing the image; selecting an initial contour in the preprocessed image as the initial range of the corrosion area; defining a level set function based on the initial contour; iteratively updating the level set function based on a selected energy functional model; when the iterative optimization is completed, extracting the final contour as the segmentation result to obtain the final corrosion area; performing corrosion diagnosis based on the final corrosion area to obtain a corrosion report.

[0072] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the machine vision-based corrosion diagnosis method provided by the above-mentioned methods, the method comprising: acquiring an input image and preprocessing the image; selecting an initial contour in the preprocessed image as the initial range of the corrosion area; defining a level set function based on the initial contour; iteratively updating the level set function based on a selected energy functional model; when the iterative optimization is completed, extracting the final contour as the segmentation result to obtain the final corrosion area; performing corrosion diagnosis based on the final corrosion area to obtain a corrosion report.

[0073] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0074] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A corrosion diagnosis method based on machine vision, characterized in that: include: Acquire an input image and preprocess the image; Select the initial contour in the preprocessed image as the initial range of the erosion area; defining a level set function according to the initial contour; Iteratively update the level set function based on the selected energy functional model; When the iterative optimization is completed, the final contour is extracted as the segmentation result to obtain the final corrosion area; Corrosion diagnosis is performed based on the final corrosion area to obtain a corrosion report.

2. The corrosion diagnosis method based on machine vision according to claim 1, characterized in that: The iterative updating of the level set function based on the selected energy functional model specifically includes: Determine the energy value corresponding to the current profile according to the selected energy functional model; Determining the gradient information of the energy functional according to the direction in which the energy value changes fastest; updating the level set function according to the gradient information to evolve the contour; The energy functional is calculated iteratively and the profile is evolved until a preset number of iterations is reached or convergence criteria are met.

3. The corrosion diagnosis method based on machine vision according to claim 1, characterized in that: The corrosion diagnosis is performed according to the final corrosion area to obtain a corrosion report, which specifically includes: extracting key features from the resulting corroded region; Analyze the key features to determine the type of corrosion; Generate diagnostic results based on the type of corrosion and determine the corrosion report.

4. The corrosion diagnosis method based on machine vision according to claim 3 is characterized in that: The step of extracting key features from the final corrosion area, analyzing the key features, and determining the type of corrosion specifically includes: Extracting key features from the final corrosion area through the trained classification model, analyzing the key features, and determining the type of corrosion; The trained classification model is obtained by training according to a training set, and the training set is corrosion images of different types.

5. The corrosion diagnosis method based on machine vision according to claim 4 is characterized in that: The classification model is trained based on different types of corrosion images, including: A plurality of different types of corrosion images are obtained to form a training set, and each type of corrosion image includes key features of the type of corrosion; Preprocess the eroded images in the training set; The classification model is trained using the preprocessed training set, key features are extracted from the corrosion image, and the key features are analyzed to determine the prediction value of the corrosion type; Determine the difference between the predicted value and the true value by using a defined loss function; Iteratively adjusting model parameters according to the difference to minimize the loss function; When the preset number of iterations is reached or the convergence condition is met, the trained classification model is obtained.

6. The corrosion diagnosis method based on machine vision according to claim 1, characterized in that: The preprocessing of the image specifically includes: Performing a first filtering process on the image to obtain a denoised image; Performing a second filtering process on the denoised image to obtain a smoothed image; Perform contrast enhancement on the smoothed image; The contrast-enhanced image is normalized to obtain an image after preprocessing.

7. A corrosion diagnosis device based on machine vision, characterized in that: include: An image preprocessing module, used to obtain an input image and preprocess the image; The corrosion region identification module is used to select an initial contour in the preprocessed image as the initial range of the corrosion region; define a level set function according to the initial contour; iteratively update the level set function based on the selected energy functional model; after the iterative optimization is completed, extract the final contour as the segmentation result to obtain the final corrosion region; The corrosion diagnosis module is used to perform corrosion diagnosis according to the final corrosion area to obtain a corrosion report.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the machine vision-based corrosion diagnosis method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the machine vision-based corrosion diagnosis method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the machine vision-based corrosion diagnosis method according to any one of claims 1 to 6 is implemented.