Oil pipe leakage detection method and related device, camera device and storage medium
By comparing images captured at pipeline patrol points with background images and combining multiple detection dimensions with adaptive weighting based on light, the convenience and accuracy issues of pipeline leak detection are solved, achieving efficient leak identification and type analysis.
Patent Information
- Application Number
- CN202211544965.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-12-02
AI Technical Summary
Existing methods and devices for detecting oil leaks in pipelines are complex to install, inconvenient to maintain and replace, and fail to improve the convenience and accuracy of detection.
By comparing images captured by cameras at cruise points with background images, the difference areas are extracted. Multiple detection dimensions (such as color and shape) are used to detect the image under test. The oil leak result is determined based on the detection score. The detection accuracy is improved by combining adaptive weighting of light and video analysis.
It improves the convenience and accuracy of oil pipeline leak detection, reduces missed and false detections, enables timely identification of leak types and takes corresponding measures to reduce economic losses.
Smart Images

Figure CN116109566B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a kind of oil pipe oil leakage detection method and related device, camera device and storage medium. BACKGROUND
[0002] Oil pipeline is used to transport oil, and oil leakage of oil pipe can cause economic loss, environmental pollution and fire.
[0003] Existing oil pipe oil leakage detection usually needs to install devices such as float ball device, oil chromatographic monitoring device, etc. inside the oil pipe, and the installation and subsequent maintenance and replacement are relatively complex.
[0004] Therefore, how to improve the convenience of oil pipe oil leakage detection becomes a problem to be solved. SUMMARY
[0005] The technical problem solved by the present application is to provide an oil pipe oil leakage detection method and related device, camera device and storage medium, which can improve the convenience of oil pipe oil leakage detection.
[0006] To solve the above problems, the first aspect of the present application provides an oil pipe oil leakage detection method, comprising: comparing a first image photographed by a camera device at a cruise point with a background image of the same cruise point to determine a first difference area in the first image; wherein the background image is an oil pipeline site image photographed at the cruise point when there is no oil leakage; extracting a first test image from the first image based on the first difference area; detecting the first test image in multiple detection dimensions respectively to obtain detection scores of the first test image existing oil leakage in various detection dimensions respectively; wherein the multiple detection dimensions at least include color dimension and shape dimension; determining a first detection result representing whether there is oil leakage in the photographed range of the cruise point based on the detection scores in various detection dimensions.
[0007] To solve the above problems, the second aspect of the present application provides an oil pipe oil leakage detection device, comprising: a comparison module, configured to compare a first image photographed by a camera device at a cruise point with a background image of the same cruise point to determine a first difference area in the first image; wherein the background image is an oil pipeline site image photographed at the cruise point when there is no oil leakage; an extraction module, configured to extract a first test image from the first image based on the first difference area; a detection module, configured to detect the first test image in multiple detection dimensions respectively to obtain detection scores of the first test image existing oil leakage in various detection dimensions respectively; wherein the multiple detection dimensions at least include color dimension and shape dimension; a determination module, configured to determine a first detection result at the cruise point based on the detection scores in various detection dimensions.
[0008] To solve the above problems, the third aspect of the present application provides a camera device, comprising a gimbal, a camera, a memory and a processor, the camera is carried on the gimbal and used to drive the camera to cruise, the gimbal, the camera and the memory are respectively coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to realize the oil pipe leakage detection method in the first aspect.
[0009] To solve the above problems, the fourth aspect of the present application provides a computer readable storage medium, which stores program instructions capable of being executed by a processor, and the program instructions are used for the oil pipe leakage detection method in the first aspect.
[0010] The above scheme compares the image taken by the camera device with the background image of the same cruise point to obtain a first to-be-tested image, detects the first to-be-tested image in multiple detection dimensions to obtain a detection score of the existence of oil leakage, and obtains a first detection result of the existence of oil leakage based on the detection score, thereby improving the convenience of oil pipe leakage detection. In addition, since the oil leakage is detected in multiple detection dimensions, the accuracy of oil pipe leakage detection is also improved. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 is a flowchart of an embodiment of the oil pipe leakage detection method of the present application;
[0012] Figure 2 is a training flowchart of the detection model in the oil pipe leakage detection method of the present application;
[0013] Figure 3 is a flowchart of another embodiment of the oil pipe leakage detection method of the present application;
[0014] Figure 4 is a frame diagram of an embodiment of the oil pipe leakage detection device of the present application;
[0015] Figure 5 is a frame diagram of an embodiment of the camera device of the present application;
[0016] Figure 6 is a frame diagram of an embodiment of the computer readable storage medium of the present application. DETAILED DESCRIPTION
[0017] The schemes of the embodiments of the present application will be described in detail below with reference to the drawings of the specification.
[0018] In the following description, specific details such as specific system structures, interfaces, techniques, etc. are presented in order to thoroughly understand the present application, but are not intended to limit the present application.
[0019] The terms "system" and "network" are often used interchangeably herein. The term "and / or", merely describes an associated relationship, which means that there can be three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" herein means two or more than two.
[0020] Please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of the oil pipeline leakage detection method of the present application. Specifically, it can include the following steps:
[0021] S11: comparing the first image captured by the camera device at the cruise point with the background image of the same cruise point to determine the first difference area in the first image; wherein the background image is the oil pipeline site image captured at the cruise point when there is no leakage;
[0022] S12: extracting the first test image from the first image based on the first difference area;
[0023] S13: detecting the first test image in multiple detection dimensions respectively to obtain the detection score of the first test image in each detection dimension; wherein the multiple detection dimensions include at least color dimension and shape dimension;
[0024] S14: determining the first detection result representing whether there is leakage in the shooting range of the cruise point based on the detection score in each detection dimension.
[0025] The above scheme compares the image captured by the camera device with the background image of the same cruise point to obtain the first test image, detects the first test image in multiple detection dimensions to obtain the detection score of the leakage, and determines the first detection result representing whether there is leakage based on the detection score, thereby improving the convenience of oil pipeline leakage detection. In addition, since the leakage detection of the captured image is performed in multiple detection dimensions, it also helps to improve the accuracy of oil pipeline leakage detection.
[0026] Specifically, in S11, the camera device will cruise along the oil pipeline, stop at each cruise point, take a first image corresponding to each cruise point, and compare the first image of each cruise point with its background image; wherein the background image is an image of the oil pipeline at the cruise point without oil leakage; in this embodiment, the interval time of the camera device cruising along the oil pipeline can be one minute, or any other time, or uninterrupted circular cruising, which is not limited in this application; the application also does not limit the residence time of the camera device at each cruise point to take the first image; after comparing the first image of each cruise point with the background image, the first difference area is obtained, which is different from the background image in the first image; wherein the image difference method can be used to compare the first image with the background image to obtain the first difference area, and other existing image comparison methods can also be used to determine the first difference area, which is not limited in this application.
[0027] In S12, the first test image is extracted from the first image based on the first difference area, which can be the image at the corresponding position in the first image according to the position of the first difference area on the first image, thereby improving the subsequent detection efficiency.
[0028] In S13, the first test image is detected from multiple detection dimensions to obtain its detection score in each detection dimension, which can include color dimension and shape dimension, and in other embodiments, it can also include contrast dimension, brightness dimension, etc., which is not limited in this application. Detecting from multiple detection dimensions can improve detection accuracy and avoid missed detection and false detection.
[0029] In S14, based on the detection scores in various detection dimensions, the first detection result of whether there is oil leakage is determined, that is, according to the detection score, it is determined whether there is oil leakage on the first image taken at the cruise point.
[0030] Please refer to Figure 2 , Figure 2 is a training process diagram of the detection model in the oil pipeline oil leakage detection method of the application. The detection score in the detection dimension is detected by the detection model of the same detection dimension, and the detection model includes a feature extraction network and a score prediction network. The training steps of the detection model can include the following steps:
[0031] S21: obtaining a sample image; wherein the sample image is labeled with a sample score and a sample result about the detection dimension, and the sample score represents whether there is oil leakage in the sample image;
[0032] S22: extracting image features of the sample image based on the feature extraction network;
[0033] S23: predicting the image features based on the score prediction network to obtain a predicted score, and predicting the image features based on the dimension prediction network to obtain a prediction result about the detection dimension;
[0034] S24: adjusting the network parameters of the detection model based on the difference between the sample score and the predicted score, and the difference between the sample result and the prediction result.
[0035] The above scheme can improve the detection accuracy through the detection of the first to-be-detected image by the detection model.
[0036] In S21, the sample image is labeled with a sample score, which is used to represent whether there is oil leakage in the sample image. For example, the sample score can be 0 or 1, 0 representing no oil leakage and 1 representing oil leakage. In other possible embodiments, the sample score can also be any value in the range of 0-10, where 0 represents no oil leakage, and the larger the sample score, the larger the oil leakage area in the sample image, and the more serious the oil leakage. In other embodiments, the sample score can also use other values, which are not limited in the present application.
[0037] The sample image is also labeled with a sample result about the detection dimension. For example, in the color dimension, the sample result is the oil leakage color; in the shape dimension, the sample result is the oil leakage contour, i.e., marking which pixels in the sample image belong to the oil leakage.
[0038] In S22, the feature extraction network can include resnet, vgg, etc.
[0039] In S23, according to the image features of the sample image extracted by the feature extraction network in S22, the image features are predicted by the score prediction network and the dimension prediction network respectively to obtain the predicted score and the prediction result. For the color dimension, the dimension prediction network can be any classification network, such as a classification network containing a fully connected layer; for the shape dimension, it can be an image segmentation network such as U-Net.
[0040] In S24, the network parameters of the detection model are adjusted based on the difference between the sample score and the predicted score, and the difference between the sample result and the prediction result. During training, the network parameters are adjusted by minimizing the two differences. By minimizing the difference between the sample score and the predicted score, the model can distinguish between positive and negative samples as much as possible, i.e., there is oil leakage or no oil leakage. By minimizing the difference between the sample result and the prediction result, the detection model can extract as much feature information related to the detection dimension as possible, exclude the interference of other information unrelated to oil leakage detection, and assist in improving the detection performance of the model.
[0041] In some possible implementation manners, when the detection dimension is the color dimension, the sample result is a color of the oil leakage in the sample image.
[0042] In some possible implementation manners, when the detection dimension is the shape dimension, the sample result is a mask image of the oil leakage in the sample image. The mask image and the image to be detected are of the same size, and each pixel point in the mask image is marked as 0 or 1, indicating whether it belongs to the oil leakage. In an implementation scenario, 0 in the mask image represents no oil leakage, and 1 represents oil leakage. After each pixel point in the mask image is multiplied by each pixel point in the sample image, only the pixel points representing the oil leakage are left.
[0043] Please refer to Figure 3 , Figure 3 is a flowchart of another embodiment of the oil leakage detection method of the present application; specifically, based on the detection scores under various detection dimensions, a first detection result indicating whether there is oil leakage in the shooting range of the cruise point is determined, including:
[0044] S31: performing brightness detection based on the first image and the imaging parameter of the imaging device when the first image is shot, to obtain the light condition of the environment where the imaging device is located;
[0045] S32: adaptively determining the weighting coefficients of various detection dimensions based on the light condition;
[0046] S33: weighting the detection scores of the corresponding detection dimensions based on the weighting coefficients of various detection dimensions respectively, to obtain a fusion score;
[0047] S34: obtaining the first detection result at the cruise point based on the fusion score.
[0048] The above scheme can reduce the possibility that the detection result is inaccurate due to the influence of scene brightness on the color and other conditions in the shooting result, and further improve the detection accuracy, by performing brightness detection on the first image, determining the weighting coefficients of various detection dimensions, and obtaining the first detection result at the cruise point based on the fusion score after weighting.
[0049] In some possible implementation manners, the multiple detection dimensions include the color dimension and the shape dimension, and the sum of the weighting coefficient of the color dimension and the weighting coefficient of the shape dimension is a fixed value. The weighting coefficients of various detection dimensions are adaptively determined based on the light condition, including at least one of the following: in response to the light condition satisfying a preset condition, determining that the weighting coefficient of the color dimension is greater than the weighting coefficient of the shape dimension; and in response to the light condition not satisfying the preset condition, determining that the weighting coefficient of the color dimension is not greater than the weighting coefficient of the shape dimension.
[0050] In some implementation scenarios, the multiple detection dimensions can further include other dimensions, such as a brightness dimension, a contrast dimension, and the like, which are not limited herein; when the multiple detection dimensions include the multiple dimensions described above, the sum of the weighting coefficients of the multiple dimensions is also a fixed numerical value; wherein the fixed numerical value can be 1, and can also be any other value, which is not limited herein.
[0051] In some implementation scenarios, based on the light condition, the weighting coefficients of the various detection dimensions can be adaptively determined based on a scene light value obtained after brightness detection of the first image, wherein the brightness detection of the first image can adopt a gray average value method, a brightness average value method, an empirical formula, and the like, which are not limited herein; after obtaining the scene light value, the higher the scene light value, the better the light condition, and the higher the detection accuracy of the color dimension, and the weighting coefficient of the color dimension is appropriately increased; the lower the scene light value, the worse the light condition, and the lower the detection accuracy of the color dimension, and the weighting coefficient of the color dimension is appropriately reduced; the light condition described above satisfies a preset condition, which can be that the scene light value is higher than a certain value, for example, the preset condition is that the scene light value is higher than 50, and when the scene light value is 60, the weighting coefficient of the color dimension is determined to be greater than the weighting coefficient of the shape dimension; in other implementation scenarios, the scene light value can also be other values; in some implementation scenarios, when the light condition satisfies the preset condition and the greater the degree of exceeding the preset condition, the greater the weighting coefficient of the color dimension than the weighting coefficient of the shape dimension; for example, when the scene light value is 60, the weighting coefficient of the color dimension is 0.6, and the weighting coefficient of the shape dimension is 0.4; when the scene light value is 80, the weighting coefficient of the color dimension is 0.8, and the weighting coefficient of the shape dimension is 0.2; the weighting coefficient values of the color dimension and the shape dimension described above are only used as an example of a size relationship, and are not limited as a value and a proportion relationship. In other implementation scenarios, when the detection dimensions further include the contrast, brightness, and the like, the weighting coefficients thereof can also be determined according to the light condition.
[0052] In some possible implementation modes, when the first detection result includes the existence of oil leakage, after determining the first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores in the various detection dimensions, the method further includes: detecting an oil pipe region in the first image, and obtaining a relative position relationship between the oil pipe region and the first difference region; based on the relative position relationship, verifying the first detection result.
[0053] In some implementation scenarios, for example, when the first difference area detected is only above the oil pipe area, the verification result obtained after verifying the first detection result can be false, that is, after verification, it is considered that there is actually no oil leakage in the oil pipe; when the first difference area detected is only below the oil pipe area, or when the first difference area detected is above and below the oil pipe area, the verification result obtained after verifying the first detection result can be true, that is, after verification, it is considered that there is indeed an oil leakage in the oil pipe.
[0054] The above solution further improves detection accuracy and reduces the possibility of missed or false detections by verifying the first detection result.
[0055] In some possible implementations, if the first detection result includes the presence of oil leakage, after determining whether there is an oil leakage within the shooting range of the cruise point based on the detection scores under various detection dimensions, the method further includes: acquiring video data captured while stopping at the cruise point; performing optical flow analysis based on the video data to obtain the oil leakage trajectory; and analyzing the oil leakage type based on the oil leakage trajectory.
[0056] In the above implementation, after the first detection result is that there is an oil leak, the camera device stays at the corresponding cruise point for a period of time and takes a video of the leaking oil pipe. Specifically, the time the camera device stays at the cruise point and the length of the video taken can be any length, such as 30 seconds, 1 minute, etc.
[0057] In the above embodiments, after obtaining the video data, the oil leakage trajectory can be obtained by performing optical flow analysis on the video data; in other possible embodiments, the trajectory can also be calculated by the inter-frame difference method. This application does not limit the trajectory analysis method.
[0058] Furthermore, after obtaining the oil leak trajectory, an oil leak type analysis can be performed. For example, if the obtained trajectory has a parabolic shape, it is determined to be a splashing oil leak, which may be due to oil pipe damage or poor connection. If the obtained trajectory is a vertical dripping pattern, it is determined to be a dripping oil leak, which may be due to oil pipe cracks or other reasons.
[0059] The above solution analyzes the video data captured at the patrol points to determine the type of oil leak. Based on the type of oil leak, appropriate contingency plans can be implemented in a timely manner to resolve the oil leak problem as soon as possible and reduce losses.
[0060] In some possible implementation manners, in a case where the first detection result includes the existence of oil leakage, after determining the first detection result indicating whether there is oil leakage in the shooting range of the cruise point based on the detection scores in various detection dimensions, the method further includes: saving the first image at the cruise point as a reference image at the cruise point; and based on this, the second difference region can be further obtained by comparing a second image newly shot at the cruise point after the oil leakage is repaired with the background image of the cruise point, the second to-be-detected image is extracted from the second image based on the second difference region, and the second to-be-detected image is detected in the multiple detection dimensions respectively to obtain the detection scores of the second to-be-detected image in the various detection dimensions respectively, and the similarity between the second image and the reference image is obtained; and thus the second detection result indicating whether there is oil leakage in the shooting range of the cruise point again is determined based on the similarity and the detection scores of the second to-be-detected image in the various detection dimensions respectively.
[0061] In the implementation manners, the second image is compared with the background image to obtain the second difference region, the second to-be-detected image is extracted based on the second difference region, and the detection scores are obtained by detecting the second to-be-detected image in the multiple detection dimensions respectively, which can refer to the description of the detection scores obtained after the first difference data is extracted from the first image in other implementation manners, and will not be described herein again.
[0062] In the scheme, in a case where the first detection result includes the existence of oil leakage, the first image at the cruise point is saved as a reference image, and the first image is an image of the oil pipe at the corresponding cruise point when the oil pipe leaks. The similarity between the first image and a second image newly shot at the cruise point is obtained by comparing the first image with the second image, which can assist in determining whether the cruise point leaks again based on the detection scores, thereby further improving the detection accuracy and reducing the missed detection and false detection.
[0063] In some implementation scenarios, the similarity between the second image and the reference image can be obtained by using a histogram comparison method or a perceptual hashing algorithm, which is not limited in the present application.
[0064] In some implementation scenarios, the second detection result indicating whether there is oil leakage in the shooting range of the cruise point again can be determined based on the similarity and the detection scores of the second to-be-detected image in the various detection dimensions respectively, and a weight value can be introduced to determine the proportion of the similarity and the detection scores in determining the second detection result, and then it is determined whether there is oil leakage at the cruise point.
[0065] In some possible implementation manners, in a case where the first detection result includes the existence of oil leakage, after determining the first detection result indicating whether there is oil leakage in the shooting range of the cruise point based on the detection scores in various detection dimensions, the method further includes: selecting the first image shot at the cruise point as a background image of the same cruise point.
[0066] Since the environmental background of the cruise point can change over time, the oil pipeline can age, and due to the influence of these factors, even if the oil pipeline does not leak, the image taken can be quite different from the original background image, and the longer the time, the greater the difference, which will result in lower and lower detection accuracy; and saving the first image of each cruise point without leakage as the background image of the cruise point after cruising can maximize the influence of these factors, thereby further improving detection accuracy and reducing missed detection and false detection.
[0067] Please refer to Figure 4 , Figure 4 is a schematic diagram of the frame of an embodiment of the oil pipeline leakage detection device 40. The oil pipeline leakage detection device 40 comprises: a comparison module 41, configured to compare a first image taken by the camera device at a cruise point with a background image of the same cruise point to determine a first difference area in the first image; wherein the background image is an oil pipeline site image taken at the cruise point without leakage; an extraction module 42, configured to extract a first to-be-detected image from the first image based on the first difference area; a detection module 43, configured to detect the first to-be-detected image in multiple detection dimensions respectively to obtain detection scores of the first to-be-detected image in which there is leakage in various detection dimensions respectively; wherein the multiple detection dimensions at least include color dimension and shape dimension; and a determination module 44, configured to determine a first detection result at the cruise point based on the detection scores in various detection dimensions.
[0068] The above scheme compares the image taken by the camera device with the background image of the same cruise point to obtain the first to-be-detected image, detects the first to-be-detected image in multiple detection dimensions to obtain the detection score of the leakage, and obtains the first detection result of whether there is leakage based on the detection score, thereby improving the convenience of oil pipeline leakage detection. In addition, since the leakage is detected in multiple detection dimensions, the accuracy of oil pipeline leakage detection is also improved.
[0069] In some disclosed embodiments, the oil pipeline leakage detection device 40 further comprises a model training module; wherein the model training module further comprises: an acquisition module, configured to acquire a sample image, the sample image being labeled with a sample score and a sample result about the detection dimension, the sample score representing whether there is leakage in the sample image; a feature extraction module, configured to extract image features of the sample image based on a feature extraction network; a prediction module, configured to predict the image features based on a score prediction network to obtain a predicted score, and predict the image features based on a dimension prediction network to obtain a predicted result about the detection dimension; and a parameter adjustment module, configured to adjust network parameters of the detection model based on the difference between the sample score and the predicted score, and the difference between the sample result and the predicted result.
[0070] In some disclosed embodiments, the determining module 44 further comprises a brightness determining sub-module configured to, in a case where the first detection result indicates that there is oil leakage, perform brightness detection based on the first image and an imaging parameter of the imaging device when the first image is captured to obtain a light condition of an environment where the imaging device is located; a coefficient determining sub-module configured to, in a case where the first detection result indicates that there is oil leakage, adaptively determine a weighting coefficient of each detection dimension based on the light condition; a fusion score determining sub-module configured to weight a detection score of each detection dimension based on the weighting coefficient of the corresponding detection dimension to obtain a fusion score; and a detection result determining sub-module configured to obtain the first detection result at the cruise point based on the fusion score.
[0071] In some disclosed embodiments, the oil pipe oil leakage detection apparatus 40 further comprises a position detection module configured to detect an oil pipe region in the first image and obtain a relative position relationship between the oil pipe region and the first difference region; and a verification module configured to verify the first detection result based on the relative position relationship.
[0072] In some disclosed embodiments, the oil pipe oil leakage detection apparatus 40 further comprises a video module configured to, in a case where the first detection result indicates that there is oil leakage, obtain video data captured while staying at the cruise point; and an analysis module configured to, in a case where the first detection result indicates that there is oil leakage, perform optical flow analysis based on the video data to obtain an oil leakage trajectory, and analyze an oil leakage type based on the oil leakage trajectory.
[0073] In some disclosed embodiments, the oil pipe oil leakage detection apparatus 40 further comprises a reference module configured to, in a case where the first detection result indicates that there is oil leakage, save the first image at the cruise point as a reference image at the cruise point; a second comparison module configured to, in a case where the first detection result indicates that there is oil leakage, compare a second image newly captured at the cruise point after oil leakage repair with a background image at the cruise point; a second extraction module configured to, in a case where the first detection result indicates that there is oil leakage, extract a second to-be-detected image from the second image based on a second difference region; a second detection module configured to, in a case where the first detection result indicates that there is oil leakage, detect the second to-be-detected image in multiple detection dimensions to obtain a detection score of the second to-be-detected image in each detection dimension, and obtain a similarity between the second image and the reference image; and a second determining module configured to, in a case where the first detection result indicates that there is oil leakage, determine a second detection result indicating whether oil leakage occurs again in a shooting range of the cruise point based on the similarity and the detection score of the second to-be-detected image in each detection dimension.
[0074] In some disclosed embodiments, the oil pipe oil leakage detection apparatus 40 further comprises a background image updating module configured to, in a case where the first detection result indicates that there is no oil leakage, select the first image captured at the cruise point as a background image at the same cruise point.
[0075] Referring to Figure 5 , Figure 5 is a schematic diagram of an embodiment of the camera device 50. The camera device 50 includes a gimbal 51, a camera 52, a memory 53 and a processor 54. The camera 52 is carried on the gimbal 51 and is used to drive the camera 52 to cruise. The gimbal 51, the camera 52 and the memory 53 are respectively coupled to the processor 54. The memory 53 stores program instructions. The processor 54 is used to execute the program instructions to implement the steps in any of the above oil pipe leakage detection method embodiments.
[0076] Specifically, the processor 54 is used to control itself and the gimbal 51, the camera 52 and the memory 53 to implement the steps in any of the above oil pipe leakage detection method embodiments. The processor 54 can also be referred to as a CPU (Central Processing Unit). The processor 54 can be an integrated circuit chip with signal processing capability. The processor 54 can also be a general processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general processor can be a microprocessor or the processor can also be any conventional processor. In addition, the processor 54 can be jointly implemented by integrated circuit chips.
[0077] The above scheme compares the image captured by the camera device with the background image of the same cruise point to obtain the first to-be-detected image, detects the first to-be-detected image in multiple detection dimensions to obtain a detection score of the presence of leakage, and obtains a first detection result of the presence of leakage based on the detection score, thereby improving the convenience of oil pipe leakage detection. In addition, since the leakage detection of the captured image is performed in multiple detection dimensions, the accuracy of oil pipe leakage detection is also improved.
[0078] Referring to Figure 6 , Figure 6 is a schematic diagram of an embodiment of the computer readable storage medium 60. The computer readable storage medium 60 stores program instructions 61 that can be executed by the processor. The program instructions 61 are used to implement the steps in any of the above oil pipe leakage detection method embodiments.
[0079] The scheme can compare the image captured by the camera device with the background image of the same cruise point to obtain the first to-be-detected image, detect the first to-be-detected image in multiple detection dimensions to obtain a detection score of the oil leakage, and obtain the first detection result of whether the oil leakage exists based on the detection score, thereby improving the convenience of the oil leakage detection of the oil pipe. In addition, since the oil leakage detection is performed on the captured image in multiple detection dimensions, the accuracy of the oil leakage detection of the oil pipe can also be improved.
[0080] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other manners. For example, the above-described device embodiments are merely illustrative, and the division of the modules or units can be different, for example, the division of the modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules or units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0081] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0082] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0083] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods in the embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various other media that can store program codes.
[0084] If the technical solutions of the present application involve personal information, the product applying the technical solutions of the present application has been informed of the personal information processing rules before processing the personal information, and has obtained the personal independent consent. If the technical solutions of the present application involve sensitive personal information, the product applying the technical solutions of the present application has obtained the personal independent consent before processing the sensitive personal information, and at the same time meets the requirement of "explicit consent". For example, at the personal information collection device such as camera, a clear and prominent mark is set to inform that the personal information collection range has been entered, and the personal information will be collected. If the person voluntarily enters the collection range, it is regarded as agreeing to collect the personal information. Or, on the device for processing personal information, the personal information processing rules are informed by using obvious mark / information, and the personal authorization is obtained by means of pop-up information or asking the person to upload his / her personal information. The personal information processing rules can include personal information processor, personal information processing purpose, processing method, and personal information type, etc.
Claims
1. A method of tubing leak detection, the method comprising: The method comprises the following steps: comparing a first image captured by a camera device at a cruise point with a background image of the same cruise point to determine a first difference region in the first image; wherein the background image is an on-site image of the oil pipeline at the cruise point when there is no oil leakage; extracting a first test image from the first image based on the first difference region; detecting the first test image in multiple detection dimensions to obtain detection scores of the first test image in each detection dimension; wherein the multiple detection dimensions include at least color dimension and shape dimension; determining a first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores in each detection dimension; performing brightness detection based on the first image and the camera parameters of the camera device when the first image is captured to obtain the light condition of the environment where the camera device is located, adaptively determining the weighting coefficients of each detection dimension based on the light condition, weighting the detection scores of the corresponding detection dimension based on the weighting coefficients of each detection dimension to obtain a fusion score, and obtaining the first detection result at the cruise point based on the fusion score.
2. The method of claim 1, wherein, The detection scores in each detection dimension are obtained by detecting the first test image by a detection model of the same detection dimension, and the detection model comprises a feature extraction network and a score prediction network. The training steps of the detection model comprise: obtaining a sample image; wherein the sample image is labeled with a sample score and a sample result of the detection dimension, and the sample score represents whether there is oil leakage in the sample image; extracting image features of the sample image based on the feature extraction network; predicting the image features based on the score prediction network to obtain a predicted score, and predicting the image features based on the dimension prediction network to obtain a predicted result of the detection dimension; adjusting the network parameters of the detection model based on the difference between the sample score and the predicted score, and the difference between the sample result and the predicted result.
3. The method of claim 1, wherein, In the case that the first detection result includes oil leakage, after determining the first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores in each detection dimension, the method further comprises: detecting the oil pipeline region in the first image and obtaining the relative position relationship between the oil pipeline region and the first difference region; verifying the first detection result based on the relative position relationship.
4. The method of claim 1, wherein, In the case that the first detection result includes oil leakage, after determining the first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores in each detection dimension, the method further comprises: obtaining video data captured at the cruise point; performing optical flow analysis based on the video data to obtain a leakage trajectory; analyzing the leakage type based on the leakage trajectory.
5. The method of claim 1, wherein, In the case that the first detection result includes the presence of oil leakage, after determining the first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores under various detection dimensions, the method further includes: saving the first image at the cruise point as a reference image at the cruise point; The method further includes: in response to the second difference region existing between the newly photographed second image at the cruise point after the oil leakage is repaired and the background image of the cruise point, extracting a second to-be-tested image from the second image based on the second difference region, and detecting the second to-be-tested image in the multiple detection dimensions respectively to obtain the detection scores of the second to-be-tested image in the presence of oil leakage under various detection dimensions respectively, and obtaining the similarity between the second image and the reference image; based on the similarity and the detection scores of the second to-be-tested image in the presence of oil leakage under various detection dimensions respectively, determining a second detection result representing whether oil leakage reoccurs in the shooting range of the cruise point.
6. The method of claim 1, wherein, In the case that the first detection result includes the absence of oil leakage, after determining the first detection result representing whether there is oil leakage in the shooting range of the cruise point based on the detection scores under various detection dimensions, the method further includes: selecting the first image photographed at the cruise point as a background image of the same cruise point.
7. A tubing leak detection apparatus, characterized by, includes: a comparison module configured to compare a first image photographed at a cruise point by a camera device with a background image of the same cruise point to determine a first difference region in the first image, wherein the background image is an on-site image of a pipeline photographed at the cruise point when there is no oil leakage; an extraction module configured to extract a first to-be-tested image from the first image based on the first difference region; a detection module configured to detect the first to-be-tested image in multiple detection dimensions respectively to obtain detection scores of the first to-be-tested image in the presence of oil leakage under various detection dimensions respectively, wherein the multiple detection dimensions include at least color dimension and shape dimension; a determination module configured to determine a first detection result at the cruise point based on the detection scores under various detection dimensions, perform brightness detection based on the first image and a camera parameter of the camera device when the first image is photographed to obtain light conditions of an environment where the camera device is located, adaptively determine weighting coefficients of various detection dimensions based on the light conditions, weight the detection scores of the corresponding detection dimensions based on the weighting coefficients of various detection dimensions respectively to obtain fusion scores, and obtain the first detection result at the cruise point based on the fusion scores.
8. A camera device, characterized in that, A gimbal, a camera, a memory and a processor are included, the camera is carried on the gimbal and is used to drive the camera to cruise, the gimbal, the camera and the memory are respectively coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to realize the pipeline oil leakage detection method in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage has program instructions capable of being run by the processor, and the program instructions are used for realizing the tubing leakage detection method in any one of claims 1 to 6.
Citation Information
Patent Citations
Oil leakage defect detection method and system
CN111209876A
Method and device for searching target object, unmanned aerial vehicle equipment and storage medium
CN113050698A