Pipeline detection method and device, electronic equipment and storage medium
By collecting and processing optical signal videos at both ends of the pipeline, and calculating the maximum bright connected domain area and the number of flashes, the problem of large pipeline continuity detection errors and low efficiency in the existing technology is solved, and more accurate and efficient pipeline continuity detection is achieved. Sex testing.
Patent Information
- Application Number
- CN202410802941.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The existing technology has large errors and low efficiency when detecting pipeline continuity, and requires more manual intervention.
By collecting the optical signal video emitted from the other end at one end of the pipeline to be detected, the maximum bright connected domain area of each frame of the optical signal image is calculated, and based on the positive and negative alternation of the maximum bright connected domain area difference of adjacent frame optical signal images The relationship between the number of flashes and the number of flashes of the light signal determines whether the pipeline is connected.
It improves the accuracy and efficiency of pipeline continuity detection, reduces manual intervention, and can detect longer distance pipelines.
Smart Images

Figure CN118623233A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart pipe networks, and in particular to a pipeline detection method, device, electronic equipment and storage medium. Background Art
[0002] The underground pipeline environment is complex and there are problems such as blockage, breakage, misconnection, and collapse. If the pipelines are not repaired in time, sewage overflow will cause regional pollution, and rainwater overflow will also cause problems such as waterlogging and land subsidence.
[0003] When repairing a pipeline, it is necessary to first confirm whether the connectivity of the pipeline is the same as the design drawing. The existing technology generally uses a periscope and CCTV (Close Circuit Television Inspection) to take pictures of the inside of the pipeline, and judges the continuity of the pipeline by whether there is blockage, breakage, etc. in the picture content. This method requires more manual intervention and the continuity detection of the pipeline is slow.
[0004] It can be seen that the existing technology has large errors and low efficiency when detecting pipeline continuity. Summary of the invention
[0005] In view of this, it is necessary to provide a pipeline detection method, device, electronic device and storage medium to solve the technical problems existing in the prior art of large errors and low efficiency when detecting pipeline continuity.
[0006] In order to solve the above technical problems, on the one hand, the present invention provides a pipeline detection method, comprising: Collecting, at a second port of the pipeline to be inspected, a video of a light signal emitted by a light source located at a first port of the pipeline to be inspected; Calculate the maximum bright connected domain area of each frame of the light signal image in the light 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal.
[0007] As a possible implementation manner of the present invention, in this implementation manner, calculating the maximum bright connected domain area of each frame of the light signal image in the light signal video includes: For each frame of the light signal image of the light signal video, grayscale processing is performed on the light signal image to obtain a grayscale value of each pixel in the light signal image; Binarization is performed on the grayscale value of each pixel in the light signal image, and the maximum bright connected domain area in the light signal image is determined based on the grayscale value of each pixel after the binarization.
[0008] As a possible implementation manner of the present invention, in this implementation manner, binarizing the grayscale value of each pixel in the light signal image, and determining the maximum bright connected domain area in the light signal image based on the grayscale value of each pixel after the binarization process, includes: Calculating a binary grayscale threshold of a pixel point in the light signal image; Determine pixels whose grayscale values are greater than the binary grayscale threshold as bright pixels; The area of the region with the most connected bright pixels in the light signal image is calculated.
[0009] As a possible implementation manner of the present invention, in this implementation manner, determining 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal includes: Sort the maximum bright connected domain areas based on the order of the light signal images in the light signal video to generate a first sequence; Calculate the difference between the area of each maximum bright connected domain and the area of the next adjacent maximum bright connected domain in the first sequence according to the order of the first sequence to generate a 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 light signal.
[0010] As a possible implementation manner of the present invention, in this implementation manner, determining 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 flashing times of the light 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 light signal is within a preset first preset difference range, it is determined that the pipeline to be detected is connected.
[0011] As a possible implementation manner of the present invention, in this implementation manner, 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 the preset number of data before and after two adjacent data with positive or negative changes, the positive or negative change of the two adjacent data is regarded as a valid positive or negative change; The number of effective positive and negative changes is counted.
[0012] As a possible implementation manner of the present invention, in this implementation manner, after calculating the binary grayscale threshold of the pixel points in the light signal image, the method includes: Calculating an average value and a variance value of the binary grayscale threshold of the optical signal image and the binary grayscale thresholds of other optical signal images in the optical signal video; Calculating a first difference between a binarized grayscale threshold of the light signal image and the average value, and a second difference between an absolute value of the first difference and the variance value; When the second difference is greater than a preset second preset difference, the light signal image is deleted from the light signal video.
[0013] On the other hand, the present invention also provides a pipeline detection device, comprising: A video acquisition module, used for acquiring, at a second port of the pipeline to be inspected, a video of an optical signal emitted by a light source located at a first port of the pipeline to be inspected; An area calculation module, used to calculate the maximum bright connected domain area of each frame of the light signal image in the light signal video; The judgment module is used to determine whether the pipeline to be detected is connected based on the relationship between the positive and negative alternation times of the difference in the maximum bright connected domain area of each adjacent frame light signal image and the flashing times of the light 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 is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the pipeline detection method described in any of the above implementations.
[0015] On the other hand, the present invention further provides a computer-readable storage medium for storing a computer-readable program or instruction, 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 pipeline detection method provided by the present invention collects a video of a light signal emitted by a light source located at the other end of the pipeline to be detected at one end of the pipeline to be detected, processes the video frame by frame, calculates the maximum bright connected domain area in each frame of the light signal image, and 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 domain areas of the adjacent frames of the light signal images and the number of flashes of the light signal, with less manual intervention, and can detect pipelines over a longer distance, and the detection of pipeline continuity is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the 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 work.
[0017] Figure 1 A schematic diagram of a pipeline detection method provided by an embodiment of the present invention; Figure 2 A diagram of an implementation scenario of a pipeline detection method provided by an embodiment of the present invention; Figure 3 A schematic flow chart of an implementation method of S102 provided in an embodiment of the present invention; Figure 4 A flowchart of an implementation method of S302 provided in an embodiment of the present invention; Figure 5 A schematic diagram of a flow chart of an implementation method of S103 provided in an embodiment of the present invention; Figure 6 A flowchart of a method for counting the number of effective positive and negative changes provided by an embodiment of the present invention; Figure 7 A flow chart of a method for eliminating abnormal data provided by an embodiment of the present invention; Figure 8 A schematic diagram of the structure of a pipeline detection device provided by an embodiment of the present invention; Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0019] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0020] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0021] The present invention provides a pipeline detection method, device, electronic equipment and storage medium, which are respectively described below.
[0022] Figure 1 A schematic flow chart of an embodiment of the pipeline detection method provided by the present invention is as follows: Figure 1 As shown, the pipeline detection method includes: S101, collecting a video of a light signal emitted by a light source located at a first port of the pipeline to be inspected at a second port of the pipeline to be inspected; S102, calculating the maximum bright connected domain area of each frame of the light signal image in the light signal video; S103, determining 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal.
[0023] The pipeline detection method provided in the embodiment of the present invention can be used to detect whether underground pipelines are connected. Figure 2 As shown, a possible implementation scenario diagram of the pipeline detection method is shown. A light source transmitter and a video acquisition device are placed at both ends of the pipeline to be detected. Optionally, the light source transmitter and the video acquisition device are installed in a pipeline detection robot. Furthermore, in a pipeline detection robot, a light source transmitter and a video acquisition device can be installed at the same time. A pipeline detection robot is placed at both ends of the pipeline to be detected. In this way, when the pipeline detection robot at one end of the pipeline to be detected is used as a light signal transmitting device, the pipeline detection robot at the other end of the pipeline to be detected can be used as a video acquisition device. Optionally, the pipeline detection robot is also equipped with a communication module for sending the collected video to a cloud server for processing.
[0024] In an embodiment of the present invention, after a light signal emitted by a light source transmitter in a pipeline inspection robot at one end of a pipeline to be inspected is reflected by the pipeline to be inspected, a 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 a light signal video; further, the light signal emitted by the light source transmitter is a breathing flashing light signal, the flashing mode is dark, slowly bright, and then slowly dark, the cycle time is 1 second, and 3 cycles are performed.
[0025] In an embodiment of the present invention, the optical video information collected by the video acquisition device is processed frame by frame, and the maximum bright connected domain area of each frame of the optical signal image is calculated, wherein the maximum bright connected domain area refers to the area of the largest visible light spot in a frame of the optical signal image. In practical applications, in the optical signal video collected by the video acquisition device, due to the influence of other factors such as the environment, there may be multiple visible light spots in each frame of the optical signal image. Generally, the light environment of the underground pipeline is not good. Therefore, the maximum visible light spot in the optical signal image can be used as the light spot of the optical signal emitted by the optical signal emission source after being reflected by the pipeline to be detected.
[0026] In an embodiment of the present invention, based on the time sequence of the light signal image in the light signal video, the difference in the maximum bright connected domain area of each adjacent frame of the light signal image is calculated respectively. Since the light signal emission source changes from dark to bright and then slowly changes to dark, according to the time sequence, the maximum bright connected domain area in the light signal image should first change from small to large and then to small. Therefore, the difference in the maximum bright connected domain area of each adjacent frame of the light signal image is calculated. When the light signal is at the brightest and darkest, the positive and negative of the difference will change. Based on the number of positive and negative changes, the number of flashes of the light signal collected by the video acquisition device can be determined. By comparing the number of flashes of the light signal collected by the video acquisition device with the number of flashes of the light signal itself, it can be determined whether the pipeline to be detected is connected.
[0027] The pipeline detection method provided by the present invention collects a video of a light signal emitted by a light source located at the other end of the pipeline to be detected at one end of the pipeline to be detected, processes the video frame by frame, calculates the maximum bright connected domain area in each frame of the light signal image, and 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 domain areas of the adjacent frames of the light signal images and the number of flashes of the light signal. The method requires less manual intervention, can detect pipelines at a longer distance, and is more accurate in detecting the continuity of the pipeline. As a possible implementation mode of the present invention, in this implementation mode, Figure 3 As shown, S102 includes: S301, for each frame of the light signal image of the light signal video, grayscale processing is performed on the light signal image to obtain the grayscale value of each pixel in the light signal image; S302, binarizing the gray value of each pixel in the light signal image, and determining the maximum bright connected domain area in the light signal image based on the gray value of each pixel after the binarization process.
[0028] In the embodiment of the present invention, when calculating the maximum bright connected domain area of each frame of the light signal image, it is necessary to first perform grayscale processing on the light signal image to obtain the grayscale value of each pixel in the light signal image. Specifically, the grayscale value can be calculated using formula (1): (1) Among them, i is the gray value of the pixel, R is the value of the R 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 grayscale value of each pixel, the grayscale value of each pixel in the light signal image is binarized, the grayscale value of the bright pixel is set to 255, the grayscale value of the dark pixel is set to 0, the area with the most connected pixels with a grayscale value of 255 is calculated, and the area of the area is calculated to obtain the maximum bright connected domain area of the light signal image.
[0030] As a possible implementation mode of the present invention, in this implementation mode, Figure 4 As shown, S302 includes: S401, calculating the binary grayscale threshold of the pixel points in the light signal image; S402, determining pixels whose grayscale values are greater than the binary grayscale threshold as bright pixels; S403, calculating the area of the region with the most connected bright pixels in the light signal image.
[0031] In the embodiment of the present invention, when binarizing the grayscale value of the pixel in the light signal image, the binarization grayscale threshold of the pixel in the light signal image may be calculated first, and the calculation may be performed using formulas (2) to (5): (2) (3) (4) (5) in, Gray value i The probability of occurrence, Gray value i The number of occurrences, N is the total number of pixels in the light signal image, is the binary grayscale threshold of the pixel in the light signal image, ranging from 0 to 255. The between-class variance is a measure of the difference between the light and dark classes. Is the gray value less than or equal to The cumulative probability of Is the gray value less than or equal to expectations, It is a global expectation.
[0032] In an embodiment of the present invention, the binary grayscale threshold refers to the critical grayscale value used to perform binary segmentation on pixel points. After the binary grayscale threshold of the light signal image is calculated based on the above formula, the grayscale value of the pixel points in the light signal image whose grayscale value is greater than the binary grayscale threshold is set to 255, and the grayscale value of the pixel points whose grayscale value is less than the binary grayscale threshold is set to 0. The pixel points with a grayscale value of 255 are bright pixels, and the pixel points with a grayscale value of 0 are dark pixels. The maximum bright connected domain area can be determined by counting the number of pixels in the area with the most connected bright pixels in the light signal image.
[0033] As a possible implementation mode of the present invention, in this implementation mode, Figure 5 As shown, S103 includes: S501, sorting the maximum bright connected domain areas based on the order of the light signal images in the light signal video to generate a first sequence; S502, calculating the difference between the area of each maximum bright connected domain and the area of the next adjacent maximum bright connected domain in the first sequence according to the order of the first sequence, to generate a second sequence; S503, determining 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 light signal.
[0034] In an embodiment of the present invention, when determining whether the pipeline to be detected is connected, the maximum bright connected domain area is first sorted based on the time sequence of the light signal image in the light signal video to obtain a first sequence, the data in the first sequence is the maximum bright connected domain area of each light signal image, and the difference between each maximum bright connected domain area and the next maximum bright connected domain area is calculated in sequence according to the order of the data in the first sequence, and a second sequence is generated based on the difference, and 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, and the relationship between the number of positive and negative changes and the number of flashes of the light signal is combined to determine whether the pipeline to be detected is connected. As in the aforementioned embodiment, based on the number of positive and negative changes, the number of flashes of the light signal collected by the video acquisition device can be determined, and the number of flashes of the light signal collected by the video acquisition device can be compared with the number of flashes of the light signal itself to determine whether the pipeline to be detected is connected.
[0035] The embodiment of the present invention determines the number of flickering of the light signal collected in the optical video signal by counting the number of positive and negative changes of the difference in the maximum bright connected domain area of adjacent frame light signal images in the light signal video collected by the video acquisition device, and determines whether the pipeline to be detected is connected based on the number of flickering and the number of flickering of the light signal itself, so as to accurately and quickly detect the pipeline.
[0036] As a possible implementation of the present invention, in this implementation, determining 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 light 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 light signal is within a preset first preset difference range, it is determined that the pipeline to be detected is connected.
[0037] In the embodiment of the present 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 flashing times of the light signal can be compared to determine whether the pipeline to be detected is connected. For example, the light signal flashes from dark to bright and then slowly to dark, the cycle time is 1 second, and 3 cycles are performed, then the number of flashing times of the light signal is 6 times. In order to eliminate the influence of environmental factors, when the number of positive and negative changes is 5, 6, and 7 times, it is determined that the pipeline to be detected is connected, otherwise, it is determined that the pipeline to be detected is not connected.
[0038] The embodiment of the present invention compares the relationship between the number of positive and negative changes of adjacent data in the second sequence and the number of flashing times of the light signal and reserves a misalignment error, thereby detecting the connectivity of the pipeline more accurately.
[0039] As a possible implementation mode of the present invention, in this implementation mode, Figure 6 As shown, when counting the number of positive and negative changes of adjacent data in the second sequence, the method includes: S601, when there is no positive or negative change between the preset number of data before and after two adjacent data with positive or negative changes, the positive or negative change of the two adjacent data is regarded as a valid positive or negative change; S602, counting the number of effective positive and negative changes.
[0040] In an embodiment of the present invention, for statistics of the number of positive and negative changes of adjacent data in the second sequence, only the number of valid positive and negative changes is counted. The valid positive and negative change means that there is no positive and negative change between a preset number of data before and after two adjacent data that have undergone positive and negative changes. For convenience of explanation, taking a specific embodiment as an example, the data in the second sequence are (1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1), then in the second sequence, a positive and negative change occurs between the third and fourth data, a positive and negative change occurs between the fifth and sixth data, and a positive and negative change occurs between the twelfth and thirteenth data, then the number of positive and negative changes of the data in the second sequence is 3. When counting the valid positive and negative changes, it is necessary to consider that the three data before and after the two data that have undergone positive and negative changes have not undergone positive and negative changes, then the positive and negative change between the third and fourth data is an invalid positive and negative change and does not need to be counted. Therefore, the number of valid positive and negative changes between adjacent data in the second sequence is 2.
[0041] The embodiment of the present invention can reduce the influence of environmental factors on the continuity judgment of the pipeline by counting the number of valid changes between adjacent data in the second sequence.
[0042] As a possible implementation mode of the present invention, in this implementation mode, Figure 7 As shown, after calculating the binary grayscale threshold of the pixel points in the light signal image, the method includes: S701, calculating the average value and variance value of the binary grayscale threshold of the optical signal image and the binary grayscale thresholds of other optical signal images in the optical signal video; S702, calculating a first difference between a binarized grayscale threshold and an average value, and a second difference between an absolute value of the first difference and a variance value of the optical signal image; S703: When the second difference is greater than a preset second preset difference, delete the light signal image from the light signal video.
[0043] In the embodiment of the present invention, in order to further reduce the influence of environmental factors and video acquisition on the accuracy of the method of the present invention, after calculating the binary grayscale threshold of the pixel point in the light signal image, the light signal video is preprocessed based on the relationship between the binary grayscale threshold of each frame of the light signal image and other grayscale thresholds, specifically including: using formula (6) to calculate the average value of the binary grayscale threshold of all light signal images in the light signal video, and using formula (7) to calculate the variance of the binary grayscale threshold of all light signal images in the light signal video: (6) (7) in, is the average value of the binary grayscale threshold of all light signal images in the light signal video, n is the number of light signal images in the light signal video, j The first j Frame optical signal image, The first j The binary grayscale threshold of the frame light signal image, is the variance of the binary grayscale thresholds of all light signal images in the light signal video.
[0044] When the binarization grayscale threshold of the j-th frame of the optical signal image in the optical signal video satisfies formula (8), (8) Indicates that j The frame optical signal image is abnormal, delete the frame from the optical signal video. j Frame light signal image, without processing the frame data.
[0045] The embodiment of the present invention processes the binary grayscale threshold of each light signal image in the light signal video, identifies abnormal light signal images in the light signal video, and increases the accuracy of pipeline continuity judgment.
[0046] In order to better implement the pipeline detection method in the embodiment of the present invention, based on the pipeline detection method, correspondingly, Figure 8 As shown, the embodiment of the present invention further provides a pipeline detection device, and the pipeline detection device 800 includes: The video acquisition module 801 is used to acquire, at the second port of the pipeline to be inspected, a video of a light signal emitted by a light source at the first port of the pipeline to be inspected; An area calculation module 802 is used to calculate the maximum bright connected domain area of each frame of the light signal image in the light signal video; The judgment module 803 is used to determine whether the pipeline to be detected is connected based on the relationship between the positive and negative alternation times of the difference in the maximum bright connected domain area of each adjacent frame light signal image and the flashing times of the light signal.
[0047] The pipeline detection device 800 provided in the above embodiment can implement the technical solution described in the above pipeline detection method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above pipeline detection method embodiment, which will not be repeated here.
[0048] The pipeline detection device provided by the present invention collects a video of a light signal emitted by a light source located at the other end of the pipeline to be detected at one end of the pipeline to be detected, processes the video frame by frame, calculates the maximum bright connected domain area in each frame of the light signal image, and 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 domain areas of the adjacent frames of the light signal images and the number of flashes of the light signal. The device requires less manual intervention, can detect pipelines at a longer distance, and is more accurate in detecting the continuity of the pipeline. like Fig. 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. Fig. 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, the processor 901 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 902, such as the pipeline detection method of the present invention.
[0050] In some embodiments, the processor 901 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 901 may be local or remote. In some embodiments, the processor 901 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0051] In some embodiments, the memory 902 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. In other embodiments, the memory 902 may also be an external storage device of the electronic device 900, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 900.
[0052] Furthermore, the memory 902 may include both an internal storage unit of the electronic device 900 and an external storage device. The memory 902 is used to store application software installed in the electronic device 900 and various data.
[0053] In some embodiments, the display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 903 is used to display information of the electronic device 900 and to display a visual user interface. The components 901-903 of the electronic device 900 communicate with each other through a system bus.
[0054] In one embodiment, when the processor 901 executes the pipeline detection program in the memory 902, the following steps may be implemented: Collecting a video of a light signal emitted by a light source located at a first port of the pipeline to be inspected at a second port of the pipeline to be inspected; Calculate the maximum bright connected domain area of each frame of the light signal image in the light 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal.
[0055] It should be understood that: when the processor 901 executes the pipeline detection program in the memory 902, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0056] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 900 mentioned, and the electronic device 900 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may 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 present invention, the electronic device 900 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0057] Accordingly, an embodiment of the present invention further provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions of the pipeline detection method provided in the above-mentioned method embodiments can be implemented.
[0058] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0059] The pipeline detection method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A pipeline detection method, It is characterized in that include: Collecting, at a second port of the pipeline to be inspected, a video of a light signal emitted by a light source located at a first port of the pipeline to be inspected; Calculate the maximum bright connected domain area of each frame of the light signal image in the light 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal.
2. The pipeline detection method according to claim 1, It is characterized in that The calculating the maximum bright connected domain area of each frame of the light signal image in the light signal video includes: For each frame of the light signal image of the light signal video, grayscale processing is performed on the light signal image to obtain a grayscale value of each pixel in the light signal image; Binarization is performed on the grayscale value of each pixel in the light signal image, and the maximum bright connected domain area in the light signal image is determined based on the grayscale value of each pixel after the binarization.
3. The pipeline detection method according to claim 2, It is characterized in that The binarization process is performed on the grayscale value of each pixel in the light signal image, and the maximum bright connected domain area in the light signal image is determined based on the grayscale value of each pixel after the binarization process, including: Calculating a binary grayscale threshold of a pixel in the optical signal image; Determine pixels whose grayscale values are greater than the binary grayscale threshold as bright pixels; The area of the region with the most connected bright pixels in the light signal image is calculated.
4. The pipeline detection method according to claim 1, It is characterized in that The determining 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 area of the maximum bright connected domain of each adjacent frame light signal image and the number of flashes of the light signal includes: Sort the maximum bright connected domain areas based on the order of the light signal images in the light signal video to generate a first sequence; Calculate the difference between the area of each maximum bright connected domain and the area of the next adjacent maximum bright connected domain in the first sequence according to the order of the first sequence to generate a 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 light signal.
5. The pipeline detection method according to claim 4, It is characterized in that The determining 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 light 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 light signal is within a preset first preset difference range, it is determined that the pipeline to be detected is connected.
6. The pipeline detection method according to claim 5, It is characterized in that 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 the preset number of data before and after two adjacent data with positive or negative changes, the positive or negative change of the two adjacent data is regarded as a valid positive or negative change; The number of effective positive and negative changes is counted.
7. The pipeline detection method according to claim 3, It is characterized in that After calculating the binary grayscale threshold of the pixel points in the light signal image, the method includes: Calculating the average value and variance value of the binary grayscale threshold of the optical signal image and the binary grayscale thresholds of other optical signal images in the optical signal video; Calculating a first difference between a binarized grayscale threshold of the light signal image and the average value, and a second difference between an absolute value of the first difference and the variance value; When the second difference is greater than a preset second preset difference, the light signal image is deleted from the light signal video.
8. A pipeline detection device, It is characterized in that include: A video acquisition module, used for acquiring, at a second port of the pipeline to be inspected, a video of an optical signal emitted by a light source located at a first port of the pipeline to be inspected; An area calculation module, used to calculate the maximum bright connected domain area of each frame of the light signal image in the light signal video; The judgment module is used to determine whether the pipeline to be detected is connected based on the relationship between the positive and negative alternation times of the difference in the maximum bright connected domain area of each adjacent frame light signal image and the flashing times of the light signal.
9. An electronic device, It is characterized in that comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the pipeline detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the pipeline detection method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method, device and system for searching stripe set
CN107111882A
Pipeline detecting method and device and storage medium
CN107795854A
GIS pipeline defect online detection device and method
CN110849936A
Line scanning laser bubble detection method and system based on visual perception
CN112184710A
Novel pipeline connectivity inspection method
CN112797321A
