Pipeline defect identification methods, devices, electronic equipment and storage media

CN116824354BActive Publication Date: 2026-08-14SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]目前,管道状况的检测通常采用专业的管道CCTV(闭路电视)检测机器人或者管道QV(潜望镜)检测机器人进入管道内的状况进行录像,再由人工对视频经常筛查,缺陷识别效率较低

Benefits of technology

[0018] The technical solution of this invention obtains an image of the pipe to be identified and a corresponding defect mask image of the pipe to be identified, and determines the pipe center information based on the obtained image of the pipe to be identified and the defect mask image, thereby realizing the prediction of the pipe center information; furthermore, the pipe defect location is determined based on the predicted pipe center information and the defect mask image, thereby realizing the automatic identification of the pipe defect location and improving the efficiency of pipe defect identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116824354B_ABST
    Figure CN116824354B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, electronic device, and storage medium for pipeline defect identification. The method includes: acquiring an image of a pipeline to be identified and a corresponding defect mask image; determining the pipeline center information based on the pipeline image and the defect mask image; and determining the pipeline defect location based on the pipeline center information and the defect mask image. This technical solution achieves automatic identification of pipeline defect locations, improving the efficiency of pipeline defect identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, apparatus, electronic device and storage medium for identifying pipeline defects. Background Technology

[0002] With the rapid development of society, China's urbanization level is increasing, and the scale of urban municipal pipe networks is also expanding. This brings about problems such as pipe congestion or leakage, which have a significant impact on urban operation and development, people's lives and property safety, and daily life and travel.

[0003] Currently, pipeline condition inspection typically involves using specialized pipeline CCTV (closed-circuit television) inspection robots or pipeline QV (periscope) inspection robots to record the condition inside the pipeline, followed by frequent manual screening of the videos, resulting in low efficiency in defect identification. Summary of the Invention

[0004] This invention provides a pipeline defect identification method, apparatus, electronic device, and storage medium to improve pipeline defect identification efficiency.

[0005] In a first aspect, embodiments of the present invention provide a pipeline defect identification method, comprising:

[0006] Obtain the image of the pipe to be identified and the corresponding defect mask image of the pipe to be identified;

[0007] The center information of the pipe is determined based on the image of the pipe to be identified and the defect mask image;

[0008] The location of the pipeline defect is determined based on the pipeline center information and the defect mask image.

[0009] Secondly, embodiments of the present invention also provide a pipeline defect identification device, comprising:

[0010] The pipeline image acquisition module is used to acquire the pipeline image to be identified and the defect mask image corresponding to the pipeline image to be identified;

[0011] The pipeline center determination module is used to determine the pipeline center information based on the pipeline image to be identified and the defect mask image;

[0012] The defect location determination module is used to determine the location of the pipeline defect based on the pipeline center information and the defect mask image.

[0013] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:

[0014] One or more processors;

[0015] Storage device for storing one or more programs.

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the pipeline defect identification method provided in any embodiment of the present invention.

[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the pipeline defect identification method provided in any embodiment of the present invention.

[0018] The technical solution of this invention obtains an image of the pipe to be identified and a corresponding defect mask image of the pipe to be identified, and determines the pipe center information based on the obtained image of the pipe to be identified and the defect mask image, thereby realizing the prediction of the pipe center information; furthermore, the pipe defect location is determined based on the predicted pipe center information and the defect mask image, thereby realizing the automatic identification of the pipe defect location and improving the efficiency of pipe defect identification. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of exemplary embodiments of the present invention, the accompanying drawings used in describing the embodiments are briefly introduced below. Obviously, the accompanying drawings described are only a portion of the drawings of the embodiments to be described in this invention, and not all of the drawings. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.

[0020] Figure 1 This is a schematic flowchart of a pipeline defect identification method provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a schematic diagram of a defect clock bit representation method provided in Embodiment 1 of the present invention;

[0022] Figure 3 This is a schematic flowchart of a pipeline defect identification method provided in Embodiment 2 of the present invention;

[0023] Figure 4 This is a flowchart illustrating a pipeline defect identification method provided in Embodiment 3 of the present invention;

[0024] Figure 5 The flowchart shows the calculation process of a determination strategy provided in Embodiment 3 of the present invention.

[0025] Figure 6 This is a schematic flowchart of a pipeline defect identification method provided in Embodiment 4 of the present invention;

[0026] Figure 7This is a schematic diagram of the structure of a pipeline defect identification device provided in Embodiment 5 of the present invention;

[0027] Figure 8 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of the present invention. Detailed Implementation

[0028] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0029] It should also be noted that, for ease of description, the accompanying drawings show only the parts relevant to the invention and not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. The process may correspond to a method, function, procedure, subroutine, subprogram, etc.

[0030] Example 1

[0031] Figure 1 This is a flowchart illustrating a pipeline defect identification method provided in Embodiment 1 of the present invention. This embodiment is applicable to the automatic identification of pipeline defects. The method can be executed by a pipeline defect identification device, which can be implemented by software and / or hardware and can be configured in a terminal and / or server to implement the pipeline defect identification method in this embodiment of the present invention.

[0032] like Figure 1 As shown, the method in this embodiment may specifically include:

[0033] S110. Obtain the image of the pipe to be identified and the defect mask image corresponding to the image of the pipe to be identified.

[0034] S120. Determine the center information of the pipe based on the image of the pipe to be identified and the defect mask image.

[0035] S130. Determine the location of the pipeline defect based on the pipeline center information and the defect mask image.

[0036] In this embodiment, the pipeline image to be identified can refer to a screenshot of an image or video taken inside the pipeline, and is not limited thereto. The defect mask image corresponding to the pipeline image to be identified can refer to a mask image of the defect area in the pipeline image to be identified, that is, masking the non-defective local areas.

[0037] Specifically, the image of the pipe to be identified can be obtained by a pipe closed-circuit television inspection robot or a pipe periscope inspection robot entering the pipe and taking pictures; alternatively, the image of the pipe to be identified can also be a pre-made pipe image that can be retrieved from a preset storage location. The method for obtaining the defect mask image corresponding to the image of the pipe to be identified includes: multiplying the pre-made region of interest mask with the image of the pipe to be identified to obtain the defect mask image corresponding to the image of the pipe to be identified; or, inputting the image of the pipe to be identified into a pre-trained defect mask prediction model to obtain the defect mask image corresponding to the image of the pipe to be identified. This embodiment does not limit this method. The defect mask prediction model can be a deep learning network model, which can be trained based on a large number of pipe images and defect mask sample images. When the trained defect mask prediction model is applied, inputting the image of the pipe to be identified into the pre-trained defect mask prediction model can quickly obtain the defect mask image corresponding to the image of the pipe to be identified. The network architecture of the deep learning network model is not limited here; for example, ResNet18, ResNet34, etc.

[0038] In this embodiment, the pipe center information can refer to the pipe center coordinates. The pipe center information is a predicted value and can be used as a reference for determining the location of pipe defects. Specifically, methods for determining the pipe center information include, but are not limited to: inputting the pipe image to be identified or the defect mask image into a pre-trained center prediction model to obtain the pipe center information; or stitching the pipe image to be identified and the defect mask image together, using the stitched result as input to a pre-trained center prediction model to obtain the pipe center information. This embodiment does not limit this approach. The center prediction model can be a deep learning network model, trained on a large number of pipe sample images and pipe center sample images. When applying the trained center prediction model, the pipe image to be identified can be input into the pre-trained center prediction model to quickly obtain the pipe center information. The network architecture of the deep learning network model is not limited here; for example, ResNet18, ResNet34, etc.

[0039] In this embodiment, the pipeline defect location refers to the location of the pipeline defect. A defect can refer to obstacles, debris, or other conditions affecting pipeline operation, such as deformation or disconnection, within the pipeline. Optionally, the pipeline defect location includes a defect clock position, where the defect clock position refers to the time zone of the defect. Specifically, the pipeline is divided into twelve time zones, and the defect location is determined based on its time zone. This method for determining the pipeline defect location is simple and efficient.

[0040] For example, such as Figure 2 As shown, the defect clock position can be represented by the time zone of the circumferential location of the pipeline defect. The first two digits indicate the starting time (hour), and the last two digits indicate the ending time (hour). If the defect is located at a specific point, 00 is used to replace the first two digits, and the last two digits indicate the defect location; for example, 0903 indicates a pipeline defect between 9 o'clock and 3 o'clock, 0310 indicates a pipeline defect between 3 o'clock and 10 o'clock, and 0002 indicates a defect at 2 o'clock.

[0041] Specifically, methods for determining the location of pipe defects include, but are not limited to: determining the distance between the pipe center information and each edge point of the defect mask image, and determining the edge point corresponding to the minimum distance as the location of the pipe defect; or, determining the distance between the pipe center information and each edge point of the defect mask image, and determining the edge point that meets the preset distance range as the location of the pipe defect. It can be understood that the location of the pipe defect may include one or more.

[0042] The technical solution of this invention obtains an image of the pipe to be identified and a corresponding defect mask image of the pipe to be identified, and determines the pipe center information based on the obtained image of the pipe to be identified and the defect mask image, thereby realizing the prediction of the pipe center information; furthermore, the pipe defect location is determined based on the predicted pipe center information and the defect mask image, thereby realizing the automatic identification of the pipe defect location and improving the efficiency of pipe defect identification.

[0043] Example 2

[0044] Figure 3 This is a flowchart of the pipeline defect identification method provided in Embodiment 2 of the present invention. Optionally, based on any optional technical solution in the embodiments of the present invention, determining the pipeline center information based on the pipeline image to be identified and the defect mask image includes: encoding the defect mask image to obtain two-dimensional encoding information; multiplying the two-dimensional encoding information with the defect mask image to obtain a position-encoded image; stitching the position-encoded image with the pipeline image to be identified to obtain a stitched pipeline image; and inputting the stitched pipeline image into a pre-trained center prediction model to obtain the pipeline center information.

[0045] like Figure 3 As shown, the method in this embodiment may specifically include:

[0046] S210. Obtain the image of the pipe to be identified and the defect mask image corresponding to the image of the pipe to be identified.

[0047] S220. The defect mask image is positionally encoded to obtain two-dimensional encoded information.

[0048] S230. Multiply the two-dimensional encoded information with the defect mask image to obtain a position encoded image.

[0049] S240. The location-encoded image is stitched together with the image of the pipe to be identified to obtain a stitched pipe image.

[0050] S250. Input the pipe stitched image into the pre-trained center prediction model to obtain the pipe center information.

[0051] S260. Determine the location of the pipeline defect based on the pipeline center information and the defect mask image.

[0052] In this embodiment, the two-dimensional encoding information refers to the two-dimensional encoding information of the defect mask image, which can be determined by splicing one-dimensional horizontal and vertical encoding information. The position-encoded image refers to the mask image with position-encoded information. The pipe spliced ​​image refers to the image obtained by splicing the position-encoded image with the image of the pipe to be identified. It is an image with more obvious features, enabling the center prediction model to extract richer image features and improve the accuracy of the pipe center information.

[0053] For example, by performing positional encoding on the defect mask image using a preset encoding method, horizontal and vertical encoding information can be obtained. The horizontal and vertical encoding information are then concatenated to obtain two-dimensional encoding information. The preset encoding method can include, but is not limited to, positional encoding methods in Transformer. The horizontal and vertical encoding information each have two channels, and the two-dimensional encoding information has four channels. Further, the two-dimensional encoding information is multiplied by the defect mask image to obtain a mask image with positional information, i.e., a positionally encoded image. Further, the positionally encoded image is concatenated with the image of the pipe to be identified according to its channels to obtain a concatenated pipe image. This concatenated pipe image is then input into a pre-trained center prediction model to obtain the pipe center information. The pre-trained center prediction model can be a deep learning network model, such as ResNet18 or ResNet34. It should be noted that the pipeline center information is a predicted value, which can be dynamically changed based on the defect mask image and the image of the pipeline to be identified. Compared with the method of directly using the center of the image of the pipeline to be identified as the center, this pipeline center information is more consistent with the actual pipeline center position. Therefore, the pipeline defect position can be determined by the pipeline center information, thus improving the accuracy of pipeline defect location.

[0054] The technical solution of this invention, by determining the two-dimensional encoding information of the defect mask image, realizes the encoding of the internal position of the defect mask image. The two-dimensional encoding information is multiplied by the defect mask image to obtain the position encoding image. The position encoding image is stitched with the image of the pipe to be identified to obtain the pipe stitched image. The pipe stitched image is input into a pre-trained circle center prediction model to obtain the pipe circle center information. Compared with the method of directly using the center of the image of the pipe to be identified as the circle center, the pipe circle center information is more consistent with the real pipe circle center position. Thus, the pipe defect position is determined by the pipe circle center information, improving the accuracy of the pipe defect position.

[0055] Example 3

[0056] Figure 4 This is a flowchart of the pipeline defect identification method provided in Embodiment 3 of the present invention. Based on any optional technical solution in the embodiments of the present invention, this embodiment may optionally include determining the pipeline defect location based on the pipeline center information and the defect mask image, which includes: determining a defect rectangle based on the edge points of the defect region in the defect mask image; and determining the pipeline defect location based on the pipeline center information and the defect rectangle.

[0057] like Figure 4 As shown, the method in this embodiment may specifically include:

[0058] S310. Obtain the image of the pipe to be identified and the defect mask image corresponding to the image of the pipe to be identified.

[0059] S320. Determine the center information of the pipe based on the image of the pipe to be identified and the defect mask image.

[0060] S330. Determine the defect rectangle based on the edge points of the defect region in the defect mask image.

[0061] S340. Determine the location of the pipeline defect based on the pipeline center information and the defect rectangle.

[0062] In this embodiment, the defect rectangle refers to the bounding rectangle of the defect region, which can be used to measure the location of the pipeline defect. It is understood that there are differences in pixel values ​​between the defective and non-defective regions in the defect mask image; for example, the pixel value of the defective region is 1, and the pixel value of the non-defective region is 0. Therefore, the defect rectangle can be determined based on the changes in pixel values ​​in the defect mask image. Specifically, the coordinates of pixels whose pixel values ​​change in the horizontal or vertical direction in the defect mask image are used to determine the length or width of the defect rectangle, thereby identifying the defect rectangle.

[0063] Furthermore, the location of the pipeline defect can be determined based on the pipeline center information and the defect rectangle. Specifically, the distance from the center to each border can be determined based on the pipeline center information and the defect rectangle, and the area of ​​the border with the shortest distance can be determined as the location of the pipeline defect; or, the endpoint corresponding to the shortest border can be determined as the location of the pipeline defect. This embodiment does not limit this.

[0064] Based on the above embodiments, determining the location of the pipeline defect based on the pipeline center information and the defect rectangle includes: determining a determination strategy for the location of the pipeline defect based on the positional relationship between the pipeline center information and the defect rectangle, and determining the location of the pipeline defect based on the determination strategy. The determination strategy includes at least one of the following determination methods: a hypotenuse clock position determination method, a long side clock position determination method, and a tangent clock position determination method.

[0065] The positional relationship between the pipe center information and the defect rectangle includes, but is not limited to, the center being within the defect rectangle and the center not being within the defect rectangle. In this embodiment, based on different positional relationships between the pipe center information and the defect rectangle, a corresponding pipe defect location determination strategy can be determined. The determination strategy can consist of one or more clock position determination methods. This method of determining the determination strategy improves the flexibility and applicability of the determination strategy, thereby improving the accuracy of determining the pipe defect location.

[0066] Specifically, the diagonal clock position determination method is used to determine the slopes of two sets of diagonals based on the pipe center information and the defect rectangle, and to determine the pipe defect location based on the diagonal with the largest slope difference. Here, the diagonal refers to the line connecting the center of the pipe to each endpoint of the defect rectangle; endpoints at opposite corners form a group. The endpoint corresponding to the diagonal with the largest slope difference is determined as the pipe defect location, or the range of the endpoints corresponding to the diagonal with the largest slope difference is determined as the pipe defect location. The long side clock position determination method is used to determine multiple center-border distances based on the pipe center information and the defect rectangle, and to determine the endpoint of the border corresponding to the largest center-border distance as the pipe defect location. Here, the center-border distance refers to the distance from the pipe center to the longer border of the defect rectangle; the two endpoints of the longer border farther from the center are determined as the pipe defect locations. The tangent clock position determination method is used to divide the pipe into twelve time zones based on the pipe center information, and to determine the pipe defect location based on the time zone where the defect area is located. Specifically, a virtual tangent line extends outward from the center of the pipeline along the time zone boundary. The time zone of the defect area is determined based on the intersection of this extended line with the defect area, thus identifying the location of the pipeline defect. For example, if the extended lines of the time zones corresponding to one and two points intersect the defect area, it indicates that the pipeline defect is located at defect clock position 0102.

[0067] Based on the above embodiments, the determination strategy further includes: after any of the determination methods is executed, verifying the pipeline defect location obtained by executing the determination method based on the prior information corresponding to the executed determination method, wherein the prior information includes the pipeline defect type and the defect location information corresponding to the pipeline defect type.

[0068] The prior information can be the result of judging pipeline defects based on experience, and may include, but is not limited to, pipeline defect type and corresponding defect location information. The prior information of each determination method can be the same or different; this embodiment does not impose any limitations. Pipeline defect type refers to the classification type of pipeline defects, and defect location information refers to the defect location characteristics corresponding to the pipeline defect type. For example, pipeline defect types include, but are not limited to, sediment, scum, and undulations, with corresponding defect location information indicating that clock positions 05, 06, and 07 are always present; pipeline defect type is an obstacle, with corresponding defect location information indicating that clock position 06 is always present; pipeline defect types are scaling and corrosion, with corresponding defect location information indicating that clock position 06 is not present; pipeline defect type is deformation, with corresponding defect location information indicating that clock positions 11, 12, and 01 are always present; pipeline defect type is a concealed connection, with corresponding defect location information indicating that clock positions 05, 06, and 07 are not present; pipeline defect type is a disconnection, with corresponding defect location information indicating that clock position 1200 is present. In this embodiment, verifying the pipeline defect location obtained by the judgment strategy using prior information can effectively improve the accuracy of pipeline defect identification.

[0069] For example, after any determination method is executed, the location of the pipeline defect corresponding to the determination method can be obtained. The pipeline defect location can be compared and verified with prior information. The comparison and verification can specifically include: the pipeline defect location can be the clock position corresponding to the defect location, the prior information is the pipeline defect type, and the clock position condition corresponding to the pipeline defect type. If the clock position obtained by the determination method meets the clock position condition in the prior information, it indicates that the determination method has been successfully verified; otherwise, it indicates that the determination method has failed to be verified.

[0070] Based on the above embodiments, the determination strategy for determining the location of a pipeline defect based on the positional relationship between the pipeline center information and the defect rectangle includes: if the pipeline center information is not located within the defect rectangle, the determination strategy includes sequentially executing the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method, and stopping the execution of the next determination method when any determination method obtains a pipeline defect location that conforms to the prior information; if the pipeline center information is located within the defect rectangle and the pipeline center information is located within the defect area, the determination strategy includes sequentially executing the first long side clock position determination method and the second long side clock position determination method, and stopping the execution of the next determination method when any determination method obtains a pipeline defect location that conforms to the prior information; if the pipeline center information is located within the defect rectangle and the pipeline center information is not located within the defect area, the determination strategy includes sequentially executing the tangent clock position determination method and the long side clock position determination method, and stopping the execution of the next determination method when any determination method obtains a pipeline defect location that conforms to the prior information.

[0071] For example, Figure 5 This is a flowchart of the calculation process for the determination strategy. If the pipe center information is not located within the defect rectangle, the defect clock position (i.e., the pipe defect location) is calculated using the hypotenuse clock position determination method. If the defect clock position matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the tangent clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the tangent clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the long side clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the long side clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the defect clock position calculated using the hypotenuse clock position determination method is added to the clock information in the prior information to obtain the pipe defect location.

[0072] If the pipe center information is located within the defect rectangle and within the defect area, the first long-side clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the first long-side clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the second long-side clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the second long-side clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the defect clock position calculated using the first long-side clock position determination method is added to the clock information in the prior information to obtain the pipe defect location. It should be noted that the long-side clock position determination method includes the first long-side clock position determination method and the second long-side clock position determination method. The difference between the first and second long-side clock position determination methods is that the first long-side clock position determination method uses the long side farther from the center, while the second long-side clock position determination method uses the long side closer to the center.

[0073] If the pipe center information is located within the defect rectangle, but not within the defect area, the tangential clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the tangential clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the long-side clock position determination method is used to calculate the defect clock position. If the defect clock position calculated using the long-side clock position determination method matches the prior information, the obtained defect clock position is determined as the pipe defect location. If the defect clock position does not match the prior information, the defect clock position calculated using the tangential clock position determination method is added to the clock information in the prior information to obtain the pipe defect location.

[0074] The technical solution of this invention determines the defect rectangle by the edge points of the defect region in the defect mask image, and determines the location of the pipeline defect based on the pipeline center information and the defect rectangle. This method is simple and can effectively improve the efficiency of pipeline defect identification. Furthermore, based on the judgment strategy set by the experiment, the accuracy of the obtained pipeline defect location can be effectively improved.

[0075] Example 4

[0076] Figure 6 This is a flowchart of pipeline defect identification provided in Embodiment 4 of the present invention. Based on any optional technical solution in the embodiments of the present invention, this embodiment may optionally include, after determining the pipeline defect location based on the pipeline center information and the defect mask image, the method further includes: determining the basic circular image of the pipeline image to be identified; determining the pipeline intersection-union ratio based on the defect region and the outer rectangle of the largest connected region in the basic circular image; if the pipeline intersection-union ratio meets a preset threshold range, then it is determined that the pipeline is in a disconnected state.

[0077] like Figure 6 As shown, the method in this embodiment may specifically include:

[0078] S410. Obtain the image of the pipe to be identified and the defect mask image corresponding to the image of the pipe to be identified.

[0079] S420. Determine the center information of the pipe based on the image of the pipe to be identified and the defect mask image.

[0080] S430. Determine the location of the pipeline defect based on the pipeline center information and the defect mask image.

[0081] S440. Determine the basic circular image of the pipeline image to be identified.

[0082] S450. Based on the defective region and the outer rectangle of the largest connected region in the basic circular image, determine the pipe intersection-union ratio.

[0083] S460. If the pipeline crossover ratio meets the preset threshold range, then the pipeline is determined to be in a disconnected state.

[0084] In this embodiment, the base circular image refers to an image containing the predicted pipe circle.

[0085] Specifically, the image of the pipe to be identified can be input into a pre-trained pipe circle prediction model to obtain a basic circular image. This prediction model can be a deep learning network model, trained on a large number of pipe images and pipe circle sample images. Inputting the image of the pipe to be identified into the pre-trained model quickly yields the basic circular image. The network architecture of the deep learning network model is not limited here; for example, ResNet18 or ResNet34 are acceptable. Furthermore, the basic circular image can be subjected to erosion and dilation processing to determine the circumscribed rectangle of the largest connected region of the pipe circle. The Intersection over Union (IoU) ratio is determined based on the area of ​​the defect region and the circumscribed rectangle region. If the IoU ratio meets a preset threshold range, the pipe is determined to be in a disjointed state.

[0086] The technical solution of this invention, through the calculation and verification of the cross-union ratio, determines whether the pipeline is in a disjointed state, which makes up for the shortcomings of existing pipeline defect identification methods that are difficult to identify pipeline disjointed states, and improves the accuracy of pipeline defect identification.

[0087] Example 5

[0088] Figure 7 This is a schematic diagram of the pipe defect identification device provided in Embodiment 5 of the present invention. The pipe defect identification device provided in this embodiment can be implemented by software and / or hardware, and can be configured in a terminal and / or server to implement the pipe defect identification method in the embodiments of the present invention. Specifically, the device may include:

[0089] The pipeline image acquisition module 510 is used to acquire a pipeline image to be identified and a defect mask image corresponding to the pipeline image to be identified; the pipeline center determination module 520 is used to determine the pipeline center information based on the pipeline image to be identified and the defect mask image; and the defect location determination module 530 is used to determine the pipeline defect location based on the pipeline center information and the defect mask image.

[0090] Based on any optional technical solution in the embodiments of the present invention, the pipeline center determination module 520 may also be used for:

[0091] The defect mask image is positionally encoded to obtain two-dimensional encoded information;

[0092] The two-dimensional encoded information is multiplied by the defect mask image to obtain the position encoded image;

[0093] The location-encoded image is stitched together with the image of the pipe to be identified to obtain a stitched pipe image;

[0094] The pipe stitched image is input into a pre-trained center prediction model to obtain the pipe center information.

[0095] Based on any optional technical solution in the embodiments of the present invention, the defect location determination module 530 optionally includes:

[0096] A defect rectangle determination unit is used to determine a defect rectangle based on the edge points of the defect region in the defect mask image.

[0097] The defect location determination unit is used to determine the location of the pipeline defect based on the pipeline center information and the defect rectangle.

[0098] Based on any optional technical solution in the embodiments of the present invention, the defect location determination unit may optionally include:

[0099] The determination strategy subunit is used to determine the determination strategy for the location of the pipeline defect based on the positional relationship between the pipeline center information and the defect rectangle. The determination strategy includes at least one of the following determination methods: the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method.

[0100] Based on any optional technical solution in the embodiments of the present invention, the determination strategy may optionally further include:

[0101] After any of the determination methods is executed, the pipeline defect location obtained by executing the determination method is verified based on the prior information corresponding to the executed determination method, wherein the prior information includes the pipeline defect type and the defect location information corresponding to the pipeline defect type.

[0102] Based on any optional technical solution in the embodiments of the present invention, the determination strategy determining subunit may optionally be used for:

[0103] If the pipe center information is not located within the defect rectangle, the corresponding determination strategy includes sequentially executing the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method, and stopping the execution of the next determination method when any determination method obtains a pipe defect position that conforms to the prior information;

[0104] If the pipe center information is located within the defect rectangle and the pipe center information is located within the defect area, the corresponding determination strategy includes sequentially executing the first long side clock position determination method and the second long side clock position determination method, and stopping the execution of the next determination method when either determination method obtains the pipe defect position that matches the prior information;

[0105] If the pipe center information is located within the defect rectangle, and the pipe center information is not located within the defect area, the corresponding determination strategy includes sequentially executing the tangent clock position determination method and the long side clock position determination method, and stopping the execution of the next determination method when either determination method obtains a pipe defect position that conforms to the prior information.

[0106] Based on any optional technical solution in the embodiments of the present invention, optionally, the diagonal clock position determination method is used to determine the slope of two sets of diagonals according to the pipe center information and the defect rectangle, and determine the pipe defect position according to the diagonal with the largest slope difference; the long side clock position determination method is used to determine multiple center-border distances according to the pipe center information and the defect rectangle, and determine the pipe defect position by the border endpoint corresponding to the largest center-border distance; the tangent clock position determination method is used to determine the division of twelve time zones according to the pipe center information, and determine the pipe defect position based on the time zone where the defect area is located.

[0107] Optionally, based on any of the optional technical solutions in the embodiments of the present invention, the device is further used for:

[0108] Determine the underlying circular image of the pipeline image to be identified;

[0109] Based on the defect region and the bounding rectangle of the largest connected region in the basic circular image, the pipe intersection-union ratio is determined;

[0110] If the pipeline crossover ratio meets the preset threshold range, then the pipeline is determined to be in a disconnected state.

[0111] The above-described pipeline defect identification device can execute the pipeline defect identification method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the pipeline defect identification method.

[0112] Example 6

[0113] Figure 8 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of the present invention. Figure 8 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 8 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0114] like Figure 8 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0115] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0116] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0117] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 8 Not shown; usually referred to as a "hard drive"). Although Figure 8 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0118] A program / utility 36 having a set (at least one) of program modules 26 may be stored, for example, in system memory 28. Such program modules 26 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 26 typically perform the functions and / or methods described in the embodiments of the present invention.

[0119] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the electronic device 12, and / or with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 8 As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although... Figure 8 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0120] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a pipeline defect identification method provided in the embodiments of the present invention.

[0121] Example 7

[0122] Embodiment 7 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a pipeline defect identification method, the method comprising:

[0123] Obtain the image of the pipe to be identified and the corresponding defect mask image of the pipe to be identified;

[0124] The center information of the pipe is determined based on the image of the pipe to be identified and the defect mask image;

[0125] The location of the pipeline defect is determined based on the pipeline center information and the defect mask image.

[0126] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0127] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0128] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0129] Computer program code for performing the operations of embodiments of the present invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for identifying pipeline defects, characterized in that, include: Obtain the image of the pipe to be identified and the corresponding defect mask image of the pipe to be identified; The center information of the pipe is determined based on the image of the pipe to be identified and the defect mask image; The location of the pipeline defect is determined based on the pipeline center information and the defect mask image. The step of determining the location of the pipeline defect based on the pipeline center information and the defect mask image includes: The defect bounding box is determined based on the edge points of the defect region in the defect mask image. Based on the positional relationship between the pipeline center information and the defect rectangle, a strategy for determining the pipeline defect location is established. The pipeline defect location is determined based on the determination strategy, wherein the determination strategy includes at least one of the following determination methods: the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method. The method for determining the diagonal clock position is used to determine the slope of two sets of diagonals based on the pipe center information and the defect rectangle, and to determine the pipe defect location based on the diagonal with the largest slope difference; the method for determining the long side clock position is used to determine multiple center-border distances based on the pipe center information and the defect rectangle, and to determine the border endpoint corresponding to the largest center-border distance as the pipe defect location; the method for determining the tangent clock position is used to determine twelve time zones based on the pipe center information, and to determine the pipe defect location based on the time zone where the defect area is located.

2. The method according to claim 1, characterized in that, The step of determining the pipe center information based on the image of the pipe to be identified and the defect mask image includes: The defect mask image is positionally encoded to obtain two-dimensional encoded information; The two-dimensional encoded information is multiplied by the defect mask image to obtain the position encoded image; The location-encoded image is stitched together with the image of the pipe to be identified to obtain a stitched pipe image; The pipe stitched image is input into a pre-trained center prediction model to obtain the pipe center information.

3. The method according to claim 1, characterized in that, The determination strategy also includes: After any of the determination methods is executed, the pipeline defect location obtained by executing the determination method is verified based on the prior information corresponding to the executed determination method, wherein the prior information includes the pipeline defect type and the defect location information corresponding to the pipeline defect type.

4. The method according to claim 3, characterized in that, The strategy for determining the location of a pipeline defect based on the positional relationship between the pipeline center information and the defect rectangle includes: If the pipe center information is not located within the defect rectangle, the corresponding determination strategy includes sequentially executing the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method, and stopping the execution of the next determination method when any determination method obtains a pipe defect position that conforms to the prior information; If the pipe center information is located within the defect rectangle and the pipe center information is located within the defect area, the corresponding determination strategy includes sequentially executing the first long side clock position determination method and the second long side clock position determination method, and stopping the execution of the next determination method when either determination method obtains the pipe defect position that matches the prior information; If the pipe center information is located within the defect rectangle, and the pipe center information is not located within the defect area, the corresponding determination strategy includes sequentially executing the tangent clock position determination method and the long side clock position determination method, and stopping the execution of the next determination method when either determination method obtains a pipe defect position that conforms to the prior information.

5. The method according to claim 1, characterized in that, After determining the location of the pipeline defect based on the pipeline center information and the defect mask image, the method further includes: Determine the underlying circular image of the pipeline image to be identified; Based on the largest connected component in the basic circular image and the bounding rectangle of the largest connected component, the pipe intersection-union ratio is determined; If the pipeline crossover ratio meets the preset threshold range, then the pipeline is determined to be in a disconnected state.

6. A pipeline defect identification device, characterized in that, include: The pipeline image acquisition module is used to acquire the pipeline image to be identified and the defect mask image corresponding to the pipeline image to be identified; The pipeline center determination module is used to determine the pipeline center information based on the pipeline image to be identified and the defect mask image; The defect location determination module is used to determine the location of the pipeline defect based on the pipeline center information and the defect mask image. The defect location determination module includes: A defect rectangle determination unit is used to determine a defect rectangle based on the edge points of the defect region in the defect mask image. The defect location determination unit includes: a determination strategy determination subunit, used to determine a determination strategy for the location of the pipeline defect based on the positional relationship between the pipeline center information and the defect rectangle, and to determine the location of the pipeline defect based on the determination strategy, wherein the determination strategy includes at least one of the following determination methods: the hypotenuse clock position determination method, the long side clock position determination method, and the tangent clock position determination method; The method for determining the diagonal clock position is used to determine the slope of two sets of diagonals based on the pipe center information and the defect rectangle, and to determine the pipe defect location based on the diagonal with the largest slope difference; the method for determining the long side clock position is used to determine multiple center-border distances based on the pipe center information and the defect rectangle, and to determine the border endpoint corresponding to the largest center-border distance as the pipe defect location; the method for determining the tangent clock position is used to determine twelve time zones based on the pipe center information, and to determine the pipe defect location based on the time zone where the defect area is located.

7. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the pipeline defect identification method as described in any one of claims 1-5.

8. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the pipeline defect identification method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Pipeline three-dimensional modeling method based on drawing file and electronic equipment and device thereof

    CN113160385A

  • Pipeline defect detection method, system and equipment and computer readable storage medium

    CN114140625A