Drainage outlet flow rate rapid detection method and device based on unmanned aerial vehicle
By using drones equipped with cameras and laser rangefinders, combined with image processing and mathematical models, the size and flow rate of drainage outlets can be automatically calculated, solving the problem of time-consuming and labor-intensive traditional manual inspections and achieving rapid and accurate drainage outlet flow detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA INST OF ENVIRONMENTAL SCI MEP
- Filing Date
- 2023-08-10
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional methods of manually inspecting drainage outlets are time-consuming, labor-intensive, and costly. Even when drones are combined with manual on-site inspections, detailed information still needs to be obtained through manual methods. In existing technologies, determining flow velocity based on motion characteristics is impractical, and real drainage images lack obvious indicators.
By using drones equipped with cameras and laser rangefinders, the size and flow velocity of drainage outlets can be automatically obtained through image processing and mathematical model calculations. Combined with the Manning formula, the flow rate can be calculated, reducing human intervention.
It enables rapid and accurate detection of drainage outlet flow, reduces human resource input and costs, improves investigation efficiency, and reduces environmental and personnel safety risks.
Smart Images

Figure CN117029937B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition in computer vision, and in particular to a method and apparatus for rapid detection of drainage outlet flow based on unmanned aerial vehicles (UAVs). Background Technology
[0002] In urban drainage systems, drainage outlets are crucial facilities used to discharge rainwater and wastewater, preventing flooding and waterlogging. Traditional manual inspection methods are time-consuming, labor-intensive, and costly. Although drone-assisted inspection solutions are available, relying solely on the long-range flight capabilities of drones to locate drainage outlets still requires combining this with manual on-site inspections to obtain detailed information about the outlets.
[0003] Current technologies that rely on motion features to determine the flow velocity of water exiting a drain are unrealistic. Real-world drainage images lack obvious indicators such as buoys for motion feature calibration. Motion feature algorithms tend to focus on identifying edge bubbles, which typically face greater air resistance during descent and therefore cannot accurately reflect the water flow velocity.
[0004] Therefore, there is a need to provide a device and method that can effectively shorten the investigation time and streamline the investigation process. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a method and apparatus for rapid detection of drainage outlet flow based on unmanned aerial vehicles (UAVs). By utilizing the mobility and high degree of automation of UAVs, it reduces the input of human resources, improves inspection efficiency, and lowers related costs. At the same time, it can also reduce the potential risks to the environment and personnel safety posed by manual inspections.
[0006] To achieve the above objectives, the present invention is implemented according to the following technical solution:
[0007] The first objective of this invention is to provide a rapid method for detecting the flow rate of a drainage outlet based on an unmanned aerial vehicle (UAV), comprising the following steps:
[0008] S1. Operate the drone equipped with a camera and laser rangefinder to fly near the drainage outlet. Continue to operate the drone to fly directly in front of the drainage outlet, obtain a front view image of the drainage outlet through the camera, and obtain the distance to the drainage outlet through the laser rangefinder. If the drone cannot fly directly in front of the drainage outlet, operate the drone to fly directly above the drainage outlet, obtain a top view image of the drainage outlet through the camera, obtain the distance to the drainage outlet through the laser rangefinder, and vertically deform the top view image of the drainage outlet. For regular drainage outlets, adjust according to the horizontal diameter. For irregular drainage outlets, it is necessary to measure the top view angle and adjust it in combination with the distance measurement information to obtain a corrected front view image of the drainage outlet outline.
[0009] S2. Obtain the edge points of the drain outlet by using an edge detection algorithm or manual point setting on the front view image and / or the front view correction image of the drain outlet outline, and then determine the water surface outline by using an edge contour algorithm to obtain the drain outlet filling degree h / D, i.e., water depth / drain outlet inner diameter.
[0010] S3. Calculate the inner diameter of the drainage outlet by scaling the distance measurement information. The scaling ratio is calibrated based on the prefabricated drainage outlet model.
[0011] S4. Operate the drone to a fixed altitude and fly to the side of the drain outlet to obtain a side view image of the drain outlet through the camera, and then proceed to step S5; if the drone flies to a fixed altitude but cannot fly to the side of the drain outlet to obtain a side view image of the drain outlet through the camera, then proceed to step S6.
[0012] S5. Determine the water flow centerline of the drain outlet based on the side view image of the drain outlet, then calculate the outflow velocity of the drain outlet based on the water flow path of the drain outlet, and then calculate the outflow rate of the drain outlet using the inner diameter of the drain outlet, the outflow velocity, and the fullness through the outflow cross-section and the velocity.
[0013] S6. Calculate the outflow rate of the drain outlet using the Manning formula by combining the preset slope with the fullness.
[0014] Further, step S2 specifically involves: calculating the gradient of the grayscale image of the frontal view correction image of the drain outlet using the Sobel operator, and performing thresholding on the gradient image; then performing binarization, setting pixels with gradient values below a certain threshold to 0, and pixels with gradient values above another threshold to the maximum value; simultaneously, employing double thresholding, treating pixels located between the two thresholds as weak edges, and performing further processing; then filtering out the edge points of the drain outlet in the center of the image through spatial clustering analysis, and performing morphological operations, such as erosion and dilation, on the binarized edge image to eliminate noise on the edges or fill broken edges; for the frontal view correction image of the drain outlet contour that the edge detection algorithm cannot handle, manually confirming the edges by pinpointing them; finally, determining the water surface contour through the edge contour algorithm to obtain the drain outlet fullness h / D, i.e., water depth / drain outlet inner diameter.
[0015] Furthermore, the manual positioning methods include: using three-point positioning for circular edges, using five-point positioning for elliptical edges, and using endpoint positioning for parallelogram edges.
[0016] Further, step S5 specifically includes:
[0017] S51. Obtain the feature point set of water flow;
[0018] S52. Obtain a subset of feature points of water flow through random sampling;
[0019] S53. Fit a parabola based on the points in the subset: Since the actual water flow only contains half of the parabola, the central axis of the parabola needs to be fixed to prevent overfitting for the accuracy of the algorithm; for the parabola y = ax 2 +bx+c, where the axis is x=-b / 2a, therefore it is necessary to specify that -b / 2a is exactly equal to the edge position of the drain outlet in the image;
[0020] S54. Calculate the Euclidean distance between other points in the feature point set and the parabola;
[0021] S55. Determine the number of points that are sufficiently close to the parabola based on a preset threshold.
[0022] S56. Repeat steps S52-S55 until the parabola with the maximum number of nearest neighbors is obtained, which is the central axis of the water flow.
[0023] S57. The process of decomposing horizontal motion and free fall motion according to the parabola equation is as follows:
[0024]
[0025] x = x0 + v x t;
[0026] Substituting into the equation of the parabola, we get:
[0027]
[0028] Obviously, x0 = -b / 2a, which simplifies to the outflow velocity of the drain outlet:
[0029]
[0030] S58. Calculate the outflow rate of the drain outlet by using the inner diameter of the drain outlet, the outflow velocity, and the fullness of the outlet through the outflow cross-section and the velocity.
[0031] Furthermore, Manning's formula can be expressed as:
[0032] Q = (1 / n) * A * R^(2 / 3) * S^(1 / 2)
[0033] Where: Q represents flow rate, in meters (m). 3 / s;
[0034] n is the Manning coefficient of friction, which has no unit.
[0035] A is the cross-sectional area of the pipe, in meters (m²). 2 It is calculated based on the inner diameter of the drain outlet and the degree of filling.
[0036] R is the hydraulic radius, in meters, defined as the cross-sectional area of the pipe divided by the wetted perimeter, calculated based on the pipe diameter and the degree of filling.
[0037] S represents the hydraulic gradient, measured in m / m.
[0038] The second objective of this invention is to provide a drone-based rapid flow detection device for drainage outlets, comprising a drone equipped with a camera and a laser rangefinder, and a ground host that performs the aforementioned drone-based rapid flow detection method for drainage outlets. The ground host and the drone transmit data via a wireless network. The drone transmits images of the drainage outlet and laser rangefinder results back to the ground host, and the ground host performs the aforementioned drone-based rapid flow detection method for drainage outlets to quickly estimate the outflow rate of the drainage outlet.
[0039] Compared with existing technologies, this invention allows on-site personnel to simply operate a drone to complete specific flight maneuvers around the outlet to acquire information about it, without needing to go above the outlet or enter the waterway to use handheld instruments for measurement. Furthermore, this technology can effectively identify the volume of drainage water, significantly improving accuracy compared to the empirical estimation methods used in previous inspections. Thirdly, this technology, combined with the drone's waypoint recording and cruise functions, enables rapid review of historical drainage outlets. Attached Figure Description
[0040] Figure 1 This is a flowchart of the present invention.
[0041] Figure 2 This is a schematic diagram of the process of correcting the outline of the drain outlet. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0043] Example 1
[0044] like Figure 1 As shown in the figure, this embodiment specifically discloses a method for rapid detection of drainage outlet flow based on unmanned aerial vehicles (UAVs), including the following steps:
[0045] S1. Operate the drone equipped with a camera and laser rangefinder to fly near the drain outlet. Continue operating the drone to fly directly in front of the drain outlet, using the camera to obtain a frontal view of the drain outlet and the laser rangefinder to determine the distance to the drain outlet. If the drone cannot fly directly in front of the drain outlet, operate it to fly directly above and in front of the drain outlet, using the camera to obtain a top-down view of the drain outlet and the laser rangefinder to determine the distance to the drain outlet. Then, vertically deform the top-down view of the drain outlet. For regular drain outlets, adjust the vertical diameter (or height) to match the horizontal diameter (or width). For irregular drain outlets, measure the top-down angle again and adjust it in conjunction with the distance measurement information to obtain a corrected frontal view of the drain outlet. The correction method is as follows:
[0046] The measured downward angle α, which is the angle between the line connecting the camera and the center of the drain outlet (the viewing angle line) and the horizontal plane where the camera is located, is α, and the distance is L. The captured image needs to be corrected to be perpendicular to the viewing angle line. For example... Figure 2 As shown, the angle between the corrected plane and the plane containing the drain outlet is geometrically equal to the downward angle. Therefore, the distance L1 between the point on the drain outlet where the angle line falls and the upper edge on the corrected plane should be corrected to cosα of the original distance. The distance between the lower edge and the upper edge on the corrected plane is 2cosα. The remaining pixels are corrected using interpolation. Meanwhile, L1 calculated using L will be too large, so it is denoted as L'1. Since the downward angle is generally small and the distance between the device and the drain outlet is relatively large, L'1tanα can be used to estimate the amount L should be reduced. Therefore, the corrected distance is:
[0047] L c =L-L'1tanα;
[0048] S2. Obtain the edge points of the drain outlet by using an edge detection algorithm or manual point setting on the front view image and / or the front view correction image of the drain outlet outline, and then determine the water surface outline by using an edge contour algorithm to obtain the filling degree h / D of the drain outlet, i.e., water depth / drain outlet inner diameter.
[0049] Specifically, the Sobel operator is used to calculate the gradient of the grayscale image of the corrected frontal view of the drain outlet outline. Thresholding is then applied to the gradient image, and the gradient of a single pixel requires the calculation of the horizontal gradient value G. x and vertical gradient value G y The square root of the sum of squares, but in practical engineering, the simplified gradient is usually used, i.e., G = |G|. x |+|G y The Sobel operator requires the application of grayscale values surrounding the pixel. The specific algorithm is as follows: If we assume the grayscale values of the nine pixels from left to right and from top to bottom in a nine-grid centered on the pixel being calculated are p1 to p9, then the horizontal gradient value of the center point is G. x= (p3-p1)+2(p6-p4)+(p9-p7), the vertical gradient value is G y =(p7-p1)+2(p8-p2)+(p9-p3);
[0050] Subsequently, binarization is performed, setting pixels with gradient values below a certain threshold to 0 and pixels with gradient values above another threshold to the maximum value. Simultaneously, a dual-threshold processing method is used, identifying pixels between the two thresholds as weak edges and further processing them. Then, spatial clustering analysis is used to filter out the edge points of the drain outlet in the center of the image, and morphological operations, such as erosion and dilation, are performed on the binarized edge image to eliminate noise or fill broken edges. For the drain outlet contour frontal correction image that the edge detection algorithm cannot handle, manual point positioning is used to confirm the edges. Manual point positioning methods include: three-point positioning for circular edges, five-point positioning for elliptical edges, and endpoint positioning for parallelogram edges. Finally, the water surface contour is determined using an edge contour algorithm to obtain the drain outlet filling degree h / D, i.e., water depth / drain outlet inner diameter.
[0051] S3. The inner diameter of the drain outlet is obtained by scaling the distance measurement information. The scaling ratio is calibrated based on the prefabricated drain outlet model. The relationship between the distance between the observation point and the observed object and the length during observation is expressed using angles and trigonometric functions from trigonometry. Assuming the drain outlet diameter is D, the distance between the observation point and the observed object is d, the distance between observation points (line of sight) is B, and the angle between observation points is θ (in radians), then the pixel length l during observation can be expressed as:
[0052]
[0053] Based on the prefabricated model, the pixel length variation with distance when the detection equipment observes a certain pipe diameter can be calibrated, thus fitting the value of the line-of-sight baseline. It is easy to see that the ratio of the actual pipe diameter to the model pipe diameter during observation is equal to the ratio of their pixel lengths in the image. Therefore, the dimensional relationship between the actual drainage outlet and the prefabricated drainage outlet model at the actual observation distance can be further derived as follows:
[0054]
[0055] Then the actual diameter of the drain outlet pipe can be calculated.
[0056] S4. After acquiring the pipe diameter information, the drone needs to fly to a fixed altitude to the side of the drain outlet and take pictures to obtain a side view image of the water outlet, thereby determining the flow rate information of the drainage. Current technology that relies on motion features to determine the flow rate of the water outlet is unrealistic, as real drainage images do not have obvious indicators such as buoys for motion feature calibration. Motion feature algorithms focus on identifying edge bubbles, which typically face greater air resistance during descent and cannot accurately reflect the water flow rate. Therefore, it is necessary to acquire a side view image of the water outlet to analyze the flow rate from the fluid path. Specifically, the drone is manipulated to fly to a fixed altitude and to the side of the drain outlet to acquire a side view image of the drain outlet via a camera, then step S5 is executed; if the drone cannot fly to the side of the drain outlet to acquire a side view image via a camera, then step S6 is executed.
[0057] S5. In a continuously flowing outlet, the air resistance of most of the fluid in the center is negligible. Therefore, the water flow basically follows a parabola when it leaves the outlet. However, the actual outflow will also become irregular in shape due to the air action. Traditional edge algorithms are not sufficient to abstract the geometric flow of the water. Estimating the outflow velocity requires obtaining the parabolic formula parameters of the water flow centerline. Therefore, the water flow centerline of the outlet is determined based on the side view of the outlet. Then, the outflow velocity of the outlet is calculated based on the water flow path. Subsequently, the outflow rate of the outlet is calculated using the outlet inner diameter, outflow velocity, and fullness through the outflow cross-section and velocity.
[0058] S51. Obtain the feature point set of water flow;
[0059] S52. Obtain a subset of feature points of water flow through random sampling;
[0060] S53. Fit a parabola based on the points in the subset: Since the actual water flow only contains half of the parabola, the central axis of the parabola needs to be fixed to prevent overfitting for the accuracy of the algorithm; for a parabola in the xy coordinate system, it can be expressed as y = ax 2 +bx+c, where a, b, and c are constant coefficients, and the central axis of the parabola is x=-b / 2a. Therefore, it is necessary to stipulate that the x-coordinate of the edge position of the drain outlet in the image should be exactly equal to -b / 2a.
[0061] S54. Calculate the Euclidean distance between other points in the feature point set and the parabola;
[0062] S55. Determine the number of points that are sufficiently close to the parabola based on a preset threshold.
[0063] S56. Repeat steps S52-S55 until the parabola with the maximum number of nearest neighbors is obtained, which is the central axis of the water flow.
[0064] S57. The process of decomposing horizontal motion and free fall motion according to the parabola equation is as follows:
[0065]
[0066] x = x0 + v x t;
[0067] Substituting into the equation of the parabola, we get:
[0068]
[0069] According to S53, x0 = -b / 2a, which simplifies to the outflow velocity of the drain outlet:
[0070]
[0071] S58. For flow rate calculation of a circular drain outlet, the inner diameter D of the drain outlet and the outflow velocity v are given. x and fill degree h / D,
[0072] Calculate the cross-sectional area A of the water:
[0073]
[0074] Calculate the outflow rate of the drain outlet:
[0075] Q = A * Vx
[0076] Flow rate calculation for a rectangular drain outlet, assuming width b and height D:
[0077]
[0078] S6. Calculate the outflow rate of the drain outlet using the Manning formula, which is derived from the preset slope and the degree of fullness. The Manning formula is expressed as:
[0079] Q=(1 / n)*A*R^(2 / 3)*S^(1 / 2);
[0080] Where: Q represents flow rate, in meters (m). 3 / s;
[0081] n is the Manning coefficient of friction, which has no unit.
[0082] A is the cross-sectional area of the water body, in meters. 2 It is calculated based on the inner diameter of the drain outlet and the degree of filling.
[0083] R is the hydraulic radius, in meters (m), defined as the cross-sectional area of the pipe divided by its wetted perimeter. It is calculated based on the pipe diameter and the degree of filling. For a rectangular cross-section... A circular cross-section with radius r is in
[0084] S represents the hydraulic gradient, measured in m / m.
[0085] Example 2
[0086] This embodiment specifically provides a drone-based rapid flow detection device for drainage outlets, including a drone equipped with a camera and a laser rangefinder, and a ground host that executes the drone-based rapid flow detection method for drainage outlets shown in Embodiment 1. The ground host and the drone transmit data via a wireless network. The drone transmits images of the drainage outlet and laser rangefinder results back to the ground host. The ground host executes the drone-based rapid flow detection method for drainage outlets shown in Embodiment 1 to quickly estimate the outflow rate of the drainage outlet.
[0087] By implementing the above technical solutions, drainage outlet inspection only requires operating a drone to complete specific flight maneuvers around the outlet to obtain information about it, without having to go above the outlet or enter the waterway to use handheld instruments for measurement. In addition, the technology can effectively identify the amount of drainage water, and its accuracy is greatly improved compared with the empirical estimation methods used in previous inspection work. Thirdly, the technology, combined with the drone's waypoint recording and cruise functions, can quickly review historical drainage outlets.
[0088] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.
Claims
1. A method for rapid detection of drainage outlet flow rate based on unmanned aerial vehicles (UAVs), characterized in that, Includes the following steps: S1. Operate the drone equipped with a camera and laser rangefinder to fly near the drainage outlet. Continue to operate the drone to fly directly in front of the drainage outlet, obtain a front view image of the drainage outlet through the camera, and obtain the distance to the drainage outlet through the laser rangefinder. If the drone cannot fly directly in front of the drainage outlet, operate the drone to fly directly in front of and above the drainage outlet, obtain a top view image of the drainage outlet through the camera, obtain the distance to the drainage outlet through the laser rangefinder, and vertically deform the top view image of the drainage outlet. For regular drainage outlets, adjust according to the horizontal diameter. For irregular drainage outlets, measure the top view angle and adjust it in combination with the distance measurement information to obtain a corrected front view image of the drainage outlet outline. S2. Obtain the edge points of the drain outlet by using an edge detection algorithm or manual point setting on the front view image and / or the front view correction image of the drain outlet outline, and then determine the water surface outline by using an edge contour algorithm to obtain the drain outlet filling degree h / D, i.e., water depth / drain outlet inner diameter. S3. Calculate the inner diameter of the drainage outlet by scaling the distance measurement information. The scaling ratio is calibrated based on the prefabricated drainage outlet model. S4. Operate the drone to a fixed altitude and fly to the side of the drain outlet to obtain a side view image of the drain outlet through the camera, and then proceed to step S5; if the drone flies to a fixed altitude but cannot fly to the side of the drain outlet to obtain a side view image of the drain outlet through the camera, then proceed to step S6. S5. Determine the water flow centerline of the drain outlet based on the side view image, then calculate the outflow velocity of the drain outlet based on the water flow path, and subsequently calculate the outflow rate of the drain outlet using the inner diameter of the drain outlet, the outflow velocity, and the fullness of the outlet through the outflow cross-section and the flow velocity; Step S5 specifically includes: S51. Obtain the feature point set of water flow; S52. Obtain a subset of feature points of water flow through random sampling; S53. Fit the parabola based on the points in the subset: Since the motion of real water flow only contains half of the parabola, in order to ensure the accuracy of the algorithm, it is necessary to fix the central axis of the parabola to prevent overfitting. For parabola The central axis is Therefore, regulations are needed. It is exactly equal to the edge position of the drain outlet in the image; S54. Calculate the Euclidean distance between other points in the feature point set and the parabola; S55. Determine the number of points sufficiently close to the parabola based on a preset threshold. S56. Repeat steps S52-S55 until the parabola with the maximum number of nearest neighbors is obtained, which is the central axis of the water flow. S57. The process of decomposing horizontal motion and free fall motion according to the parabola equation is as follows: ; Substituting into the equation of the parabola, we get: ; Obviously The outflow velocity of the drain outlet can be obtained by simplification: ; S58. Calculate the outflow rate of the drain outlet by using the inner diameter of the drain outlet, the outflow velocity, and the fullness of the outlet through the outflow cross-section and the velocity. S6. Calculate the outflow rate of the drain outlet using the Manning formula, which is derived from the preset slope and the degree of fullness. The Manning formula is expressed as: ; Where: Q is the flow rate, in m³ / s; n is the Manning coefficient of friction, which has no unit. A is the cross-sectional area of the pipe, in m², which is calculated based on the inner diameter of the drain outlet and the degree of filling. R is the hydraulic radius, in meters, defined as the cross-sectional area of the pipe divided by the wetted perimeter, calculated based on the pipe diameter and the degree of filling. S represents the hydraulic gradient, measured in m / m.
2. The method for rapid detection of drainage outlet flow rate based on UAV according to claim 1, characterized in that, Step S2 specifically involves: calculating the gradient of the grayscale image of the frontal view correction image of the drain outlet using the Sobel operator, and thresholding the gradient image; then performing binarization, setting pixels with gradient values below a certain threshold to 0, and pixels with gradient values above another threshold to the maximum value; simultaneously, employing double thresholding, treating pixels between the two thresholds as weak edges, and further processing them; then, using spatial clustering analysis to filter out the edge points of the drain outlet in the center of the image, and performing morphological operations on the binarized edge image to eliminate noise on the edges or fill broken edges; for the frontal view correction image of the drain outlet contour that the edge detection algorithm cannot process, manually fixing points to confirm the edges; finally, using the edge contour algorithm to determine the water surface contour and thus obtain the drain outlet fullness h / D, i.e., water depth / drain outlet inner diameter.
3. The method for rapid detection of drainage outlet flow rate based on UAV according to claim 2, characterized in that, The methods for manually positioning include: using three-point positioning for circular edges, five-point positioning for elliptical edges, and endpoint positioning for parallelogram edges.
4. A rapid flow detection device for drainage outlets based on unmanned aerial vehicles (UAVs), characterized in that, The system includes a drone equipped with a camera and a laser rangefinder, and a ground host that performs the drone-based rapid flow detection method for drainage outlets as described in any one of claims 1-3. The ground host and the drone transmit data via a wireless network. The drone transmits images of the drainage outlet and laser rangefinder results back to the ground host. The ground host performs the drone-based rapid flow detection method for drainage outlets as described in any one of claims 1-3 to quickly estimate the outflow rate of the drainage outlet.