Crude oil leakage area measuring method and device

By performing target detection and image segmentation on orthophotos of the crude oil spill area, identifying and removing background areas, and determining the crude oil spill area based on the number and area of ​​pixels, the problem of inaccurate assessment in existing technologies is solved, and rapid and low-cost crude oil spill area measurement is achieved.

CN121639764APending Publication Date: 2026-03-10CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-08
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies are insufficient to accurately and effectively assess the area of ​​crude oil leaks; infrared thermometry is ineffective at detecting leaks at similar temperatures; gas detection sensors are inadequate for assessing scale; satellite remote sensing imagery is costly; and fluid dynamics simulations are highly complex.

Method used

By acquiring orthophoto images of the crude oil spill area, target detection and image segmentation are performed to identify the initial crude oil area image, background areas are removed, and the crude oil spill area is determined based on the number of pixels and the area of ​​a single pixel at a preset height.

Benefits of technology

It enables accurate and rapid measurement of crude oil leak area at low cost, requiring no additional equipment or complex modeling, and simplifies the assessment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639764A_ABST
    Figure CN121639764A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for measuring a crude oil leakage area. The method comprises the following steps: acquiring a crude oil positive photograph of a crude oil leakage area at a preset height; performing target detection on the crude oil positive image, and identifying to obtain an initial crude oil region image in the crude oil positive image; performing image segmentation on the initial crude oil region image, and removing a background region image in the initial crude oil region image to obtain a crude oil region image; and determining the crude oil leakage area based on the number of the pixel points in the crude oil region image and the area occupied by the single pixel points at the preset height. According to the method, the crude oil leakage area can be accurately and rapidly determined, additional configuration of measuring equipment is not needed, the cost is low, complex modeling calculation is not involved, and measurement of the crude oil leakage area can be efficiently and simply achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental monitoring technology, and in particular to a method and apparatus for measuring the area of ​​crude oil leaks. Background Technology

[0002] For a long time, pipeline accidents leading to leaks have been a major concern in the industry. The main causes of pipeline leaks may be pipeline aging, mechanical failure, natural disasters or human factors. Crude oil pipeline leaks can cause significant damage to soil, water bodies and ecosystems. Rapid and accurate assessment of the leak area of ​​pipelines that have already leaked is crucial for formulating pipeline emergency repair strategies and for environmental protection.

[0003] Currently, the area of ​​crude oil leaks is often assessed using infrared thermometry, gas detection sensors, satellite remote sensing images, and fluid dynamics simulations. However, these methods are difficult to accurately and effectively assess the area of ​​crude oil leaks. Summary of the Invention

[0004] This invention provides a method and apparatus for measuring the area of ​​crude oil leaks, in order to overcome the deficiencies in the prior art.

[0005] This invention provides a method for measuring the area of ​​a crude oil leak, comprising the following steps: Obtain an orthophoto image of the crude oil spill area at a preset height; Target detection is performed on the orthophoto image of crude oil to identify the initial crude oil region image in the orthophoto image of crude oil; image segmentation is performed on the initial crude oil region image to remove the background region image in the initial crude oil region image to obtain the crude oil region image; The crude oil leak area is determined based on the number of pixels in the crude oil area image and the area occupied by a single pixel at the preset height.

[0006] According to a method for measuring the area of ​​a crude oil leak provided by the present invention, the step of performing image segmentation on the initial crude oil area image and removing the background area image from the initial crude oil area image to obtain the crude oil area image includes: From the initial crude oil area image, select one pixel as the current centroid of the first cluster and select another pixel as the current centroid of the second cluster. The distance between the current centroid of the first cluster and the black pixel is less than a threshold, and the distance between the current centroid of the second cluster and the black pixel is greater than or equal to the threshold. Based on the distances from the remaining pixels in the initial crude oil region image to each current centroid, the clusters to which the remaining pixels belong are determined; based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel, the current centroids in each cluster are updated; Determine whether the current centroid in each cluster remains unchanged or whether the current centroid in each cluster has reached a preset number of updates. If yes, then use the image composed of all pixels in the first cluster as the crude oil region image; otherwise, return to the steps of determining the cluster to which the remaining pixels belong and updating the current centroid in each cluster.

[0007] According to a method for measuring the area of ​​a crude oil leak provided by the present invention, updating the current centroid of each cluster based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel includes: Based on the coordinates of each pixel in each cluster, multiple candidate centroids are determined from each pixel. The candidate centroid closest to the black pixel is taken as the current centroid of the first cluster, and the candidate centroid farthest from the black pixel is taken as the current centroid of the second cluster.

[0008] According to the crude oil leak area measurement method provided by the present invention, the distance between the current centroid and the black pixel is the Euclidean distance.

[0009] According to a method for measuring the area of ​​a crude oil leak provided by the present invention, the area occupied by a single pixel at the preset height is determined based on the following steps: Obtain a rectangular orthophoto image of the rectangular sample at the preset height; Based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample, the area occupied by a single pixel at the preset height is determined.

[0010] According to a method for measuring the area of ​​a crude oil leak provided by the present invention, the method for determining the area occupied by a single pixel at a preset height based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample further includes: sequentially performing image thresholding and binarization processing on the rectangular orthophoto image.

[0011] The present invention also provides a crude oil leak area measuring device, comprising the following modules: The acquisition unit is used to acquire an orthophoto image of the crude oil spill area at a preset height. The identification unit is used to perform target detection on the orthophoto image of crude oil and identify the initial crude oil region image in the orthophoto image of crude oil. A segmentation unit is used to segment the initial crude oil region image, remove the background region image from the initial crude oil region image, and obtain the crude oil region image. The measurement unit is used to determine the crude oil leak area based on the number of pixels in the crude oil area image and the area occupied by a single pixel at the preset height.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the crude oil leak area measurement method as described above.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the crude oil leak area measurement method as described above.

[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the crude oil leak area measurement methods described above.

[0015] The crude oil leak area measurement method and apparatus provided by the present invention perform target detection on the orthophoto image of crude oil, identify the initial crude oil region image in the orthophoto image of crude oil, and then perform image segmentation on the initial crude oil region image to accurately obtain the crude oil region image. Thus, based on the number of pixels in the crude oil region image and the area occupied by a single pixel at a preset height, the crude oil leak area can be accurately and quickly determined. Moreover, the embodiments of the present invention do not require additional measurement equipment, have low cost, and do not involve complex modeling calculations, and can efficiently and simply measure the crude oil leak area. Attached Figure Description

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

[0017] Figure 1 This is a flowchart illustrating the crude oil leak area measurement method provided by the present invention.

[0018] Figure 2 This is a schematic diagram of the structure of the crude oil leakage area measuring device provided by the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

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

[0021] Currently, the area of ​​crude oil leaks is often assessed using infrared thermography, gas detection sensors, satellite remote sensing imagery, and fluid dynamics simulations. However, these methods are difficult to accurately and effectively assess the area of ​​crude oil leaks. Specifically: Infrared thermography: Using an infrared thermography camera to detect temperature changes at the leak point. Considering that crude oil leaks usually cause the ambient temperature to rise, infrared and thermal imaging technologies can be used to locate the leak point. However, the drawback is that when the temperature of the pipeline medium is close to the outside temperature, the leak is difficult to detect, and as the leak time increases, the medium will gradually assimilate with the external temperature, making it difficult to assess the leak area.

[0022] Gas detection sensors: Gas detection sensors are used to detect gases produced by leaks, such as methane and hydrogen sulfide. Gas detection sensors can quickly identify the leak source and estimate the size of the leak by analyzing the gas concentration, but they are difficult to quickly and effectively assess the leak area.

[0023] Satellite remote sensing imagery: Satellite remote sensing imagery technology can provide wide-area coverage and capture signs of large-scale leaks. This includes using satellite imagery to locate leak points and make preliminary estimates of the leak area. However, remote sensing monitoring is costly.

[0024] Fluid dynamics simulation: Through numerical simulation and fluid dynamics models, the behavior of oil around a pipeline after a leak can be simulated, thereby estimating the leak area. This method typically needs to consider multiple factors, such as pipeline diameter, flow velocity, and liquid properties, resulting in high complexity in assessing the crude oil leak area.

[0025] Figure 1 This is a flowchart illustrating the crude oil leak area measurement method provided by the present invention, as shown below. Figure 1 As shown, the method includes steps 110, 120, 130 and 140.

[0026] Step 110: Obtain an orthophoto image of the crude oil leak area at a preset height.

[0027] Here, the crude oil spill area refers to the region where a crude oil pipeline leak is occurring. A crude oil orthophoto image is a geometrically corrected aerial or satellite image that accurately reflects the actual situation of the crude oil spill area. Unlike traditional aerial photographs, crude oil orthophoto images eliminate distortions caused by factors such as shooting angle and terrain undulations, ensuring that the position of each pixel in the image corresponds to the actual location of the crude oil spill area.

[0028] Optionally, the original image of the crude oil spill area can be obtained by means of aerial photography, drones or satellites, and the original image can be geometrically corrected. Finally, the geometrically corrected original image can be output as a crude oil orthophoto image.

[0029] Step 120: Perform target detection on the crude oil orthophoto image to identify the initial crude oil region image in the crude oil orthophoto image.

[0030] Specifically, considering that crude oil orthophoto images may include not only crude oil area images but also images of redundant empty areas, this embodiment of the invention first performs object detection on the crude oil orthophoto image to avoid interference from these redundant empty areas in subsequent image segmentation. This process removes the redundant empty areas, thereby reducing irrelevant information in the image, reducing the complexity of subsequent image segmentation, shortening the segmentation time, and improving the segmentation efficiency. Object detection algorithms such as YOLO (You Only Look Once), Faster R-CNN (Region-based Convolutional Neural Network), or SSD (Single Shot MultiBox Detector) can be used to perform object detection on the crude oil orthophoto image.

[0031] Optionally, a sample crude oil orthophoto image at a preset altitude can be acquired using a drone, and the initial sample crude oil region image in the sample crude oil orthophoto image can be manually labeled. Then, a target detection model is trained based on the sample crude oil orthophoto image and the initial sample crude oil region image. Finally, the crude oil orthophoto image is input into the target detection model, which performs target detection on the crude oil orthophoto image to obtain the initial crude oil region image in the crude oil orthophoto image. Specifically, a sample crude oil orthophoto image with a regular shape (e.g., a rectangular sample crude oil orthophoto image with a length and width of 10cm) can be acquired to verify the accuracy of the target detection model. That is, the regular-shaped sample crude oil orthophoto image is input into the trained target detection model to obtain the predicted crude oil region image output by the target detection model. The accuracy of the target detection model is verified based on the difference between the predicted crude oil region image and the initial sample crude oil region image in the labeled sample crude oil orthophoto image.

[0032] Step 130: Perform image segmentation on the initial crude oil region image, remove the background region image from the initial crude oil region image, and obtain the crude oil region image.

[0033] Specifically, the initial crude oil region image may include the crude oil region image and a portion of the background region image. To accurately identify the crude oil region image, this embodiment of the invention performs image segmentation on the initial crude oil region image, removing the background region image to obtain a clear crude oil region image. Specifically, the k-means clustering algorithm can be used for image segmentation of the initial crude oil region image.

[0034] Step 140: Determine the crude oil leak area based on the number of pixels in the crude oil area image and the area occupied by a single pixel at a preset height.

[0035] Specifically, the number of pixels in the crude oil region image refers to the total number of pixels in the crude oil region image. The area occupied by a single pixel at the preset height refers to the actual area corresponding to each pixel in the orthophoto image acquired at the preset height.

[0036] Optionally, the crude oil spill area = the number of pixels in the crude oil area image × the area occupied by a single pixel at a preset height. For example, if the number of pixels in the crude oil area image is 3694, the area occupied by a single pixel at 2m is 0.0000074m². 2 Therefore, the crude oil spill area = 3694 × 0.0000074 m² 2 =0.02m 2 .

[0037] The crude oil leak area measurement method provided in this invention performs target detection on a crude oil orthophoto image, identifies the initial crude oil region image in the crude oil orthophoto image, and then performs image segmentation on the initial crude oil region image to accurately obtain the crude oil region image. Thus, based on the number of pixels in the crude oil region image and the area occupied by a single pixel at a preset height, the crude oil leak area can be accurately and quickly determined. Moreover, this invention does not require additional measurement equipment, has low cost, and does not involve complex modeling calculations, thus enabling efficient and simple measurement of the crude oil leak area.

[0038] Based on the above embodiments, image segmentation is performed on the initial crude oil region image to remove the background region image, resulting in a crude oil region image, including: Select one pixel from the initial crude oil region image as the current centroid of the first cluster, and select another pixel as the current centroid of the second cluster. The distance between the current centroid of the first cluster and the black pixel is less than a threshold, and the distance between the current centroid of the second cluster and the black pixel is greater than or equal to the threshold. Based on the distances from the remaining pixels in the initial crude oil region image to each current centroid, determine the cluster to which the remaining pixels belong; Update the current centroid of each cluster based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel. Determine whether the current centroid in each cluster remains unchanged or whether the current centroid in each cluster has reached the preset number of updates. If yes, then use the image composed of all pixels in the first cluster as the crude oil region image; otherwise, return to the steps of determining the cluster to which the remaining pixels belong and updating the current centroid in each cluster.

[0039] Considering that crude oil is typically darker in color and the background is typically lighter in color, meaning there is a significant color difference between the crude oil area and the background area, this embodiment of the invention divides all pixels in the initial crude oil area image into two categories: one category consists of pixels from the crude oil area image, belonging to the first cluster, and the other category consists of pixels from the background area image, belonging to the second cluster.

[0040] Since the pixels in the crude oil region image are typically close to black, meaning the pixels in the first cluster are usually close to black, the distance between the pixels in the first cluster and the black pixels is relatively small. Similarly, since the pixels in the background region image are typically far from black, meaning the pixels in the second cluster are usually far from black, the distance between the pixels in the second cluster and the black pixels is relatively large.

[0041] In this embodiment of the invention, a pixel is randomly selected from the crude oil region image whose distance from a black pixel is less than a threshold as the current centroid of the first cluster, and a pixel is randomly selected whose distance from a black pixel is greater than or equal to the threshold as the current centroid of the second cluster.

[0042] After determining the current centroid of the first cluster and the current centroid of the second cluster, it is necessary to update the current centroid of the first cluster and the current centroid of the second cluster. Specifically, for each cluster, calculate the average value of the coordinates of all pixels in the cluster, and redetermine the current centroid based on the average value and the distance between each pixel in each cluster and the black pixel, so as to update the current centroid.

[0043] If the current centroid in each cluster remains unchanged, it indicates that the centroid position is stable. In this case, the image composed of all pixels in the first cluster can be used as the crude oil region image. If the current centroid reaches the preset number of updates, it indicates that the convergence condition has been met. In this case, the image composed of all pixels in the first cluster can also be used as the crude oil region image.

[0044] If the current centroid in each cluster is still changing and the current centroid in each cluster has not reached the preset number of updates, then return to the steps of determining the cluster to which the remaining pixels belong (i.e., determining the cluster to which the remaining pixels belong based on the distance from the remaining pixels in the initial crude oil region image to each current centroid) and updating the current centroid in each cluster (i.e., updating the current centroid in each cluster based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel).

[0045] This invention classifies all pixels into two categories, thereby reducing the complexity of image segmentation and further improving image segmentation efficiency.

[0046] Based on any of the above embodiments, updating the current centroid of each cluster based on the coordinates of each pixel in each cluster and the coordinates of each pixel in each cluster and the black pixel includes: Based on the coordinates of each pixel in each cluster, multiple candidate centroids are determined from each pixel. The candidate centroid closest to the black pixel is taken as the current centroid of the first cluster, and the candidate centroid farthest from the black pixel is taken as the current centroid of the second cluster.

[0047] Specifically, a candidate centroid refers to a potential cluster center point. Optionally, the average coordinates of all pixels in each cluster (i.e., average coordinates) can be calculated, and multiple candidate centroids can be determined based on this average. For example, k pixels closest to the average coordinates can be selected as candidate centroids.

[0048] The closer the candidate centroid is to a black pixel, the greater the probability that the pixel corresponding to the candidate centroid is a pixel in the crude oil region; the farther the candidate centroid is from a black pixel, the greater the probability that the pixel corresponding to the candidate centroid is a pixel in the background region.

[0049] Based on this, in this embodiment of the invention, the candidate centroid closest to the black pixel is taken as the current centroid of the first cluster, and the candidate centroid farthest from the black pixel is taken as the current centroid of the second cluster.

[0050] Based on any of the above embodiments, the distance between the current centroid and the black pixel is the Euclidean distance.

[0051] Specifically, the distance between the current centroid and the black pixel can be calculated as the Euclidean distance based on the RGB value of the current centroid and the RGB value of the black pixel, where the RGB value of the black pixel is usually (0,0,0).

[0052] Based on any of the above embodiments, the area occupied by a single pixel at the preset height is determined based on the following steps: Obtain a rectangular orthophoto image of the rectangular sample at a preset height; Based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample, the area occupied by a single pixel at the preset height is determined.

[0053] Specifically, both the rectangular orthophoto image and the crude oil orthophoto image are obtained at a preset height, and thus the area occupied by a single pixel in the rectangular orthophoto image is the same as the area occupied by a single pixel in the crude oil orthophoto image.

[0054] Based on this, embodiments of the present invention determine the area occupied by a single pixel at a preset height based on the number of pixels in a rectangular orthophoto image and the area of ​​the rectangular sample, thereby determining the crude oil leak area based on the area occupied by a single pixel at the preset height. Wherein, the area occupied by a single pixel at the preset height = area of ​​the rectangular sample / number of pixels in the rectangular orthophoto image.

[0055] For example, if a rectangular sample has a length of 1.185m and a width of 0.467m, its area is 1.185 × 0.467 = 0.553m². 2 A drone captured a rectangular orthographic image at a height of 2 meters. After image thresholding and binarization, a binary image was obtained. The number of white pixels in the binary image was counted as 74,400. Therefore, the area occupied by a single pixel = 0.553 / 74,400 = 0.0000074m². 2 .

[0056] Based on any of the above embodiments, the area occupied by a single pixel at a preset height is determined based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample. Prior to this, the method further includes: The rectangular orthophoto image is subjected to image thresholding and binarization processes in sequence.

[0057] Specifically, image thresholding is the process of dividing pixel values ​​in an image into two or more categories. Binarization is the process of converting an image into a black and white image that contains only two pixel values.

[0058] The crude oil leakage area measuring device provided by the present invention is described below. The crude oil leakage area measuring device described below can be referred to in correspondence with the crude oil leakage area measuring method described above.

[0059] Based on any of the above embodiments Figure 2 This is a schematic diagram of the structure of the crude oil leak area measuring device provided by the present invention, as shown below. Figure 2 As shown, the device includes: Acquisition unit 210 is used to acquire an orthophoto image of crude oil in the crude oil spill area at a preset height; The recognition unit 220 is used to perform target detection on the crude oil orthophoto image and identify the initial crude oil region image in the crude oil orthophoto image. The segmentation unit 230 is used to segment the initial crude oil region image, remove the background region image from the initial crude oil region image, and obtain the crude oil region image. The measurement unit 240 is used to determine the crude oil leak area based on the number of pixels in the crude oil area image and the area occupied by a single pixel at a preset height.

[0060] Based on any of the above embodiments, image segmentation is performed on the initial crude oil region image to remove the background region image from the initial crude oil region image, resulting in a crude oil region image, including: Select one pixel from the initial crude oil region image as the current centroid of the first cluster, and select another pixel as the current centroid of the second cluster. The distance between the current centroid of the first cluster and the black pixel is less than a threshold, and the distance between the current centroid of the second cluster and the black pixel is greater than or equal to the threshold. Based on the distances from the remaining pixels in the initial crude oil region image to each current centroid, determine the cluster to which the remaining pixels belong; Update the current centroid of each cluster based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel. Determine whether the current centroid in each cluster remains unchanged or whether the current centroid in each cluster has reached the preset number of updates. If yes, then use the image composed of all pixels in the first cluster as the crude oil region image; otherwise, return to the steps of determining the cluster to which the remaining pixels belong and updating the current centroid in each cluster.

[0061] Based on any of the above embodiments, updating the current centroid of each cluster based on the coordinates of each pixel in each cluster and the distance between each pixel in each cluster and the black pixel includes: Based on the coordinates of each pixel in each cluster, multiple candidate centroids are determined from each pixel. The candidate centroid closest to the black pixel is taken as the current centroid of the first cluster, and the candidate centroid farthest from the black pixel is taken as the current centroid of the second cluster.

[0062] Based on any of the above embodiments, the distance between the current centroid and the black pixel is the Euclidean distance.

[0063] Based on any of the above embodiments, the area occupied by a single pixel at the preset height is determined based on the following steps: Obtain a rectangular orthophoto image of the rectangular sample at a preset height; Based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample, the area occupied by a single pixel at the preset height is determined.

[0064] Based on any of the above embodiments, the area occupied by a single pixel at a preset height is determined based on the number of pixels in the rectangular orthophoto image and the area of ​​the rectangular sample. Prior to this, the method further includes: The rectangular orthophoto image is subjected to image thresholding and binarization processes in sequence.

[0065] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 3 As shown, the electronic device may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a crude oil leak area measurement method. This method includes: acquiring an orthophoto image of the crude oil leak area at a preset height; performing target detection on the orthophoto image to identify an initial crude oil area image; performing image segmentation on the initial crude oil area image to remove background areas, obtaining a crude oil area image; and determining the crude oil leak area based on the number of pixels in the crude oil area image and the area occupied by a single pixel at the preset height.

[0066] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0067] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the crude oil leakage area measurement method provided by the above methods. The method includes: acquiring an orthophoto image of the crude oil leakage area at a preset height; performing target detection on the orthophoto image of the crude oil to identify an initial crude oil area image in the orthophoto image of the crude oil; performing image segmentation on the initial crude oil area image to remove the background area image in the initial crude oil area image to obtain a crude oil area image; and determining the crude oil leakage area based on the number of pixels in the crude oil area image and the area occupied by a single pixel at the preset height.

[0068] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the crude oil leak area measurement method provided by the above methods. The method includes: acquiring an orthophoto image of the crude oil leak area at a preset height; performing target detection on the orthophoto image to identify an initial crude oil region image in the orthophoto image; performing image segmentation on the initial crude oil region image to remove background region images from the initial crude oil region image, thereby obtaining a crude oil region image; and determining the crude oil leak area based on the number of pixels in the crude oil region image and the area occupied by a single pixel at the preset height.

[0069] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0070] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of measuring the area of a crude oil leak, characterized in that, The method comprises the following steps: obtaining an oil positive image of an oil leakage area at a preset height; performing target detection on the oil positive image to identify an initial oil area image in the oil positive image; performing image segmentation on the initial oil area image to remove a background area image in the initial oil area image to obtain an oil area image; determining an oil leakage area based on a number of pixel points in the oil area image and an area of a single pixel point at the preset height.

2. The crude oil spill area measurement method of claim 1, wherein, The image segmentation on the initial oil area image to remove the background area image in the initial oil area image to obtain the oil area image comprises the following steps: selecting a pixel point from the initial oil area image as a current centroid of a first cluster and selecting another pixel point as a current centroid of a second cluster, a distance between the current centroid of the first cluster and a black pixel point being less than a threshold, and a distance between the current centroid of the second cluster and the black pixel point being greater than or equal to the threshold; determining a cluster to which each of the remaining pixel points belongs based on distances from the remaining pixel points to each current centroid; and updating the current centroid in each cluster based on coordinates of each pixel point in each cluster and distances between each pixel point in each cluster and the black pixel point; determining whether the current centroid in each cluster is unchanged or whether the current centroid in each cluster reaches a preset number of updates, and if so, regarding an image formed by all pixel points in the first cluster as the oil area image, and if not, returning to the steps of determining the cluster to which each of the remaining pixel points belongs and updating the current centroid in each cluster.

3. The crude oil spill area measurement method of claim 2, wherein, The updating of the current centroid in each cluster based on the coordinates of each pixel point in each cluster and the distances between each pixel point in each cluster and the black pixel point comprises the following steps: determining a plurality of candidate centroids from each pixel point based on the coordinates of each pixel point in each cluster; 4. The crude oil spill area measurement method of claim 2, wherein, regarding a candidate centroid closest to the black pixel point as the current centroid of the first cluster and regarding a candidate centroid farthest from the black pixel point as the current centroid of the second cluster.

5. The crude oil spill area measurement method according to any one of claims 1 to 4, characterized in that, The distance between the current centroid and the black pixel point is an Euclidean distance. The area of a single pixel point at the preset height is determined based on the following steps: obtaining a rectangular positive image of a rectangular sample at the preset height; 6. The crude oil spill area measurement method of claim 5, wherein, determining the area of a single pixel point at the preset height based on a number of pixel points of the rectangular positive image and an area of the rectangular sample. The determination of the area of a single pixel point at the preset height based on the number of pixel points of the rectangular positive image and the area of the rectangular sample further comprises the following steps:

7. A crude oil spill area measuring device characterized by, performing image threshold segmentation processing and binarization processing on the rectangular positive image in sequence. The method comprises the following steps: an obtaining unit configured to obtain an oil positive image of an oil leakage area at a preset height; an identifying unit configured to perform target detection on the oil positive image to identify an initial oil area image in the oil positive image; a segmentation unit configured to perform image segmentation on the initial oil area image to remove a background area image in the initial oil area image to obtain an oil area image; and a determining unit configured to determine an oil leakage area based on a number of pixel points in the oil area image and an area of a single pixel point at the preset height. A measuring unit is configured to determine the oil leakage area based on the number of pixels in the oil region image and the area of a single pixel at the preset height.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the oil leakage area measurement method according to any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the oil leakage area measurement method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the oil leakage area measurement method according to any one of claims 1 to 6. The computer program is executed by the processor to implement the oil leakage area measurement method according to any one of claims 1 to 6.