Pipeline detection method and device, electronic equipment and storage medium

CN118623233BActive Publication Date: 2026-09-25WUHAN DAOXIAOFEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410802941.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2026-09-25
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

[0005]有鉴于此,有必要提供一种管道检测方法、装置、电子设备及存储介质,用以解决现有技术中存在的在检测管道通断性时存在较大误差,且效率较低的技术问题

Benefits of technology

[0016]本发明的有益效果是:本发明提供的管道检测方法,通过在待检测管道的一端采集位于待检测管道的另一端的光源发出的光信号的视频,对该视频进行逐帧处理,计算每一帧光信号图像中的最大亮连通域面积,并基于该相邻帧光信号图像的最大亮连通域面积的差值的正负交替次数与光信号的闪烁次数的关系确定所述待检测管道是否连通,人工干预较少,且可以检测较长距离的管道,对管道通断的检测更加准确。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118623233B_ABST
    Figure CN118623233B_ABST
Patent Text Reader

Abstract

The application provides a pipeline detection method and device, electronic equipment and a storage medium, and belongs to the technical field of intelligent pipeline networks. The method comprises the following steps: collecting, at a second port of a to-be-detected pipeline, a light signal video emitted by a light source located at a first port of the to-be-detected pipeline; calculating the maximum bright connected domain area of each frame of light signal image in the light signal video; and determining whether the to-be-detected pipeline is connected based on the relationship between the positive and negative alternating times of the difference value of the maximum bright connected domain area of each adjacent frame of light signal image and the flicker times of the light signal. The application has less human intervention, can detect a pipeline with a longer distance, and is more accurate in detecting the connection of the pipeline.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart pipeline technology, specifically to a pipeline detection method, device, electronic equipment, and storage medium. Background Technology

[0002] The underground pipeline environment is complex and prone to problems such as blockages, breaks, misconnections, and collapses. If the pipelines are not repaired in a timely manner, sewage overflows will cause regional pollution, and rainwater overflows will cause problems such as flooding and land subsidence.

[0003] When repairing pipelines, it is necessary to first confirm whether the pipeline's connectivity matches the design drawings. Current technology generally involves using a periscope and CCTV (Closed Circuit Television Inspection) to take pictures of the inside of the pipeline and judging the pipeline's continuity by checking for blockages, breaks, or other issues in the images. This method requires a lot of manual intervention and is slow in detecting pipeline continuity.

[0004] It is evident that existing technologies have significant errors and low efficiency when detecting pipeline continuity. Summary of the Invention

[0005] In view of this, it is necessary to provide a pipeline inspection method, device, electronic equipment and storage medium to solve the technical problems of large errors and low efficiency in the existing technology when detecting pipeline continuity.

[0006] To address the aforementioned technical problems, this invention provides a pipeline inspection method, comprising: Video of the light signal emitted by the light source located at the first port of the pipe under test is acquired at the second port of the pipe under test; Calculate the area of ​​the maximum bright connected component in each frame of the optical signal image in the optical signal video; Whether the pipeline to be detected is connected is determined based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal.

[0007] In one possible embodiment of the present invention, the step of calculating the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video includes: For each frame of the optical signal video, the optical signal image is processed into grayscale to obtain the grayscale value of each pixel in the optical signal image; The grayscale value of each pixel in the optical signal image is binarized, and the area of ​​the largest bright connected region in the optical signal image is determined based on the grayscale value of each pixel after binarization.

[0008] In one possible implementation of the present invention, the step of binarizing the grayscale value of each pixel in the optical signal image and determining the area of ​​the maximum bright connected region in the optical signal image based on the binarized grayscale value of each pixel includes: Calculate the binarized grayscale threshold of the pixels in the optical signal image; Pixels with gray values ​​greater than the binarized gray value threshold are identified as bright pixels; Calculate the area of ​​the region with the most connected bright pixels in the optical signal image.

[0009] In one possible implementation of the present invention, the determination of whether the pipeline to be detected is connected based on the relationship between the number of alternating positive and negative values ​​of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal includes: The areas of the largest bright connected components are sorted according to the order of the optical signal images in the optical signal video to generate a first sequence; Following the order of the first sequence, calculate the difference between the area of ​​each of the maximum bright connected regions and the area of ​​the next adjacent maximum bright connected region in the first sequence to generate the second sequence; Whether the pipeline to be detected is connected is determined based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal.

[0010] In one possible implementation of the present invention, determining whether the pipe to be detected is connected based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal includes: When the difference between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal is within a preset first preset difference range, the pipeline to be detected is determined to be connected.

[0011] In one possible implementation of the present invention, when counting the number of positive and negative changes of adjacent data in the second sequence, the method includes: When there is no positive or negative change between two adjacent data points that have undergone a positive or negative change and a predetermined number of data points before and after them, the positive or negative change between the two adjacent data points is considered a valid positive or negative change. Count the number of valid positive and negative changes.

[0012] In one possible embodiment of the present invention, after calculating the binarized grayscale threshold of the pixels in the optical signal image, the method includes: Calculate the average and variance of the binarized grayscale threshold of the optical signal image and the binarized grayscale threshold of other optical signal images in the optical signal video; Calculate the first difference between the binarized grayscale threshold of the optical signal image and the average value, and the second difference between the absolute value of the first difference and the variance value; When the second difference is greater than a preset second difference, the optical signal image is deleted from the optical signal video.

[0013] On the other hand, the present invention also provides a pipeline inspection device, comprising: The video acquisition module is used to acquire the video signal of light emitted by the light source located at the first port of the pipe to be tested at the second port of the pipe to be tested; The area calculation module is used to calculate the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video. The judgment module is used to determine whether the pipeline to be detected is connected based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal.

[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the pipeline detection method described in any of the above implementations.

[0015] On the other hand, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instructions, which, when executed by a processor, can implement the steps of the pipeline detection method described in any of the above implementations.

[0016] The beneficial effects of the present invention are as follows: The pipe detection method provided by the present invention acquires a video of the light signal emitted by a light source at the other end of the pipe to be detected at one end of the pipe, processes the video frame by frame, calculates the maximum bright connected region area in each frame of the light signal image, and determines whether the pipe to be detected is connected based on the relationship between the number of positive and negative alternations of the difference between the maximum bright connected region areas of adjacent frames of the light signal image and the number of flashes of the light signal. It requires less manual intervention, can detect pipes over longer distances, and is more accurate in detecting pipe continuity. Attached Figure Description To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic flowchart of a pipeline inspection method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating an implementation scenario of a pipeline inspection method provided in an embodiment of the present invention. Figure 3 A flowchart illustrating one implementation of S102 provided in this embodiment of the invention; Figure 4 A flowchart illustrating one implementation of S302 provided in this embodiment of the invention; Figure 5 A flowchart illustrating one implementation of S103 provided in this embodiment of the invention; Figure 6 A flowchart illustrating a method for counting the number of valid positive and negative changes provided in an embodiment of the present invention; Figure 7 A flowchart illustrating an abnormal data removal method provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a pipeline inspection device provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0018] 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 a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0019] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0021] This invention provides a pipeline inspection method, apparatus, electronic device, and storage medium, which are described below.

[0022] Figure 1 This is a schematic flowchart of an embodiment of the pipeline inspection method provided by the present invention, as shown below. Figure 1 As shown, pipeline inspection methods include: S101, Acquire the video signal of light emitted by the light source located at the first port of the pipe under test at the second port of the pipe under test; S102, calculate the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video; S103, determine whether the pipe to be detected is connected based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal.

[0023] The pipeline inspection method provided in this invention can be used to detect whether underground pipelines are connected, such as... Figure 2 The diagram illustrates a possible implementation scenario of this pipeline inspection method. A light source emitter and a video acquisition device are placed at both ends of the pipeline to be inspected. Optionally, the light source emitter and video acquisition device are installed within a pipeline inspection robot. Further, a single pipeline inspection robot can simultaneously house both the light source emitter and the video acquisition device, with one robot placed at each end of the pipeline. In this way, when the robot at one end of the pipeline acts as a light signal transmitter, the robot at the other end can be used as a video acquisition device. Optionally, the pipeline inspection robot is also equipped with a communication module for sending the acquired video to a cloud server for processing.

[0024] In this embodiment of the invention, the light signal emitted by the light source emitter at one end of the pipeline to be inspected in the pipeline inspection robot is reflected by the pipeline to be inspected, and the video acquisition device in another pipeline inspection robot performs video acquisition on the reflected light signal at the other end of the pipeline to be inspected to obtain the light signal video; furthermore, the light signal emitted by the light source emitter is a breathing flashing light signal, the flashing mode is dark slowly bright and then slowly dark, the period time is 1 second, and it is performed for 3 cycles.

[0025] In this embodiment of the invention, the optical video information acquired by the video acquisition device is processed frame by frame to calculate the maximum bright connected region area of ​​each frame of optical signal image. The maximum bright connected region area refers to the area of ​​the largest visible spot in a frame of optical signal image. In practical applications, due to the influence of environmental and other factors, there may be multiple visible spots in each frame of optical signal image acquired by the video acquisition device. Generally, the lighting environment of underground pipes is poor. Therefore, the largest visible spot in the optical signal image can be used as the spot of the light signal emitted by the light source after reflection by the pipe to be detected.

[0026] In this embodiment of the invention, based on the temporal order of the optical signal images in the optical signal video, the difference in the maximum bright connected region area of ​​each adjacent frame of the optical signal images is calculated. Since the optical signal emission source gradually brightens and then gradually dims, the maximum bright connected region area in the optical signal image should first increase and then decrease according to the temporal order. Therefore, the sign of the difference in the maximum bright connected region area of ​​each adjacent frame of the optical signal images changes when the optical signal is at its brightest and darkest. Based on the number of times the sign changes, the number of flashes of the optical signal acquired by the video acquisition device can be determined. By comparing the number of flashes of the optical signal acquired by the video acquisition device with the number of flashes of the optical signal itself, it can be determined whether the pipeline to be detected is connected.

[0027] The pipeline detection method provided by this invention acquires a video of the light signal emitted by a light source at the other end of the pipeline from one end of the pipeline to be detected. The video is processed frame by frame to calculate the maximum bright connected region area in each frame of the light signal image. The method determines whether the pipeline to be detected is connected based on the relationship between the number of positive and negative alternations of the difference between the maximum bright connected region areas of adjacent frames and the number of flashes of the light signal. This method requires less manual intervention, can detect pipelines over longer distances, and is more accurate in detecting pipeline continuity. As one possible embodiment of the present invention, in this embodiment, such as Figure 3 As shown, S102 includes: S301, for each frame of the optical signal video, perform grayscale processing on the optical signal image to obtain the grayscale value of each pixel in the optical signal image; S302, perform binarization processing on the gray value of each pixel in the optical signal image, and determine the area of ​​the maximum bright connected region in the optical signal image based on the gray value of each pixel after binarization processing.

[0028] In this embodiment of the invention, when calculating the maximum bright connected region area of ​​each frame of optical signal image, it is first necessary to perform grayscale processing on the optical signal image to obtain the grayscale value of each pixel in the optical signal image. Specifically, the grayscale value can be calculated using formula (1): (1) Where i is the gray value of the pixel, R is the value of the red component of the pixel, G is the value of the green component of the pixel, and B is the value of the blue component of the pixel.

[0029] Furthermore, after calculating the gray value of each pixel, the gray value of each pixel in the optical signal image is binarized, the gray value of bright pixels is set to 255, and the gray value of dark pixels is set to 0. The region with the most connected pixels and a gray value of 255 is calculated, and the area of ​​this region is calculated to obtain the maximum bright connected region area of ​​the optical signal image.

[0030] As one possible embodiment of the present invention, in this embodiment, such as Figure 4 As shown, S302 includes: S401, calculate the binarization grayscale threshold of pixels in the optical signal image; S402, determine pixels with gray values ​​greater than the binarized gray value threshold as bright pixels; S403 calculates the area of ​​the region with the most connected bright pixels in the optical signal image.

[0031] In this embodiment of the invention, when binarizing the gray values ​​of pixels in an optical signal image, the binarization gray threshold of the pixels in the optical signal image can be calculated first, and can be calculated using formulas (2)-(5): (2) (3) (4) (5) in, grayscale value i The probability of occurrence grayscale value i Number of times it appears N This represents the total number of pixels in the optical signal image. This is the binarization grayscale threshold for pixels in the optical signal image, ranging from 0 to 255. It is the inter-class variance, a measure of the difference between the light and dark classes. Grayscale value is less than or equal to The cumulative probability, Grayscale value is less than or equal to Expectations It is the global expectation.

[0032] In this embodiment of the invention, the binarization grayscale threshold refers to the critical grayscale value used for binarization segmentation of pixels. After calculating the binarization grayscale threshold of the optical signal image based on the above formula, the grayscale values ​​of pixels in the optical signal image with grayscale values ​​greater than the binarization grayscale threshold are set to 255, and the grayscale values ​​of pixels with grayscale values ​​less than the binarization grayscale threshold are set to 0. Pixels with a grayscale value of 255 are bright pixels, and pixels with a grayscale value of 0 are dark pixels. The maximum bright connected region area can be determined by counting the number of pixels in the region with the most connected bright pixels in the optical signal image.

[0033] As one possible embodiment of the present invention, in this embodiment, such as Figure 5 As shown, S103 includes: S501, Sort the areas of the largest bright connected components based on the order of the optical signal images in the optical signal video to generate the first sequence; S502, following the order of the first sequence, calculate the difference between the area of ​​each maximum bright connected region and the area of ​​the next adjacent maximum bright connected region in the first sequence, and generate the second sequence; S503, determine whether the pipe to be detected is connected based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal.

[0034] In this embodiment of the invention, when determining whether the pipe to be detected is connected, the areas of the largest bright connected regions are first sorted according to the temporal order of the optical signal images in the optical signal video to obtain a first sequence. The data in the first sequence are the areas of the largest bright connected regions of each optical signal image. According to the chronological order of the data in the first sequence, the difference between each largest bright connected region area and the next largest bright connected region area is calculated sequentially, and a second sequence is generated based on the difference. Then, based on the positive and negative change relationship between the data in the second sequence, the number of positive and negative changes in the data in the second sequence is determined. Combining the relationship between the number of positive and negative changes and the number of flashes of the optical signal, the connection of the pipe to be detected is determined. As in the aforementioned embodiment, based on the number of positive and negative changes, the number of flashes of the optical signal acquired by the video acquisition device can be determined. By comparing the number of flashes of the optical signal acquired by the video acquisition device with the number of flashes of the optical signal itself, the connection of the pipe to be detected can be determined.

[0035] This invention determines the number of flashes of the acquired optical signal in the optical video signal by counting the number of positive and negative changes in the difference of the maximum bright connected region area of ​​adjacent frames of optical signal images in the video acquired by the video acquisition device. Based on this number of flashes and the number of flashes of the optical signal itself, it determines whether the pipe to be detected is connected, which can accurately and quickly detect the pipe.

[0036] In one possible implementation of the present invention, determining whether the pipe to be detected is connected based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal includes: When the difference between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal is within a preset first preset difference range, the pipeline to be detected is determined to be connected.

[0037] In this embodiment of the invention, after determining the number of positive and negative changes of adjacent data in the second sequence, the relationship between the number of positive and negative changes and the number of flashes of the light signal can be compared to determine whether the pipeline to be detected is connected. For example, if the light signal flashes by slowly brightening and then slowly dimming from dark, with a period of 1 second and 3 cycles, then the number of flashes of the light signal is 6. To eliminate the influence of environmental factors, when the number of positive and negative changes is 5, 6, or 7, the pipeline to be detected is determined to be connected; otherwise, the pipeline to be detected is determined to be disconnected.

[0038] This invention provides a more accurate method for detecting pipeline connectivity by comparing the number of positive and negative changes in adjacent data in the second sequence with the number of flashes of the optical signal and by allowing for misalignment errors.

[0039] As one possible embodiment of the present invention, in this embodiment, such as Figure 6 As shown, the method for counting the number of positive and negative changes between adjacent data in the second sequence includes: S601, when there is no positive or negative change between a preset number of data points before and after two adjacent data points that have undergone positive or negative changes, the positive or negative change between the two adjacent data points is taken as a valid positive or negative change. S602, count the number of valid positive and negative changes.

[0040] In this embodiment of the invention, the counting of positive and negative changes between adjacent data in the second sequence only counts the number of valid positive and negative changes. Valid positive and negative changes refer to a situation where there is no positive or negative change between a predetermined number of adjacent data points before and after two adjacent data points that have undergone positive and negative changes. For ease of explanation, a specific embodiment is used as an example. The data in the second sequence is (1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1). In this second sequence, there is a positive and negative change between the 3rd and 4th data points, a positive and negative change between the 5th and 6th data points, and a positive and negative change between the 12th and 13th data points. Therefore, the number of positive and negative changes between the data in this second sequence is 3. When counting valid positive and negative changes, it is necessary to consider that there is no positive and negative change between the three data points before and after two adjacent data points that have undergone positive and negative changes. Therefore, the positive and negative change between the 3rd and 4th data points is invalid and does not need to be counted. Thus, the number of valid positive and negative changes between adjacent data in this second sequence is 2.

[0041] This invention reduces the impact of environmental factors on pipeline connectivity determination by statistically analyzing the number of effective changes between adjacent data in the second sequence.

[0042] As one possible embodiment of the present invention, in this embodiment, such as Figure 7 As shown, after calculating the binarized grayscale threshold of pixels in an optical signal image, the method includes: S701, calculate the average and variance of the binarized grayscale threshold of the optical signal image and the binarized grayscale threshold of other optical signal images in the optical signal video; S702, calculate the first difference between the binarized grayscale threshold and the average value of the optical signal image, and the second difference between the absolute value of the first difference and the variance value; S703, when the second difference is greater than the preset second difference, delete the optical signal image in the optical signal video.

[0043] In this embodiment of the invention, in order to further reduce the impact of environmental factors and video acquisition on the accuracy of the method, after calculating the binarized grayscale threshold of pixels in the optical signal image, the optical signal video is preprocessed based on the relationship between the binarized grayscale threshold of each frame of the optical signal image and other grayscale thresholds. Specifically, this includes calculating the average value of the binarized grayscale threshold of all optical signal images in the optical signal video using formula (6), and calculating the variance of the binarized grayscale threshold of all optical signal images in the optical signal video using formula (7). (6) (7) in, This represents the average of the binarized grayscale thresholds for all optical signal images in the optical signal video. n This represents the number of optical signal images in the optical signal video. j The first in the optical signal video j Frame optical signal image, The first in the optical signal video j Binarization grayscale threshold of frame optical signal image This is the variance of the binarized grayscale threshold of all optical signal images in the optical signal video.

[0044] When the binarized grayscale threshold of the j-th frame of the optical signal image in the optical signal video satisfies formula (8), (8) Indicates the first j The frame of the optical signal image is abnormal; this frame should be removed from the optical signal video. j The frame of the optical signal image is not processed.

[0045] This invention improves the accuracy of pipeline continuity assessment by processing the binarized grayscale thresholds of each optical signal image in an optical signal video.

[0046] To better implement the pipeline inspection method in this invention embodiment, based on the pipeline inspection method, correspondingly, as follows: Figure 8 As shown, this embodiment of the invention also provides a pipeline inspection device, the pipeline inspection device 800 comprising: The video acquisition module 801 is used to acquire the video signal of light emitted by the light source located at the first port of the pipe to be tested at the second port of the pipe to be tested; The area calculation module 802 is used to calculate the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video. The judgment module 803 is used to determine whether the pipeline to be detected is connected based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal.

[0047] The pipeline inspection device 800 provided in the above embodiments can realize the technical solutions described in the above pipeline inspection method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above pipeline inspection method embodiments, and will not be repeated here.

[0048] The pipeline inspection device provided by this invention acquires a video of the light signal emitted by a light source at the other end of the pipeline from one end of the pipeline to be inspected. The video is processed frame by frame to calculate the maximum bright connected region area in each frame of the light signal image. Based on the relationship between the number of positive and negative alternations of the difference between the maximum bright connected region areas of adjacent frames and the number of flashes of the light signal, the device determines whether the pipeline to be inspected is connected. This method requires less manual intervention, can inspect pipelines over longer distances, and is more accurate in detecting pipeline continuity. like Figure 9 As shown, the present invention also provides an electronic device 900. The electronic device 900 includes a processor 901, a memory 902, and a display 903. Figure 9 Only some components of the electronic device 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0049] In some embodiments, processor 901 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 902 or process data, such as the pipeline detection method of the present invention.

[0050] In some embodiments, processor 901 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 901 may be local or remote. In some embodiments, processor 901 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, internal cloud, multi-cloud, etc., or any combination thereof.

[0051] In some embodiments, memory 902 may be an internal storage unit of electronic device 900, such as a hard disk or memory of electronic device 900. In other embodiments, memory 902 may also be an external storage device of electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 900.

[0052] Furthermore, the memory 902 may include both internal storage units of the electronic device 900 and external storage devices. The memory 902 is used to store application software and various types of data installed on the electronic device 900.

[0053] In some embodiments, display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 903 is used to display information from electronic device 900 and to display a visual user interface. Components 901-903 of electronic device 900 communicate with each other via a system bus.

[0054] In one embodiment, when processor 901 executes the pipe detection program in memory 902, the following steps can be implemented: The video signal of light emitted by the light source located at the first port of the pipe under test is acquired at the second port of the pipe under test; Calculate the area of ​​the maximum bright connected component in each frame of the optical signal video; The connection between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal is used to determine whether the pipe to be detected is connected.

[0055] It should be understood that when the processor 901 executes the pipeline detection program in the memory 902, in addition to the functions mentioned above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.

[0056] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 900 mentioned. Electronic device 900 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 900 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0057] Accordingly, embodiments of the present invention also provide a computer-readable storage medium for storing a computer-readable program or instruction. When the program or instruction is executed by a processor, it can implement the steps or functions of the pipeline detection method provided in the above-described method embodiments.

[0058] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0059] The pipeline inspection method, apparatus, electronic equipment, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A pipeline inspection method, characterized in that, include: Video of the light signal emitted by the light source located at the first port of the pipe under test is acquired at the second port of the pipe under test; Calculate the area of ​​the maximum bright connected component in each frame of the optical signal image in the optical signal video; Whether the pipe to be detected is connected is determined based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal. The calculation of the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video includes: For each frame of the optical signal video, the optical signal image is processed into grayscale to obtain the grayscale value of each pixel in the optical signal image; The grayscale value of each pixel in the optical signal image is binarized, and the area of ​​the largest bright connected region in the optical signal image is determined based on the grayscale value of each pixel after binarization. The step of binarizing the grayscale value of each pixel in the optical signal image, and determining the area of ​​the largest bright connected region in the optical signal image based on the binarized grayscale value of each pixel, includes: Calculate the binarized grayscale threshold of the pixels in the optical signal image; Pixels with gray values ​​greater than the binarized gray value threshold are identified as bright pixels; Calculate the area of ​​the region with the most connected bright pixels in the optical signal image; The method of determining whether the pipeline to be detected is connected based on the relationship between the number of alternating positive and negative values ​​of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal includes: The areas of the largest bright connected components are sorted according to the order of the optical signal images in the optical signal video to generate a first sequence; Following the order of the first sequence, calculate the difference between the area of ​​each of the maximum bright connected regions and the area of ​​the next adjacent maximum bright connected region in the first sequence to generate the second sequence; Whether the pipe to be detected is connected is determined based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal; The determination of whether the pipeline to be detected is connected based on the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal includes: When the difference between the number of positive and negative changes of adjacent data in the second sequence and the number of flashes of the optical signal is within a preset first preset difference range, the pipeline to be detected is determined to be connected.

2. The pipeline inspection method according to claim 1, characterized in that, When counting the number of positive and negative changes between adjacent data in the second sequence, the method includes: When there is no positive or negative change between two adjacent data points that have undergone a positive or negative change and a predetermined number of data points before and after them, the positive or negative change between the two adjacent data points is considered a valid positive or negative change. Count the number of valid positive and negative changes.

3. The pipeline inspection method according to claim 1, characterized in that, After calculating the binarized grayscale threshold of pixels in the optical signal image, the method includes: Calculate the average and variance of the binarized grayscale threshold of the optical signal image and the binarized grayscale threshold of other optical signal images in the optical signal video; Calculate the first difference between the binarized grayscale threshold of the optical signal image and the average value, and the second difference between the absolute value of the first difference and the variance value; When the second difference is greater than a preset second difference, the optical signal image is deleted from the optical signal video.

4. A pipeline inspection device, applicable to the pipeline inspection method according to any one of claims 1 to 3, characterized in that, include: The video acquisition module is used to acquire the video signal of light emitted by the light source located at the first port of the pipe to be tested at the second port of the pipe to be tested; The area calculation module is used to calculate the maximum bright connected region area of ​​each frame of the optical signal image in the optical signal video. The judgment module is used to determine whether the pipeline to be detected is connected based on the relationship between the number of positive and negative alternations of the difference in the maximum bright connected region area of ​​each adjacent frame of optical signal image and the number of flashes of the optical signal.

5. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps of the pipeline inspection method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the pipeline inspection method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method, device and system for searching stripe set

    CN107111882A

  • Pipeline detecting method and device and storage medium

    CN107795854A