A method and apparatus for separating multiple defects in pipeline robot inspection images

By combining the improved K-SVD algorithm with the sparse decomposition objective function, the problem of image separation of multiple superimposed defects in urban pipeline inspection was solved, achieving high-precision defect separation and recognition, and providing high-quality independent defect feature images for urban pipeline inspection.

CN122597820BActive Publication Date: 2026-11-10THREE GORGES ENVIRONMENTAL TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611089835.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-11-10
Estimated Expiration
2046-07-22

AI Technical Summary

Technical Problem

In urban pipeline inspection, the superposition of multiple defects leads to mutual interference and overlapping of different defect features in the image, making it difficult to achieve high-precision extraction and separation of single defect features.

Method used

An improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs. By combining the sparse decomposition objective function and sparse coefficient constraint terms, iterative optimization is performed by obtaining standardized grayscale images to obtain adaptive dictionary pairs. This accurately solves the sparse coefficients of various defects and background components, achieving accurate separation of multiple defects.

Benefits of technology

This method effectively separates multiple types of defects from the background in pipeline inspection images, avoiding the problem of low defect recognition accuracy caused by multiple defects mixed together in traditional methods. It provides high-precision independent defect feature images, laying the foundation for subsequent recognition and classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597820B_ABST
    Figure CN122597820B_ABST
Patent Text Reader

Abstract

This invention relates to the field of pipeline inspection and image processing technology, and discloses a method and apparatus for separating multiple defects in pipeline robot inspection images. The method includes acquiring a standardized grayscale image of the pipeline interior, optimizing the initial dictionary pairs for various defects using an improved K-SVD algorithm to obtain adaptive dictionary pairs, and solving the sparse decomposition objective function by combining the grayscale image and the adaptive dictionary pairs to obtain the sparse coefficients of various defects and background components. The objective function is constructed from an image reconstruction error term and a sparse coefficient constraint term. The image reconstruction error term is used to constrain the error between the reconstructed image composed of the defect image and background components and the standardized grayscale image, and the sparse coefficient constraint term is used to constrain the sparse coefficients of various defects. Image reconstruction is completed based on the adaptive dictionary pairs, defect sparse coefficients, and background components to obtain the background image and various defect images. This invention achieves effective separation of different types of defects from the background in pipeline robot inspection images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline inspection and image processing technology, specifically to a method and apparatus for separating multiple defects in pipeline robot inspection images. Background Technology

[0002] In urban infrastructure sectors such as water supply and drainage, and gas supply, pipelines serve as the core transport carriers, and their operational safety is directly related to urban public safety and the protection of residents' lives. During long-term service, pipelines are susceptible to various defects such as cracks, corrosion, joint leaks, and sludge accumulation due to factors such as medium corrosion, external impact, and aging. Moreover, in actual inspections, multiple types of defects often coexist, such as cracks and corrosion intertwined, or joint leaks and sludge accumulation overlapping, which greatly complicates defect detection.

[0003] As a core piece of equipment for non-destructive testing of pipelines, urban pipeline robots can carry high-definition cameras deep into pipelines to collect image data, providing a visual basis for defect detection. However, the superposition of multiple defects can lead to mutual interference and overlapping of grayscale features in the image, significantly increasing the difficulty of feature extraction and separation of single defects. Currently, the application of image processing technology in urban pipeline defect detection has become a research hotspot, with the core requirement being the accurate separation of multiple defects to provide independent feature images for subsequent identification and classification.

[0004] Morphological component analysis (MCA), an image decomposition algorithm based on sparse representation, uses a dictionary of different morphological features to sparsely decompose an image, achieving separation of target components from background components. It has already seen initial applications in image denoising and target extraction, but it has not yet been specifically applied or optimized for the separation of multiple defects in urban pipelines. Mainstream defect separation techniques are broadly classified into traditional image segmentation algorithms and deep learning semantic segmentation algorithms. Both types of techniques have limitations and struggle to meet the high-precision separation requirements in scenarios with multiple overlapping defects and blurred boundaries between defects. Summary of the Invention

[0005] This invention provides a method and apparatus for separating multiple defects in pipeline inspection images by a pipeline robot, which solves the problem of various defects being mixed and difficult to separate effectively in pipeline inspection images.

[0006] In a first aspect, the present invention provides a method for separating multiple defects in pipeline robot inspection images, the method comprising: A standardized grayscale image of the pipeline interior is obtained. Based on the standardized grayscale image, an improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs for various defects, resulting in adaptive dictionary pairs for each type of defect. The standardized grayscale image and the adaptive dictionary pairs are combined to solve the pre-established sparse decomposition objective function, yielding the sparse coefficients of various defects and background components. The sparse decomposition objective function is constructed based on an image reconstruction error term and a sparse coefficient constraint term. The image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of the defect images and background components and the standardized grayscale image. The sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients of various defects. Image reconstruction is performed based on the adaptive dictionary pairs, the sparse coefficients of various defects, and the background components, resulting in the background image and the defect images corresponding to each type of defect.

[0007] This invention provides a method for separating multiple defects in pipeline robot inspection images. It acquires standardized grayscale images of the pipeline interior, unifies image data specifications, removes redundant color information and acquisition noise, providing standardized input data for subsequent defect dictionary optimization and sparse decomposition. An improved K-SVD algorithm iteratively optimizes pre-constructed initial defect dictionary pairs, ensuring the optimized adaptive dictionary pairs closely match the actual defect morphology of the pipeline, compensating for the insufficient adaptability of the initial dictionary pairs and improving the dictionary's accurate representation of various pipeline defect features. Furthermore, a sparse decomposition objective function, constructed from image reconstruction error and sparse coefficient constraint terms, is solved using the standardized grayscale image and the adaptive dictionary pairs. The difference term can effectively constrain the reconstruction deviation in the image decomposition process, ensuring that the defect details of the original image are complete and not lost. The sparse coefficient constraint term can effectively constrain the sparse coefficients of various defects, distinguish between real defect features and irrelevant interference features, and thus accurately solve for the sparse coefficients of various defects and the pure image background components. Finally, based on the high-precision adaptive dictionary pair, the sparse coefficients of various defects and the background components, the image reconstruction is completed. The original pipeline inspection image can be accurately split into independent background images and defect images corresponding to various defects. This achieves effective separation between multiple types of defects and the background, and between different defects in the pipeline inspection image, avoiding the problem of low defect recognition accuracy caused by multiple defects mixed together and mutual interference between defects and the background in traditional inspection images.

[0008] In one alternative implementation, based on a standardized grayscale image, an improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs to obtain adaptive dictionary pairs, including: The standardized grayscale image is divided into overlapping pixel blocks with a preset overlap rate, and each pixel block is converted into a corresponding one-dimensional vector. Based on the initial dictionary pair and the one-dimensional vector of each pixel block, the orthogonal matching pursuit algorithm is used to solve for the various defect sparsity coefficients of each pixel block. The one-dimensional vector corresponding to each pixel block and the various defect sparsity coefficients of each pixel block are input into the dictionary update objective function to update the initial dictionary pair, thus obtaining the updated dictionary pair for the current round. The dictionary update objective function is determined based on the basic error term and the feature matching degree constraint term. If the current iteration number has not reached the preset iteration number, the updated dictionary pair of the current round is used as the initial dictionary pair. The steps of solving for the various defect sparsity coefficients of each pixel block using the orthogonal matching pursuit algorithm based on the initial dictionary pair and the one-dimensional vector of each pixel block are iterated until the preset iteration number is reached, thus obtaining the adaptive dictionary pair.

[0009] The present invention provides a method for separating multiple defects in pipeline robot inspection images. A standardized grayscale image is divided into overlapping pixel blocks according to a preset overlap rate and converted into a one-dimensional vector. Local pixel regions are used as the basic computational units for processing. Then, combining an initial dictionary pair with the one-dimensional vector of the pixel block, an orthogonal matching pursuit algorithm is used to solve for the sparse coefficients of various defects corresponding to each pixel block. This accurately obtains the linear combination weights between local image features and the current dictionary, providing an effective computational basis for dictionary updates. Furthermore, the one-dimensional vector of the pixel block and the corresponding sparse coefficients of various defects are input into a dictionary update objective function composed of a basic error term and a feature matching degree constraint term. This updates the parameters of the initial dictionary pair. The basic error term ensures that the updated dictionary has stable signal reconstruction capabilities, while the feature matching degree constraint term limits the dictionary optimization direction, allowing dictionary atoms to gradually conform to pipeline defect features. Finally, the sparse coefficient solution and dictionary update operations are cyclically executed according to a preset number of iterations. The adaptive dictionary pair obtained after the iteration terminates can fully match the actual defect morphology in the pipeline, effectively compensating for the insufficient specificity of the initial dictionary pair and providing a more adaptable dictionary pair for subsequent image sparse decomposition and multiple defect separation.

[0010] In one alternative implementation, the sparsity coefficient constraint term is determined based on the sum of one or more of the sparsity constraint term, the defect type constraint term, and the spatial continuity constraint term, wherein: The sparsity constraint term is used to constrain the sparsity coefficients of various defects to meet the sparse distribution law; the defect type constraint term is used to constrain the sparsity coefficients of various defects according to the defect type and in combination with the pixel blocks of the real defect region; the spatial continuity constraint term is used to constrain the continuous distribution characteristics of the sparsity coefficients of various defects in adjacent pixel blocks.

[0011] The pipeline robot inspection image multi-defect separation method provided by this invention sets the sparse coefficient constraint term as the sum of one or more of the following: sparsity constraint term, defect type constraint term, and spatial continuity constraint term. This allows for flexible combination of constraint conditions according to the actual image inspection scenario, adapting to pipeline image inspection needs of varying complexity. The sparsity constraint term controls the sparse coefficients of various defects, ensuring they follow a sparse distribution pattern. It filters out scattered irrelevant interference features in the image based on the inherent sparse properties of the defect features themselves, reducing the impact of invalid signals on coefficient solving and ensuring that defect features are preferentially represented. The defect type constraint term combines the defect type with the pixel blocks of the actual defect region to complete the constraint, distinguishing the sparse coefficients based on the inherent morphological differences of different defects, avoiding the aliasing of coefficients corresponding to different defect types. The spatial continuity constraint term constrains the distribution state of various defect sparse coefficients in adjacent pixel blocks, conforming to the objective characteristic of continuous distribution of pipeline defects within the image space, suppressing calculation errors caused by abrupt changes in local coefficients. Adding a sparse coefficient constraint term to the traditional sparse decomposition objective function can significantly improve the accuracy and rationality of the sparse coefficients.

[0012] In one alternative implementation, the defect type constraint is determined based on the sparsity coefficients of various defects and the matching deviation of pixel blocks in the real defect region, wherein the matching deviation includes structural matching deviation and texture matching deviation.

[0013] The present invention provides a method for separating multiple defects in pipeline robot inspection images. The defect type constraint term is constructed based on the matching deviation between the sparse coefficients of various defects and the pixel blocks of the real defect region. The matching deviation is divided into structural matching deviation and texture matching deviation, which can perform feature matching calculations for pipeline structural defects and texture defects respectively. This allows the constraint process to accurately distinguish between two types of defect features with different attributes, further enhances the defect classification effect, and effectively avoids the problem of mutual interference and difficulty in distinguishing different defect features.

[0014] In one alternative implementation, the spatial continuity constraint term is determined by calculating the difference between the corresponding defect sparsity coefficients of adjacent pixel blocks in the entire normalized grayscale image according to each defect type, and then summing all the differences.

[0015] The pipeline robot inspection image multi-defect separation method provided by the present invention obtains the spatial continuity constraint term by calculating and accumulating the difference of the corresponding sparse coefficients of adjacent pixel blocks in the whole domain according to the defect type. The difference calculation and summarization are performed independently for each type of defect, which can accurately match the spatial distribution characteristics of different defects, standardize the spatial continuity of the sparse coefficients of various defects, and effectively reduce the calculation deviation caused by abnormal fluctuations in the coefficients of adjacent pixel blocks.

[0016] In one optional implementation, the defects include structural defects and texture defects. A pre-established sparse decomposition objective function is solved using a standardized grayscale image and an adaptive dictionary to obtain the sparse coefficients of various defects and background components, including: The initial structural defect sparsity coefficients and initial texture defect sparsity coefficients are set to 0. Mean filtering is applied to the standardized grayscale image to obtain the initial background component. The initial residual is obtained based on the L2 norm of the difference between the standardized grayscale image and the initial background component. The sparse decomposition objective function is solved using the adaptive dictionary pair, the initial texture defect sparsity coefficients, and the initial background component to obtain the first structural defect sparsity coefficient for the current round. The sparse decomposition objective function is then solved again using the adaptive dictionary pair, the first structural defect sparsity coefficient, and the initial background component to obtain the first texture defect sparsity coefficient. The initial background component is updated using the first structural defect sparsity coefficient and the first texture defect sparsity coefficient to obtain the first background component. The new residual for this round is calculated based on the first structural defect sparsity coefficient, the first texture defect sparsity coefficient, and the first background component. The iteration termination condition is then determined based on the new residual. If the iteration termination condition is not met, the calculation result of this round is used as the input data for the next round for iterative updates until the iteration termination condition is met. Finally, the various defect sparsity coefficients and background components obtained in the final round are output.

[0017] The multi-defect separation method for pipeline robot inspection images provided by this invention adopts a step-by-step iterative solution approach. First, initial values ​​are assigned to the sparse coefficients of structural defects, texture defects, and background components. Initial residuals are calculated based on a standardized grayscale image and the initial background components, establishing a unified initial benchmark for subsequent iterative calculations. Then, the sparse coefficients of structural defects and texture defects are solved alternately, completing the calculation of different types of defect coefficients step-by-step. This avoids mutual interference that occurs when solving multiple types of defect sparse coefficients simultaneously. The background components are then updated synchronously with the obtained sparse coefficients of the two types of defects, and the residuals corresponding to each iteration are calculated in real time. The new residuals or the total number of iterations are used as the criteria for terminating the iteration, continuously monitoring image reconstruction deviations and gradually optimizing various parameters. Through repeated iterative updates until the termination condition is met, defect images and background images without cross-interference are output, significantly improving the solution accuracy of various defect sparse coefficients and background components, and ensuring the accuracy of image signal decomposition results.

[0018] Secondly, the present invention provides a multi-defect separation device for pipeline robot inspection images, the device comprising: The image acquisition module is used to acquire a standardized grayscale image of the inside of the pipe; The initial dictionary pair update module is used to optimize the pre-constructed initial dictionary pairs of various defects based on the standardized grayscale image using the improved K-SVD algorithm, so as to obtain adaptive dictionary pairs of various defects; The module for updating sparse coefficients for various defects combines a standardized grayscale image and an adaptive dictionary to solve a pre-established sparse decomposition objective function, obtaining sparse coefficients for various defects and background components. The sparse decomposition objective function is constructed based on an image reconstruction error term and a sparse coefficient constraint term. The image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of the defect image and background components and the standardized grayscale image. The sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients for various defects. The defect image reconstruction module is used to reconstruct the image based on the adaptive dictionary pairs, the sparse coefficients of various defects, and the background components, so as to obtain the background image and the defect images corresponding to each type of defect.

[0019] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the pipeline robot inspection image multi-defect separation method described in the first aspect or any corresponding embodiment thereof.

[0020] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the pipeline robot inspection image multi-defect separation method of the first aspect or any corresponding embodiment described above.

[0021] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the pipeline robot inspection image multi-defect separation method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the first process of a pipeline robot inspection image multi-defect separation method according to an embodiment of the present invention; Figure 3 This is a structural block diagram of a pipeline robot image multi-defect separation device according to an embodiment of the present invention; Figure 4This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0026] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0027] As an optional application scenario of this invention, the specific application environment architecture or specific hardware architecture on which the multi-defect separation of pipeline robot inspection images depends is described herein. For example... Figure 1 As shown, the architecture system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0028] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0029] According to an embodiment of the present invention, a method for separating multiple defects in pipeline robot inspection images is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] This embodiment provides a method for separating multiple defects in pipeline robot inspection images, which can be used on the aforementioned mobile terminals, such as mobile phones and tablets. Figure 2 This is a flowchart of a multi-defect separation method for pipeline robot inspection images according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain a standardized grayscale image of the inside of the pipe.

[0031] In one optional embodiment, a high-definition industrial camera is used to collect superimposed images of multiple defects deep inside the pipeline, and has the ability to resist oil stains and adapt to low light; the image preprocessing unit performs noise reduction, size normalization and grayscale processing on the collected raw images to obtain a standardized grayscale image.

[0032] Step S202: Based on the standardized grayscale image, the improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs of various defects to obtain adaptive dictionary pairs of various defects.

[0033] In one optional embodiment, based on prior knowledge of the morphology of urban pipeline defects, initial dictionary pairs for various types of defects are constructed, including dictionary pairs consisting of a structural defect dictionary and a texture defect dictionary. The various types of defects include structural defects such as linear cracks, and texture defects such as spot corrosion.

[0034] Specifically, focusing on the linear characteristics of urban pipeline cracks, which often extend horizontally, vertically, and at 45° and 135° angles, we designed linear structural atoms of different directions and widths, such as 1-3 pixels, covering the range of common micro-cracks to wide cracks in urban pipelines, totaling 800 atoms. The remaining atoms were randomly extracted from linear region pixel blocks in the preprocessed image to supplement them, forming an initial structural defect dictionary to ensure coverage of various postures of pipeline cracks. Combining the irregular texture characteristics of urban pipeline corrosion, which often presents as spots and networks, we designed 600 irregular texture atoms. The remaining atoms were randomly extracted from suspected corrosion region pixel blocks in the preprocessed image to supplement them, forming an initial texture defect dictionary. All atoms in the initial structural defect dictionary and the initial texture defect dictionary were normalized to make the L2 norm of each atom 1, eliminating the interference caused by differences in atom amplitudes, and obtaining the final initial dictionary pair.

[0035] Pipeline defects are mainly classified into structural defects and texture defects, with significant differences in morphology between the two types. The initial dictionary pairs are only preliminarily constructed based on prior knowledge of defect morphology, lacking specificity. An improved K-SVD algorithm is used to iteratively optimize the initial dictionary pairs, forcing dictionary atoms to fit the actual pipeline defect characteristics, resulting in adaptive dictionary pairs. These adaptive dictionary pairs are derived from an adaptive structural defect dictionary. and adaptive texture defect dictionary composition.

[0036] Step S203: Combine the standardized grayscale image and the adaptive dictionary to solve the pre-established sparse decomposition objective function to obtain the sparse coefficients of various defects and background components.

[0037] In an optional embodiment, the sparse decomposition objective function is constructed based on an image reconstruction error term and a sparse coefficient constraint term; the image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of defect images and background components and the standardized grayscale image; the sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients of various defects.

[0038] Specifically, the core logic of sparse decomposition is that defect features can be linearly represented by a small number of dictionary atoms. In the objective function of sparse decomposition, the image reconstruction error term ensures that defect details such as cracks and corrosion are not lost after decomposition, avoiding over-processing distortion; the sparse coefficient constraint term forces the defect features to be sparsified, filtering out non-defect interference. By solving this function, the image signal is decomposed into sparse coefficients representing cracks and corrosion and uniform background components, achieving preliminary separation of defects from the background.

[0039] Step S204: Reconstruct the image based on the adaptive dictionary pairs, the sparsity coefficients of various defects, and the background components to obtain the background image and the defect images corresponding to each type of defect.

[0040] In one optional embodiment, the adaptive dictionary pair is a defect morphology template, and the defect sparsity coefficient is the weight of the template. The two are multiplied together to accurately reconstruct independent crack images and corrosion images, which correspond to structural defects and texture defects, respectively. The background component is directly used as the background image to completely restore the defect-free area of ​​the pipeline.

[0041] Specifically, through the formula Calculate the crack composition image ,in The final structural defect sparsity coefficient can accurately capture the characteristics of various linear cracks in urban pipelines, clearly showing the extension direction and width of the cracks; through the formula... Calculate corrosion composition image ,in The final texture defect sparsity coefficient can fully present the spot-like and mesh-like texture features of the eroded area; the final background component As background image Clearly presents the texture of defect-free areas on the inner wall of urban pipelines; for Contrast stretching is performed, pixel values ​​are mapped to [0,225], and edge enhancement is performed to eliminate reconstruction noise and obtain a clear, independent image of a single defect component.

[0042] Furthermore, the separation accuracy index ( IoU The IoU (Intersection over Union) ratio is used to verify the separation effect and ensure that the separation results meet the requirements for urban pipeline defect detection. The IoU calculation formula is shown below:

[0043] In this embodiment, the actual defect areas are obtained by manually annotating urban pipeline images to ensure accuracy. The crack composition image is also shown. Corrosion component image Both are significantly better than the traditional threshold segmentation method. Mean 0.62) and U-Net algorithm ( The mean value of 0.81 verifies the high-precision separation advantage of this solution. After successful verification, the separated crack image, corrosion image, and background image are stored and simultaneously transmitted to the subsequent defect recognition module. This provides high-quality independent feature images for the separate identification and classification of cracks and corrosion in urban pipelines, meeting the needs of practical engineering applications.

[0044] The pipeline robot inspection image multi-defect separation method provided in this embodiment acquires standardized grayscale images of the pipeline interior, unifies image data specifications, removes redundant color information and acquisition noise, providing standardized input data for subsequent defect dictionary optimization and sparse decomposition. It iteratively optimizes pre-constructed initial defect dictionary pairs using an improved K-SVD algorithm, ensuring that the optimized adaptive dictionary pairs closely match the actual defect morphology characteristics of the pipeline, compensating for the insufficient adaptability of the initial dictionary pairs and improving the dictionary's accurate representation of various pipeline defect features. Furthermore, the sparse decomposition objective function, constructed from image reconstruction error terms and sparse coefficient constraint terms, is solved using the standardized grayscale images and adaptive dictionary pairs. The difference term can effectively constrain the reconstruction deviation in the image decomposition process, ensuring that the defect details of the original image are complete and not lost. The sparse coefficient constraint term can effectively constrain the sparse coefficients of various defects, distinguish between real defect features and irrelevant interference features, and thus accurately solve for the sparse coefficients of various defects and the pure image background components. Finally, based on the high-precision adaptive dictionary pair, the sparse coefficients of various defects and the background components, the image reconstruction is completed. The original pipeline inspection image can be accurately split into independent background images and defect images corresponding to various defects. This achieves effective separation between multiple types of defects and the background, and between different defects in the pipeline inspection image, avoiding the problem of low defect recognition accuracy caused by multiple defects mixed together and mutual interference between defects and the background in traditional inspection images.

[0045] In some optional implementations, step S202 above includes: Step a1: Divide the standardized grayscale image into overlapping pixel blocks with a preset overlap rate, and convert each pixel block into a corresponding one-dimensional vector.

[0046] In one optional embodiment, defects such as cracks and corrosion on the inner wall of the pipe are local image features, and direct calculation of the entire image would be subject to interference from a large area of ​​background. Segmenting the standardized grayscale image into pixel blocks allows for focused feature analysis of local areas, accurately capturing the defect morphology. Setting overlapping areas for pixel blocks prevents defect features from being truncated or lost if they fall exactly on the block boundaries, ensuring the integrity of the defect features.

[0047] Specifically, the standardized grayscale image is divided into 8×8 overlapping pixel blocks with an overlap rate of 50%, completely covering the circumferential and axial areas of the inner wall of the pipe to ensure that no defective areas are missed.

[0048] Step a2: Based on the initial dictionary pairs and the one-dimensional vector of each pixel block, the orthogonal matching pursuit algorithm is used to solve for the various defect sparsity coefficients of each pixel block.

[0049] In an optional embodiment, the structural defect sparsity coefficients are solved for each pixel block using the OMP (Orthogonal Matching Pursuit) algorithm from the initial dictionary pairs. With texture defect sparsity coefficient This allows pixel blocks to be linearly represented by two types of dictionary atoms, satisfying the formula ,in, A one-dimensional vector representing a single pixel block. These are the initial structure and texture defect dictionary, respectively. To focus on core defect features, the number of non-zero elements in each sparse coefficient is controlled to not exceed 30, avoiding over-encoding that could lead to interfering items such as cement blemishes and minor scratches on the inner wall of urban pipelines being misjudged as defect features.

[0050] Step a3: Input the one-dimensional vector corresponding to each pixel block and the various defect sparsity coefficients of each pixel block into the dictionary update objective function to update the initial dictionary pair and obtain the updated dictionary pair for the current round.

[0051] In an optional embodiment, the dictionary update objective function is determined based on the basic error term and the feature matching degree constraint term. The dictionary update objective function is as follows:

[0052] in, ( Represents structural defects. (representing texture defects) This is the sparse encoded sample set of the corresponding dictionary. As a constraint coefficient, in this embodiment We set it to 0.02 to balance the reconstruction error and the feature matching degree; This is a feature matching constraint term, used to force dictionary atomic matching of the corresponding defect feature template. The calculation formula is:

[0053] in, This refers to the number of dictionary atoms; in this example, it is 2048 dictionary atoms. For the first A dictionary atom, A preset linear feature template (an 8×8 pixel horizontal straight line, adapted to crack linear features) is provided. This is a preset texture feature template, such as an 8×8 pixel random texture image.

[0054] Step a4: If the current iteration count has not reached the preset iteration count, the updated dictionary pair of the current round is used as the initial dictionary pair. The steps of returning the initial dictionary pair and the one-dimensional vector of each pixel block, and using the orthogonal matching pursuit algorithm to solve the various defect sparsity coefficients of each pixel block are iterated until the preset iteration count is reached to obtain the adaptive dictionary pair.

[0055] In one optional embodiment, a single sparse encoding and dictionary update can only slightly optimize dictionary atoms and cannot completely match defect features. Multiple iterations are needed to enhance adaptability. Therefore, steps a1-a4 are executed cyclically, with an iteration count of 10. In this embodiment, after 10 iterations, the matching degree between dictionary atoms and the features of cracks and corrosion in urban pipelines reaches over 85%. Increasing the number of iterations further does not significantly improve accuracy and increases computation time. After the iterations are completed, an optimized adaptive dictionary pair is output. This dictionary pair can accurately match the two types of defect features in urban pipelines, providing a reliable foundation for subsequent sparse decomposition.

[0056] The pipeline robot inspection image multi-defect separation method provided in this embodiment divides a standardized grayscale image into overlapping pixel blocks according to a preset overlap rate and converts them into one-dimensional vectors. Local pixel regions are used as the basic computational units for processing. Then, combining an initial dictionary pair with the one-dimensional vector of the pixel blocks, an orthogonal matching pursuit algorithm is used to solve for the sparse coefficients of various defects corresponding to each pixel block. This accurately obtains the linear combination weights between local image features and the current dictionary, providing an effective computational basis for dictionary updates. Furthermore, the one-dimensional vector of the pixel blocks and the corresponding sparse coefficients of various defects are input into a dictionary update objective function composed of a basic error term and a feature matching degree constraint term. This updates the parameters of the initial dictionary pair. The basic error term ensures that the updated dictionary has stable signal reconstruction capabilities, while the feature matching degree constraint term limits the dictionary optimization direction, allowing the dictionary atoms to gradually conform to the pipeline defect features. Finally, the sparse coefficient solution and dictionary update operations are cyclically executed according to a preset number of iterations. The adaptive dictionary pair obtained after the iteration terminates can fully match the actual defect morphology of the pipeline, effectively compensating for the insufficient specificity of the initial dictionary pair and providing a more adaptable dictionary pair for subsequent image sparse decomposition and multi-defect separation.

[0057] In some alternative implementations, the sparsity coefficient constraint term is determined based on the sum of one or more of the sparsity constraint term, defect type constraint term, and spatial continuity constraint term, wherein: The sparsity constraint term is used to constrain the sparsity coefficients of various defects so that they satisfy the sparse distribution law.

[0058] The defect type constraint is used to constrain the sparsity coefficients of various defects according to the defect type and in combination with the pixel blocks of the actual defect region.

[0059] The spatial continuity constraint term is used to constrain the continuous distribution characteristics of various defect sparsity coefficients in adjacent pixel blocks.

[0060] In one optional embodiment, the traditional MCA sparse decomposition objective function, lacking constraints, is prone to problems such as interference from cross-cutting crack and corrosion features and blurred separation boundaries when applied to the separation of multiple defects in urban pipelines. Considering the characteristics of continuous spatial distribution of defects in urban pipelines and the significant differences in the morphology of the two types of defects, this embodiment improves the objective function by introducing defect type constraint terms and spatial continuity constraint terms. This dual constraint suppresses feature interference while conforming to the distribution pattern of defects in urban pipelines, thereby improving the decomposition accuracy.

[0061] Specifically, the overall expression of the improved sparse decomposition objective function is as follows:

[0062] in, For image reconstruction error term, To standardize grayscale images, For the optimized adaptive dictionary pairs, These are the sparsity coefficients for structural and textural defects, respectively. This is the background component image. The image reconstruction error term ensures that the decomposed image can restore the original features of multiple defects in urban pipelines, avoiding the loss of subtle defects such as fine erosion and micro-cracks due to excessive pursuit of sparsity, and adapting to the needs of urban pipeline defect detection for detail capture.

[0063] As a sparsity constraint term, the L1 norm is used to constrain the sparsity coefficients of the two types of defects. In this embodiment... All values ​​are set to 0.01 to ensure the balance of sparse constraints between the two types of defects. This constraint term can represent defect features with a small number of dictionary atoms, effectively filtering out interference terms such as cement scum and water stains on the inner wall of urban pipelines, and accurately focusing on the two core defects of cracks and corrosion. For defect type constraints; This is a spatial continuity constraint term.

[0064] The pipeline robot inspection image multi-defect separation method provided in this embodiment sets the sparse coefficient constraint term as the sum of one or more of the following: sparsity constraint term, defect type constraint term, and spatial continuity constraint term. This allows for flexible combination of constraint conditions according to the actual image inspection scenario, adapting to pipeline image inspection needs of varying complexity. The sparsity constraint term controls the sparse coefficients of various defects, ensuring they follow a sparse distribution pattern. It filters out scattered irrelevant interference features in the image based on the inherent sparse properties of the defect features themselves, reducing the impact of invalid signals on coefficient solving and ensuring that defect features are preferentially represented. The defect type constraint term combines the defect type with the pixel blocks of the actual defect region to complete the constraint, distinguishing the sparse coefficients based on the inherent morphological differences of different defects, avoiding the aliasing of coefficients corresponding to different defect types. The spatial continuity constraint term constrains the distribution state of various defect sparse coefficients in adjacent pixel blocks, conforming to the objective characteristic of continuous distribution of pipeline defects within the image space, and suppressing calculation errors caused by abrupt changes in local coefficients. Adding a sparse coefficient constraint term to the traditional sparse decomposition objective function can significantly improve the accuracy and rationality of the sparse coefficients.

[0065] In some alternative implementations, the defect type constraint is determined based on the various defect sparsity coefficients and the matching deviation of the pixel blocks in the real defect region, wherein the matching deviation includes structural matching deviation and texture matching deviation.

[0066] In an alternative embodiment, This is a defect type constraint term designed to address the linear extension characteristic of cracks in urban pipelines. It limits the sparsity coefficient of structural defects to correspond only to linear regions in the image, preventing misclassification of corroded areas as cracks. The constraint coefficient is set to 0.03 in this embodiment, and the constraint term is... The calculation formula is , The linear feature gradient of the image is calculated by the Sobel operator, which can accurately locate the linear region where the crack in the urban pipeline is located. It forces the sparsity coefficient of the structural defect to have a non-zero value only in this region, thus solving the classification confusion problem caused by the similar gray levels of the two types of defects. The pipeline robot inspection image multi-defect separation method provided in this embodiment uses the defect type constraint term to construct the matching deviation between the sparse coefficients of various defects and the pixel blocks of the real defect area. The matching deviation is divided into structural matching deviation and texture matching deviation, which can perform feature matching calculations for pipeline structural defects and texture defects respectively. This allows the constraint process to accurately distinguish the two types of defect features with different attributes, further enhances the defect classification effect, and effectively avoids the problem of mutual interference and difficulty in distinguishing different defect features.

[0067] In some alternative implementations, the spatial continuity constraint term is determined by calculating the difference between the corresponding defect sparsity coefficients of adjacent pixel blocks in the entire normalized grayscale image according to each defect type, and then summing all the differences.

[0068] In an alternative embodiment, This is a spatial continuity constraint term, designed to align with the characteristic of continuous spatial distribution of defects in urban pipelines. It ensures the continuity of the sparsity coefficient within the same defect area, preventing the defect from being fragmented into scattered regions. The constraint coefficient is set to 0.02 in this embodiment, and the constraint term is... The calculation formula is By constraining the difference in sparsity coefficients between adjacent pixels, the continuous cracks and large-area corrosion morphology of the separated urban pipelines can be completely identified, providing a clear basis for subsequent defect classification.

[0069] The pipeline robot inspection image multi-defect separation method provided in this embodiment obtains the spatial continuity constraint term by calculating and accumulating the difference of the corresponding sparse coefficients of adjacent pixel blocks in the whole domain according to the defect type. The difference calculation and summarization are performed independently for each type of defect, which can accurately match the spatial distribution characteristics of different defects, standardize the spatial continuity of the sparse coefficients of various defects, and effectively reduce the calculation deviation caused by abnormal fluctuations in the coefficients of adjacent pixel blocks.

[0070] In some optional implementations, various defects, including structural and textural defects, are solved by combining a standardized grayscale image and an adaptive dictionary to obtain sparse coefficients for various defects and background components, including: Step b1: Set the initial structural defect sparsity coefficient and the initial texture defect sparsity coefficient to 0, and perform mean filtering on the standardized grayscale image to obtain the initial background components.

[0071] In an optional embodiment, to adapt to the relatively uniform background of urban pipelines, an initial background component is set. To output a standardized grayscale image The mean filtering results are obtained by using a 15×15 convolution kernel for mean filtering, which can effectively smooth the cement background texture of the inner wall of urban pipelines and avoid background interference in the initial decomposition. The initial structural defect sparsity coefficient and texture defect sparsity coefficient are both set to 0, and the iteration step size is set to 0.001 to balance the iteration speed and accuracy.

[0072] Step b2: Obtain the initial residual based on the L2 norm of the difference between the standardized grayscale image and the initial background components.

[0073] In an alternative embodiment, the initial residual is calculated by the following formula:

[0074] In the formula, As the initial background component, For standardized grayscale images.

[0075] Step b3: Based on the adaptive dictionary pairs, the initial texture defect sparsity coefficients, and the initial background components, solve the sparse decomposition objective function to obtain the first structural defect sparsity coefficients for the current round.

[0076] In an optional embodiment, the first structural defect sparsity coefficient for the current round is solved using the OMP algorithm based on the adaptive dictionary pairs, the initial texture defect sparsity coefficients, and the initial background components. To minimize the improved objective function, the solution formula is as follows:

[0077] In the formula, For the optimized adaptive dictionary pairs, represents the sparsity coefficient of structural defects. Let be the texture defect sparsity coefficient obtained in the nth iteration. Take 0.01, For defect type constraints, This is a spatial continuity constraint term.

[0078] Step b4: Solve the sparse decomposition objective function based on the adaptive dictionary pairs, the first structural defect sparsity coefficients, and the initial background components to obtain the first texture defect sparsity coefficients.

[0079] In an optional embodiment, the adaptive dictionary pairs and the just-updated structural defect sparsity coefficients are maintained. With background components The same OMP algorithm as in step b3 is used to solve for the first texture defect sparsity coefficient. This ensures that the texture coefficient corresponds only to the corrosion characteristics of urban pipelines and does not overlap with crack characteristics.

[0080] Step b5: Update the initial background component based on the first structural defect sparsity coefficient and the first texture defect sparsity coefficient to obtain the first background component.

[0081] In an optional embodiment, the sparsity coefficients of the two types of defects obtained in the current round are fixed. Background components are updated using a 15×15 mean filter. The updated formula is as follows:

[0082] Step b6: Calculate the new residual for this round based on the first structural defect sparsity coefficient, the first texture defect sparsity coefficient, and the first background component.

[0083] In an alternative embodiment, the new residual of this round The calculation formula is as follows:

[0084] Step b7: Determine whether the iteration termination condition is met based on the new residual.

[0085] In an optional embodiment, it is determined whether the new residual is less than a preset threshold or whether the number of iterations has reached the upper limit.

[0086] Step b8: If the iteration termination condition is not met, the calculation result of this round is used as the input data for the next round for iterative update until the iteration termination condition is met, and the various defect sparsity coefficients and background components obtained in the final round are output.

[0087] In an optional embodiment, if the new residual is less than a preset threshold, or the number of iterations reaches the upper limit, the iteration is terminated. The preset threshold can be set to... The maximum number of iterations can be set to 50; if the iteration termination condition is not met, the calculation result of this round will be used as the input data for the next round of iteration, i.e., the number of iterations is [number missing]. n +1, continuously iterate and update until the iteration termination condition is met, and output the various defect sparsity coefficients and background components obtained in the final round.

[0088] The pipeline robot inspection image multi-defect separation method provided in this embodiment adopts a step-by-step iterative solution approach. First, initial values ​​are assigned to the sparse coefficients of structural defects, texture defects, and background components. Initial residuals are calculated based on the standardized grayscale image and the initial background components, establishing a unified initial benchmark for subsequent iterative calculations. Then, the sparse coefficients of structural defects and texture defects are solved alternately, completing the calculation of different types of defect coefficients step by step. This avoids mutual interference that occurs when solving multiple types of defect sparse coefficients simultaneously. The background components are then updated synchronously with the obtained sparse coefficients of the two types of defects, and the residuals corresponding to each iteration are calculated in real time. The new residuals or the total number of iterations are used as the criteria for terminating the iteration, continuously monitoring image reconstruction deviations and gradually optimizing various parameters. Through repeated iterative updates until the termination condition is met, defect images and background images without cross-interference are output, significantly improving the solution accuracy of various defect sparse coefficients and background components, and ensuring the accuracy of image signal decomposition results.

[0089] This embodiment also provides a multi-defect separation device for pipeline robot inspection images. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0090] This embodiment provides a multi-defect separation device for pipeline robot inspection images, such as... Figure 3 As shown, it includes: Image acquisition module 301 is used to acquire a standardized grayscale image of the inside of the pipe; The initial dictionary pair update module 302 is used to optimize the pre-constructed initial dictionary pairs of various defects based on the standardized grayscale image using the improved K-SVD algorithm, so as to obtain adaptive dictionary pairs of various defects. The various defect sparse coefficient update module 303 is used to solve the pre-established sparse decomposition objective function by combining the standardized grayscale image and the adaptive dictionary to obtain the sparse coefficients of various defects and the background components. The sparse decomposition objective function is constructed based on the image reconstruction error term and the sparse coefficient constraint term. The image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of the defect image and the background components and the standardized grayscale image. The sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients of various defects. The defect image reconstruction module 304 is used to reconstruct the image based on the adaptive dictionary pairs, the sparse coefficients of various defects, and the background components, so as to obtain the background image and the defect images corresponding to various defects.

[0091] The pipeline robot inspection image multi-defect separation device provided in this embodiment of the invention can execute the pipeline robot inspection image multi-defect separation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0092] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0093] The following is a detailed reference. Figure 4This diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from memory 408 into random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the electronic device. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0094] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0095] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a memory 408, or installed from a ROM 402. When the computer program is executed by the processor 401, it performs the functions defined in the pipeline robot inspection image multi-defect separation method of the embodiments of the present invention.

[0096] Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0097] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the multi-defect separation method for pipeline robot inspection images shown in the above embodiments is implemented.

[0098] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0099] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for separating multiple defects in pipeline robot inspection images, characterized in that, The method includes: Obtain a standardized grayscale image of the inside of the pipe; Based on the standardized grayscale image, the improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs of various defects to obtain adaptive dictionary pairs of various defects; The standardized grayscale image and the adaptive dictionary are combined to solve the pre-established sparse decomposition objective function, obtaining the sparse coefficients of various defects and background components. The sparse decomposition objective function is constructed based on an image reconstruction error term and a sparse coefficient constraint term. The image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of the defect image and background components and the standardized grayscale image. The sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients of various defects. Based on the adaptive dictionary pair, the sparse coefficients of various defects, and the background components, the image is reconstructed to obtain the background image and the defect images corresponding to each type of defect. Based on the standardized grayscale image, an improved K-SVD algorithm is used to optimize the pre-constructed initial dictionary pairs to obtain adaptive dictionary pairs, including: The standardized grayscale image is divided into overlapping pixel blocks with a preset overlap rate, and each pixel block is converted into a corresponding one-dimensional vector; Based on the initial dictionary pairs and the one-dimensional vector of each pixel block, the orthogonal matching pursuit algorithm is used to solve for the various defect sparsity coefficients of each pixel block; The one-dimensional vector corresponding to each pixel block and the various defect sparsity coefficients of each pixel block are input into the dictionary update objective function to update the initial dictionary pair, thereby obtaining the updated dictionary pair for the current round. The dictionary update objective function is determined based on the basic error term and the feature matching degree constraint term. If the current iteration count has not reached the preset iteration count, the updated dictionary pair of the current round is used as the initial dictionary pair. The steps of solving the various defect sparsity coefficients of each pixel block using the orthogonal matching pursuit algorithm based on the initial dictionary pair and the one-dimensional vector of each pixel block are iterated until the preset iteration count is reached to obtain the adaptive dictionary pair.

2. The method according to claim 1, characterized in that, The sparse coefficient constraint term is determined by the sum of one or more of the following: sparsity constraint term, defect type constraint term, and spatial continuity constraint term, wherein: The sparsity constraint term is used to constrain the sparsity coefficients of various defects so that they satisfy the sparse distribution law; The defect type constraint term is used to constrain the sparsity coefficient of various defects according to the defect type and in combination with the pixel blocks of the actual defect area; The spatial continuity constraint term is used to constrain the continuous distribution characteristics of various defect sparsity coefficients in adjacent pixel blocks.

3. The method according to claim 2, characterized in that, The defect type constraint is determined based on the sparsity coefficients of various defects and the matching deviation of pixel blocks in the real defect region. The matching deviation includes structural matching deviation and texture matching deviation.

4. The method according to claim 2, characterized in that, The spatial continuity constraint term is determined by calculating the difference between the corresponding defect sparsity coefficients of adjacent pixel blocks in the entire normalized grayscale image according to each defect type, and then summing all the differences.

5. The method according to any one of claims 1-4, characterized in that, Various defects include structural defects and texture defects. The pre-established sparse decomposition objective function is solved by combining the standardized grayscale image and the adaptive dictionary to obtain the sparse coefficients of various defects and background components, including: The initial structural defect sparsity coefficient and the initial texture defect sparsity coefficient are set to 0, and the mean filter is applied to the standardized grayscale image to obtain the initial background components. The initial residual is obtained based on the L2 norm of the difference between the standardized grayscale image and the initial background components; Based on the adaptive dictionary pairs, the initial texture defect sparsity coefficients and the initial background components, the sparse decomposition objective function is solved to obtain the first structural defect sparsity coefficients of the current round. Based on the adaptive dictionary pairs, the first structural defect sparse coefficients and the initial background components, the sparse decomposition objective function is solved to obtain the first texture defect sparse coefficients. The initial background components are updated based on the first structural defect sparsity coefficient and the first texture defect sparsity coefficient to obtain the first background components; Calculate the new residual for this round based on the first structural defect sparsity coefficient, the first texture defect sparsity coefficient, and the first background component; Determine whether the iteration termination condition is met based on the new residual; If the iteration termination condition is not met, the calculation result of this round will be used as the input data for the next round for iterative updates until the iteration termination condition is met, and the various defect sparsity coefficients and background components obtained in the final round will be output.

6. A multi-defect separation device for pipeline robot inspection images, characterized in that, The device includes: The image acquisition module is used to acquire a standardized grayscale image of the inside of the pipe; The initial dictionary pair update module is used to optimize pre-constructed initial dictionary pairs for various defects based on the standardized grayscale image using an improved K-SVD algorithm to obtain adaptive dictionary pairs for various defects; the optimization of pre-constructed initial dictionary pairs based on the standardized grayscale image using an improved K-SVD algorithm to obtain adaptive dictionary pairs includes: The standardized grayscale image is divided into overlapping pixel blocks with a preset overlap rate, and each pixel block is converted into a corresponding one-dimensional vector. Based on the initial dictionary pair and the one-dimensional vector of each pixel block, the orthogonal matching pursuit algorithm is used to solve for various defect sparsity coefficients of each pixel block. The one-dimensional vector corresponding to each pixel block and the various defect sparsity coefficients of each pixel block are input into the dictionary update objective function to update the initial dictionary pair, thereby obtaining the updated dictionary pair for the current round. The dictionary update objective function is determined based on the basic error term and the feature matching degree constraint term. If the current iteration number has not reached the preset iteration number, the updated dictionary pair for the current round is used as the initial dictionary pair. The steps of solving for various defect sparsity coefficients of each pixel block using the orthogonal matching pursuit algorithm based on the initial dictionary pair and the one-dimensional vector of each pixel block are iterated until the preset iteration number is reached, thereby obtaining an adaptive dictionary pair. The various defect sparse coefficient update modules are used to solve a pre-established sparse decomposition objective function by combining the standardized grayscale image and the adaptive dictionary to obtain the sparse coefficients of various defects and background components. The sparse decomposition objective function is constructed based on an image reconstruction error term and a sparse coefficient constraint term. The image reconstruction error term is used to characterize the constraint on the error between the reconstructed image composed of the defect image and background components and the standardized grayscale image. The sparse coefficient constraint term is used to characterize the constraint on the sparse coefficients of various defects. The defect image reconstruction module is used to reconstruct the image based on the adaptive dictionary pair, the sparse coefficients of various defects, and the background components, so as to obtain the background image and the defect images corresponding to various defects.

7. An electronic device, characterized in that, include: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the pipeline robot inspection image multi-defect separation method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the pipeline robot inspection image multi-defect separation method according to any one of claims 1 to 5.

9. A computer program product, characterized in that, It includes computer instructions for causing a computer to execute the pipeline robot inspection image multi-defect separation method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Municipal pipeline image intelligent classification method and device based on dynamic sparse constraint

    CN120912992A

  • Image denoising method based on structure clustering and sparse representation

    CN121685302A