Mountain flood channel flow measuring method and measuring system

The flash flood channel flow measurement system, which combines water level meters and cameras with edge computing gateways, solves the problems of high cost and low accuracy in existing technologies, realizes real-time flow monitoring in complex terrain and severe weather conditions, and reduces equipment costs and operation and maintenance expenses.

CN120778080APending Publication Date: 2025-10-14TIANJIN KANTIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510883582.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-29
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Existing methods for measuring flow in flash flood channels are high cost, low accuracy, and difficult to achieve real-time monitoring in complex terrain and severe weather conditions. In particular, the weir-channel flow measurement method requires large-scale civil engineering, the radar velocity measurement method is expensive and easily affected by weather, and the acoustic Doppler flow meter is difficult to deploy long-term.

Method used

The measurement system consists of a water level meter, a camera, and an edge computing gateway. The flow is calculated through water condition image processing and water level depth values. Combined with the improved UNet semantic segmentation algorithm and Manning's formula, real-time calculation and monitoring of the flow is achieved. The system is solar-powered and can adapt to complex terrain and severe weather.

Benefits of technology

It achieves low-cost, high-precision flow measurement in mountain torrent channels, is suitable for complex terrain and adverse weather conditions, has real-time monitoring capabilities, reduces equipment costs and operation and maintenance expenses, and is suitable for long-term deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120778080A_ABST
    Figure CN120778080A_ABST
Patent Text Reader

Abstract

The invention discloses a mountain torrent channel flow measuring method and system. The measuring method comprises the steps that S1, a current water level depth value measured by a water level gauge is transmitted to an edge computing gateway; after the edge calculation gateway receives the water level depth value, the camera is controlled in real time to shoot a water regimen image of the mountain torrent channel to be detected; s2, preprocessing the water regimen image of the mountain torrent channel to be detected, and segmenting the preprocessed water regimen image to obtain a water surface area image; obtaining a two-dimensional cross section contour of the to-be-measured mountain torrent channel according to the water surface area image; s3, calculating the water passing area in the water surface area image according to the two-dimensional cross section contour of the torrential flood channel to be measured; s4, obtaining a water level-water passing area relation model; and S5, calculating the flow of the to-be-measured mountain torrent channel according to the real-time water level depth value of the to-be-measured mountain torrent channel, the water level-water passing area relation model and a Manning formula. The method is high in recognition rate and accuracy, and the system is high in detection precision and high in applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hydrological monitoring, and in particular to a method and system for measuring flow in a mountain torrent channel. Background Art

[0002] Flash flood channels are usually located in mountainous or hilly areas and have the following notable characteristics:

[0003] Complex terrain: the channel slope is steep, the shape is irregular, and the cross-section is variable;

[0004] The flow rate has significant time-varying characteristics: the flood flow rate may rise rapidly in a short period of time, with a large fluctuation range;

[0005] Lack of infrastructure: The lack of stable power supply and communication infrastructure makes traditional civil engineering renovation difficult;

[0006] High demand for disaster early warning: Flash floods occur rapidly, and real-time monitoring and rapid early warning are urgently needed.

[0007] In the application of mountain torrent channel flow measurement, the existing mainstream flow measurement methods have the following shortcomings:

[0008] Weir-channel flow measurement method: It requires the construction of a standard weir-channel structure in the flash flood channel, which involves a large amount of civil engineering and a long construction period. It also significantly alters the natural channel, easily damaging the ecological environment and is difficult to implement in areas with complex terrain.

[0009] Radar velocity measurement: The equipment is expensive and has strict requirements on the installation location and angle. Measurement accuracy is greatly affected in severe weather such as heavy rain and haze, and the radar has limited ability to identify turbulent water surfaces. Radar is a point measurement method, measuring only within a few square meters around the radar measurement point. If the radar measurement point is located in areas with dense vegetation such as aquatic plants, the measurement accuracy of the radar velocity measurement method is easily affected.

[0010] Acoustic Doppler current meter (ADCP): Expensive and mostly used for temporary cross-section velocity profile measurements. Limited by power supply and maintenance conditions, it is difficult to deploy and use long-term. In addition, the measurement error is large in mountain torrent channels with high sediment content or severe water disturbance. Summary of the Invention

[0011] In order to solve the problems existing in the prior art, an object of the present invention is to provide a method for measuring the flow rate of a mountain torrent channel with low cost, high measurement accuracy and reliability.

[0012] Another object of the present invention is to provide a mountain torrent channel flow measurement system for implementing the above method.

[0013] To this end, the present invention adopts the following technical solutions:

[0014] A method for measuring flow in a flash flood channel comprises the following steps:

[0015] S1: The water level meter transmits the current water level depth value H of the flash flood channel to be measured every m minutes to the edge computing gateway and uploads it to the cloud platform. After receiving the water level depth value, the edge computing gateway controls the camera in real time to capture the water condition image of the flash flood channel to be measured.

[0016] S2, preprocessing the water condition image of the flash flood ditch to be measured, segmenting the preprocessed water condition image to obtain a water surface area image, and uploading it to the cloud platform; obtaining a two-dimensional cross-sectional profile of the flash flood ditch to be measured based on the water surface area image;

[0017] S3, calculating the water area S in the water surface area image according to the two-dimensional cross-sectional profile of the flash flood channel to be measured;

[0018] S4, obtaining the water level-water flow area relationship model, the specific steps are as follows:

[0019] S4-1, collecting water regime images and water level depth values ​​of the flash flood channel to be tested at multiple time periods, executing steps S2-S3 for the water regime images and water level depth values ​​collected at each moment, generating multiple sets of sample pairs of water level depth values ​​H and flooded areas S, and forming a sample database;

[0020] S4-2, using the sample pairs in the sample database to fit the water level-water flow area relationship model, to obtain the water level H-water flow area S relationship model of the flash flood channel to be measured, S(H) = aH 2 +bH+c;

[0021] S5. Use the water level gauge in the flash flood ditch flow measurement system to measure the water level depth value H′ of the flash flood ditch to be measured, substitute the measured water level depth value h′ as H into the water level-flow area relationship model of the flash flood ditch to be measured, and calculate the flow area S′ corresponding to the water level depth value; use the Manning formula to calculate the flow Q of the flash flood ditch to be measured based on the flow area S′.

[0022] In the above method, step S2 includes the following sub-steps:

[0023] S21, preprocessing the water regime image of the torrent channel to be measured to obtain a preprocessed water regime image;

[0024] S22, using an improved UNet semantic segmentation algorithm model to segment the water surface area image in the preprocessed water condition image, wherein the loss function of the improved UNet semantic segmentation algorithm model adopts a combination of Dice Loss + BCE Loss;

[0025] S23, obtaining a two-dimensional cross-sectional profile of the torrent channel to be measured based on the water surface area image, specifically comprising:

[0026] S231, obtain the direction vector in the image coordinate system according to any pixel point A(u,v) on the "water surface boundary line" in the water surface area image Direction vector is the direction of the ray from the center of the camera lens to the pixel point A(u,v); using the intrinsic parameter matrix K of the camera, the direction vector in the image coordinate system is Convert to the camera coordinate system to get the direction vector in the camera coordinate system

[0027] Among them, the “water surface boundary line” is the boundary of the water surface area image;

[0028] S232, using the camera's external parameter matrix, the direction vector Converted to the world coordinate system, the calculation formula is as follows:

[0029]

[0030] Where, P world is the three-dimensional coordinate point in the world coordinate system, R is the rotation matrix in the external parameter matrix, R -1 is the inverse matrix of the rotation matrix R, s is the distance scale factor, and the distance scale factor s represents the distance along the direction vector The extension direction is the distance from the center of the camera lens to the intersection with the plane F, and t is the translation vector in the external parameter matrix;

[0031] The rotation matrix R is obtained based on the camera's top-down angle, field of view, and installation height in world coordinates. The translation vector t is obtained by manual measurement of the camera's installation position in world coordinates or based on the camera's construction drawings in world coordinates. The translation vector t is a fixed value. Plane F is a plane parallel to the XOY plane in the world coordinate system. O is the origin of the world coordinate system. The Z-axis coordinates of the three-dimensional coordinate points on plane F are all water depth values ​​H.

[0032] S233, obtain the coordinates of the pixel point A(u,v) in the world coordinate system:

[0033] (1) Obtain the three-dimensional coordinate point P from the center of the camera lens world Vector , so that the vector Intersecting with plane F, we get the coordinate system transformation equation, which is as follows:

[0034] z0+s·d z =H

[0035] Where z0 is the component of the translation vector t along the Z axis in the world coordinate system, d z is a vector The component of the Z axis in the world coordinate system, s is the distance scale factor;

[0036] (2) The distance scale factor s is calculated from the coordinate system conversion equation:

[0037]

[0038] (3) According to the distance scale factor s, the coordinates (X i ,Y i ,Z i ), coordinates (X i ,Y i ,Z i ) is the three-dimensional coordinate point corresponding to the pixel point A(y,v) in the water surface area image in the world coordinate system, where:

[0039] X i =x0+s·d x

[0040] Y i =y0+s·d y

[0041] Z i =H

[0042] Where x0 is the component of the translation vector t in the world coordinate system along the X axis, t0 is the component of the translation vector t in the world coordinate system along the Y axis, and d x is a vector The component of the X axis in the world coordinate system, d y is a vector The component of the Y axis in the world coordinate system;

[0043] S234, obtain the spatial point set and project it onto the cutting plane , The resulting set of points forms a 2D cross-sectional profile:

[0044] Execute S231-S233 for all pixel points on the “water surface boundary line” in the water surface area image to obtain the corresponding coordinates of each pixel point in the world coordinate system and form a spatial point set P s ; Set the spatial point set P s The points are uniformly projected onto a cutting plane perpendicular to the XOZ plane in the world coordinate system to obtain a point set C; a two-dimensional cross-sectional profile is formed based on the point set C.

[0045] Preferably, the preprocessing in step S21 includes distortion correction and illumination compensation.

[0046] Preferably, the value range of m in step S1 is 1-60.

[0047] In the above step S5, the Manning formula is specifically as follows:

[0048]

[0049] Where n is the roughness, S' is the water flow area, R is the hydraulic radius, P is the wetted perimeter and I is the slope value.

[0050] The roughness n in the Manning formula is preset according to the soil type of the ditch slope. When the soil type of the ditch slope to be tested is sandy, the roughness value range is 0.020-0.035; when the soil type of the ditch slope to be tested is rocky, the roughness value range is 0.030-0.050; when the soil type of the ditch slope to be tested is plant-covered, the roughness value range is 0.035-0.070.

[0051] Preferably, in step S1, after the edge computing gateway receives the water level depth value, it also performs water level jump abnormality detection on the water level depth value. If a water level jump abnormality occurs, the camera is controlled in real time to capture the water condition image of the flash flood channel to be tested, and a log is recorded and an alarm strategy is triggered. The method for performing water level jump abnormality detection is:

[0052] When conditions 1 or 2 are met, it is determined that a water level jump abnormality has occurred:

[0053] Condition 1: The difference between the current water level depth value and the water level depth value at the previous moment exceeds the set water level threshold;

[0054] Condition 2: The water level depth values ​​collected at three consecutive moments show jumps in inconsistent directions, wherein the jumps in inconsistent directions are first rising and then falling, or suddenly falling and then rising.

[0055] Preferably, in step S2, a water surface recognition failure detection is further performed on the segmented water surface area image. If the water surface recognition fails, a log is recorded and an alarm strategy is triggered, and the pre-processed water condition image is re-segmented. The method for performing the water surface recognition failure detection is:

[0056] If any of conditions 1 to 3 is met, it is considered that water surface recognition has failed, where:

[0057] Condition 1: The water surface area of ​​the segmented water surface image is 0;

[0058] Condition 2: The water surface area of ​​the segmented water surface image is smaller than the set water surface area threshold;

[0059] Condition 3: The elevation of the water surface boundary of the segmented water surface area image changes dramatically or discontinuously.

[0060] A measurement system for implementing the above-mentioned method for measuring flow in a flash flood channel includes: a water level meter, a solar power supply system, an edge computing gateway, and a camera, wherein:

[0061] The solar power supply system is connected to the edge computing gateway to provide power to it;

[0062] The camera is used to capture water condition images of the flash flood channel to be measured;

[0063] The edge computing gateway is used to control the camera to capture the water condition image of the mountain torrent ditch to be measured, to receive the water condition image collected by the camera and the water level depth value data measured by the water level meter, to calculate the flow of the mountain torrent ditch to be measured based on the water condition image and the water level depth value data, and to control the water level meter to transmit the water level depth value H;

[0064] The water level meter is fixed in the mountain torrent channel and is used to measure the water level depth value data in the mountain torrent channel to be measured;

[0065] The water level meter includes a base and an electronic water gauge installed in the base, and the base is fixed in the ditch of the mountain torrent to be measured;

[0066] The electronic water gauge includes: a housing, a support frame, a measuring circuit board, a positive electrode, multiple negative electrodes, a water level detection unit, a system power supply unit, a signal conditioning unit, an MCU main control unit and a data communication unit; wherein:

[0067] The support frame is vertically mounted on the outer surface of the housing, and the measurement circuit board is vertically embedded and mounted on the support frame, with the back of the measurement circuit board facing outward, and a sealed and fixed connection is formed between the front of the measurement circuit board and the support frame;

[0068] The multiple negative electrodes are divided into two columns and are respectively arranged on both sides of the center line of the back side of the measurement circuit board. The negative electrodes in each column are equidistantly distributed vertically, and the installation height of the negative electrodes on one side is the same as the height of the midpoint of two adjacent negative electrodes on the other side.

[0069] The positive electrode is arranged at the bottom of the back side of the measurement circuit board and is located on the center line of the measurement circuit board; there are one or more positive electrodes, and when there are multiple positive electrodes, the multiple positive electrodes are connected in series;

[0070] The water level detection unit is arranged on the front of the measurement circuit board; the signal conditioning unit, the system power supply unit, the MCU main control unit and the data communication unit are sealed and installed in the housing, wherein:

[0071] The system power supply unit is used to supply power to the signal conditioning unit, the water level detection unit, the MCU main control unit, the positive electrode, and to supply power to each negative electrode separately;

[0072] When the water level submerges the positive electrode and the negative electrode, the signal conditioning unit is used to amplify and filter the analog signal formed by the high and low level difference generated by the circuit conduction, and then send the processed analog signal to the water level detection unit;

[0073] The water level detection unit is used to convert the received analog signal into a digital signal and send it to the MCU main control unit;

[0074] The MCU main control unit is used to process the received digital signal, calculate the actual water level value, store it in real time and send it to the data communication unit;

[0075] The data communication unit is used to send the received actual water level value to the edge computing gateway, and then upload it to the cloud platform.

[0076] In the above system, the method for the water level meter to measure the water level depth of the mountain torrent channel is:

[0077] When the bottom positive electrode and the bottom negative electrode on the measuring circuit board of the electronic water gauge are submerged, they are connected under the action of the water body, generating a high and low level difference, forming an analog signal, and the signal conditioning unit amplifies and filters the analog signal, and sends the processed analog signal to the water level detection unit; the water level detection unit senses the loop conduction or impedance change, converts the received processed analog signal into a corresponding digital signal, and sends it to the MCU main control unit; the MCU main control unit processes the received digital signal, calculates the current water level value, and stores it; after receiving the data transmission command from the edge computing gateway, the current water level depth value is sent to the data communication unit, and the data communication unit sends the actual water level value to the edge computing gateway, and then uploads it to the cloud platform;

[0078] As the water level continues to rise, the second negative electrode is also submerged. At this time, the signal conditioning unit detects the second analog signal and processes it in the same way as above. Similarly, as the water level continues to rise, the water level value is continuously updated.

[0079] Compared with the prior art, the present invention has the following beneficial effects:

[0080] 1. The flash flood channel flow measurement method of the present invention introduces a structural prior information enhancement strategy when performing illumination compensation on water condition images, achieving regional adaptive enhancement and significantly improving the recognizability of water surface areas in extreme lighting environments. In particular, it can still accurately segment water body contours in areas such as tree shade on the shore and bridge shadows.

[0081] 2. Compared with the weir method, the flash flood channel flow measurement method of the application calculates the real-time water section of the flash flood channel through the water surface area image, without the shaping error caused by the standard weir structure, is suitable for natural irregular section, and improves the adaptability and measurement accuracy under complex channel conditions.

[0082] 3. Compared with the radar speed measurement method, the flash flood channel flow measurement method of the application jointly uses the water regime image and water level depth value data, reduces the error influence of single water surface speed measurement in bad weather (such as rainstorm, fog).

[0083] 4. Compared with the method of measuring flow by using acoustic Doppler current profiler, the flash flood channel flow measurement method of the application uses water regime image and water level depth value data, realizes real-time and continuous flow measurement, is suitable for long-term deployment, and is not affected by silt, floating objects and the like.

[0084] 5. The flash flood channel flow measurement system of the application can be installed on the existing terrain of the channel, has small land occupation, does not need large-scale civil engineering, is easy to install and has low installation cost; compared with ADCP and radar equipment, the flash flood channel flow measurement system of the application has lower manufacturing cost, is suitable for large-scale deployment, uses a solar power supply system, and reduces the operation and maintenance cost of the flash flood channel flow measurement system.

[0085] 6. In the electronic water gauge used in the application, the arrangement positions of the positive electrode and the negative electrode are optimized, the up-down spacing of the same side negative electrode is increased, the left-right spacing is as large as possible within the available space range, the size of the positive electrode and the negative electrode is reduced, the unintended conduction of the same side negative electrode and the situation that the water line or mud simultaneously connects the positive electrode and the negative electrode are avoided, and the detection precision is improved.

[0086] 7. The flash flood channel flow measurement system of the application adopts modular design, supports LoRa wireless communication, realizes low-power, long-distance and automatic flow monitoring deployment, has high adaptability and real-time calculation capability, can be continuously operated and easily expanded, and is suitable for flash flood monitoring scenes in mountainous areas, gullies and areas without infrastructure.

[0087] 8. The flash flood channel flow measurement system of the application adopts an edge computing gateway, the water level depth value data and the water regime image are controlled and collected through the edge computing gateway, and calculation and processing are performed in the edge computing gateway, so that the dependence of the flash flood channel flow measurement system on the network is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0088] Figure 1 The flow chart of the flash flood channel flow measurement method of embodiment 1 of the application.

[0089] Figure 2 The composition schematic diagram of the flash flood channel flow measurement system of embodiment 2 is shown in the figure.

[0090] Figure 3 For Figure 2 Amplification structure diagram of water level meter;

[0091] Figure 4 For Figure 2 The three-dimensional structure diagram of the electronic water gauge in the water level meter;

[0092] Figure 5 For Figure 4 The structure diagram of the measurement circuit board in the electronic water gauge;

[0093] Figure 6 For Figure 5 The connection structure diagram of the measurement circuit board and the support frame in the electronic water gauge;

[0094] Figure 7 The measurement circuit principle diagram of the electronic water gauge of one embodiment of the present application.

[0095] In the figure:

[0096] 1. Support frame, 2. Measurement circuit board, 3. Positive electrode, 4. Negative electrode, 5. Fixing screw, 6. Glue hole, 7. Shell,

[0097] 8. Upper cover, 9. Exhaust hole, 10. Wiring interface, 11. Water level meter; 11a. Base; 11b. Electronic water gauge;

[0098] 12. Solar power supply system; 13. Edge computing gateway; 14. Camera; 15. Fixed support. DETAILED DESCRIPTION

[0099] Embodiment 1

[0100] Referring to Figure 1 , a method for measuring the flow of a mountain torrent channel, comprising the following steps:

[0101] S1, collecting the water level depth value data and the water regime image of the mountain torrent channel to be measured:

[0102] The water level meter transmits the measured current water level depth value H of the mountain torrent channel to be measured to the edge computing gateway 13 every m minutes, and uploads it to the cloud platform; after receiving the water level depth value H, the edge computing gateway controls the camera 14 to shoot the water regime image of the mountain torrent channel to be measured in real time. In this embodiment, the value range of m is 1-60.

[0103] S2, preprocessing the water regime image of the mountain torrent channel to be measured, segmenting the preprocessed water regime image to obtain the water surface area image, and uploading it to the cloud platform; obtaining the two-dimensional cross-sectional profile of the mountain torrent channel to be measured according to the water surface area image. The specific steps are as follows:

[0104] S21, pre-processing the water condition image of the torrent channel to be measured to obtain a pre-processed water condition image. The pre-processing includes distortion correction and illumination compensation.

[0105] When performing illumination compensation on water images, a structural prior information enhancement strategy is introduced. This includes applying higher contrast enhancement to areas where pre-determined water surfaces are likely to appear; suppressing distant sky or background content to prevent over-enhancement and false detection; and establishing a "water surface confidence region mask" based on the camera's tilt (top-down perspective) to achieve regional adaptation during the illumination compensation enhancement process. This structural prior information enhancement strategy is based on the spatial preference for water bodies in channel regions in water images.

[0106] S22, obtain the water surface area image:

[0107] The improved UNet semantic segmentation algorithm model (Attention UNet) is used to segment the water surface area image in the preprocessed water condition image, wherein the loss function of the improved UNet semantic segmentation algorithm model adopts the Dice Loss+BCELoss combination.

[0108] The water surface images segmented using the improved UNet semantic segmentation algorithm model provide higher-quality footage for flow calculations. The improved UNet semantic segmentation algorithm model also improves the perception of water surface boundaries in water images. The combined Dice Loss and BCE Loss loss functions improve the improved UNet semantic segmentation algorithm model's performance in detecting small water surfaces in water images.

[0109] S23, obtaining a two-dimensional cross-sectional profile of the torrent channel to be measured based on the water surface area image, specifically comprising:

[0110] S231, convert the direction vector corresponding to the pixel point in the water surface area image to the camera coordinate system:

[0111] According to any pixel point A(u,v) on the "water surface boundary line" in the water surface area image, the direction vector in the image coordinate system is obtained Direction vector is the direction of the ray from the center of the camera lens to the pixel point A(u,v); using the camera's intrinsic parameter matrix K, the direction vector in the image coordinate system is Convert to the camera coordinate system to get the direction vector in the camera coordinate system

[0112] The “water surface boundary line” is the boundary of the water surface area image.

[0113] Wherein, the conversion formula of the direction vector is as follows:

[0114]

[0115] In the formula, u is the coordinate of the pixel point A in the horizontal direction in the water surface area image, v is the coordinate of the pixel point A in the vertical direction in the water surface area image, x c is the X-axis coordinate of the pixel point A in the camera coordinate system, y c is the Y-axis coordinate of the pixel point A in the camera coordinate system, K -1 is the inverse matrix of the intrinsic matrix K.

[0116] S232, convert the direction vector to the world coordinate system:

[0117] The direction vector is converted to the world coordinate system through the extrinsic matrix (rotation matrix R and translation vector t) of the camera, and the calculation formula is as follows:

[0118]

[0119] In the formula, P world is a three-dimensional coordinate point in the world coordinate system, R is a rotation matrix in the extrinsic matrix, R -1 is the inverse matrix of the rotation matrix R, s is a distance scale factor (unknown), the distance scale factor s represents the distance from the camera lens center of the camera to the intersection position with the plane F along the extension direction of the direction vector , and t is a translation vector in the extrinsic matrix.

[0120] Wherein, the rotation matrix R is obtained according to the overhead angle, the field of view angle and the installation height of the camera in the world coordinate; the translation vector t is manually measured according to the installation position of the camera in the world coordinate or obtained according to the construction drawing of the camera in the world coordinate, and the translation vector t is a fixed value; the plane F is a plane parallel to the XOY plane in the world coordinate system, O is the origin of the world coordinate system, and the Z-axis coordinates of the three-dimensional coordinate points on the plane F are all water depth values H.

[0121] S233, obtain the corresponding coordinates of the pixel point A (u, v) in the world coordinate system:

[0122] (1) Obtain the vector pointing from the camera lens center to the three-dimensional coordinate point P world , so that the vector intersects with the plane F, and the coordinate system conversion equation is obtained, which is as follows:

[0123] z0+s·d z =H

[0124] wherein z0is the component of the translation vector t in the Z axis of the world coordinate system, d z is a vector wherein z0is the component of the translation vector t in the Z axis of the world coordinate system, s is a distance scale factor;

[0125] (2) calculating the distance scale factor s from the coordinate system conversion equation:

[0126]

[0127] (3) calculating the coordinates (X i ,Y i ,Z i ) from the distance scale factor s: i ,Y i ,Z i ) are the three-dimensional coordinates corresponding to the pixel point A(u, v) in the water surface area image in the world coordinate system, wherein:

[0128] X i = x0+ s·d x

[0129] Y i = y0+ s·d y

[0130] Z i = H

[0131] wherein x0is the component of the translation vector t in the X axis of the world coordinate system, y0is the component of the translation vector t in the Y axis of the world coordinate system, d x is a vector is a vector y is a vector in the Y axis of the world coordinate system.

[0132] S234, obtaining a spatial point set and projecting it to a section plane , The point set obtained forms a two-dimensional cross-sectional profile:

[0133] S231-S233 are performed on all pixel points on the "water surface boundary line" in the water surface area image to obtain the corresponding coordinates of each pixel point in the world coordinate system and to form a spatial point set P s ; the spatial point set P s is uniformly projected into a section plane perpendicular to the XOZ plane in the world coordinate system to obtain a point set C; and a two-dimensional cross-sectional profile is formed according to the point set C.

[0134] The two-dimensional cross-sectional profile can be used for cross-sectional area calculation and flow estimation and can reflect the real dynamic cross-sectional characteristics of the natural channel with water level changes.

[0135] S3, calculate the cross-sectional area of water:

[0136] The cross-sectional area of water S is obtained from the two-dimensional cross-sectional profile by using numerical integration or polygon area calculation method.

[0137] S4, obtain the water level-cross-sectional area relationship model, the specific steps are as follows:

[0138] S4-1, obtain the sample database:

[0139] In the flood season or non-flood season, the water regime image and water level depth value of the to-be-measured mountain torrent channel in multiple time periods are collected, and the water regime image and water level depth value collected at each time are executed. Step S2-S3, generate multiple sets of sample pairs of water level depth value H and cross-sectional area S, and form a sample database.

[0140] S4-2, fit the water level-cross-sectional area relationship model:

[0141] The water level-cross-sectional area relationship model is fitted by using the sample pairs in the sample database, and the relationship model of the water level h-cross-sectional area S of the to-be-measured mountain torrent channel is obtained, which is as follows:

[0142] S(H)=aH 2 +bH+c

[0143] The water level-cross-sectional area relationship model fitted in step S4-2 is used to quickly estimate the cross-sectional area according to the real-time water level depth data, and the water level-cross-sectional area relationship model provides basic parameters for flow estimation.

[0144] S5, calculate the flow of the to-be-measured mountain torrent channel:

[0145] The water level depth value H' of the to-be-measured mountain torrent channel is measured by using the water level meter, and the measured water level depth value H' is substituted into the water level-cross-sectional area relationship model of the to-be-measured mountain torrent channel as H, and the cross-sectional area S' corresponding to the water level depth value is calculated;

[0146] The Manning formula is used to calculate the flow Q of the to-be-measured mountain torrent channel according to the cross-sectional area S', and the Manning formula is as follows:

[0147]

[0148] In the formula, n is the roughness, S' is the cross-sectional area, R is the hydraulic radius, P is the wet perimeter, which is calculated according to the two-dimensional cross-sectional profile; I is the slope value.

[0149] Wherein, the roughness n is preset according to the soil type of the channel slope, and the value range of the roughness n is shown in Table 1.

[0150] Table 1

[0151]

[0152] Preferably, after the edge computing gateway receives the water level depth value, the water level depth value is also subjected to water level jump anomaly detection, if water level jump anomaly occurs, the real-time control camera is also used to shoot the water regime image of the measured mountain torrent channel, and logs are recorded and alarm strategies are triggered at the same time; wherein the method for water level jump anomaly detection is:

[0153] When condition 1 or 2 is met, it is judged that water level jump anomaly occurs:

[0154] Condition 1, the difference between the current water level depth value and the water level depth value at the previous time exceeds the set water level threshold value;

[0155] Condition 2, the water level depth values collected at three continuous time points appear inconsistent jump in direction, wherein the inconsistent jump in direction is first rising and then falling or sudden drop and sudden rise.

[0156] Preferably, in step S2, the segmented water surface area image is also subjected to water surface recognition failure detection, if water surface recognition fails, logs are recorded and alarm strategies are triggered, and the preprocessed water regime image is segmented again; wherein the method for water surface recognition failure detection is:

[0157] When any one of condition 1 to condition 3 is met, it is judged that water surface recognition fails, wherein:

[0158] Condition 1: the water surface area of the segmented water surface area image is 0;

[0159] Condition 2: the water surface area of the segmented water surface area image is less than the set water surface area threshold value;

[0160] Condition 3: the elevation change of the water surface boundary of the segmented water surface area image is sharp or incoherent (misclassified as sky or bank).

[0161] In an embodiment of the present application, the overhead angle is 45°, the intrinsic matrix of the camera The field of view angle of the camera is horizontal 90° and vertical 60°, the installation height of the camera is 3.5 meters, the translation vector a=0.4524, b=0.5415, c=0.0256, the water level-depth relationship model is as follows:

[0162] S(H)=0.4524·H 2 +0.5415·H+0.0256

[0163] The water level depth value H' is 0.72 meters, and the cross-sectional area S' is 0.6499 m 2, the two-dimensional cross-sectional profile shape in step S234 is approximately trapezoidal, the water surface width is 1.2 meters, the bottom width is 0.6 meters, the wet perimeter P is 1.8 m, the hydraulic radius R is 0.36 m, the slope value I is 0.01, the flow rate Q is 0.95 m 3 / s, the water level threshold is set to 50 cm / min, and the water surface area threshold is set to 0.5% of the water regime image area.

[0164] The error between the flow rate obtained by the flash flood channel flow measurement method of the present application and the flow rate measured by manual measurement is within 5%, so the flash flood channel flow measurement method of the present application has high measurement accuracy.

[0165] Embodiment 2

[0166] Referring to Figure 1 and Figure 2 A measurement system for performing the flash flood channel flow measurement method in embodiment 1, comprising: a water level meter 11, an edge computing gateway 13, a camera 14, and a solar power supply system 12.

[0167] As shown in Figure 3 , the camera 14 is installed on the shore high or the fixed support 15, close to the top end of the edge computing gateway 13, the camera 14 is used to shoot the water regime image of the measured flash flood channel, the camera has night vision light supplement function and wide-angle shooting function, the power management and control of the camera are realized through the edge computing gateway, and the running power consumption of the camera is reduced.

[0168] As shown in Figure 4 , the edge computing gateway 13 is connected with the solar power supply system 12, the edge computing gateway is installed on the top end of the fixed support, the edge computing gateway is used to control the camera to shoot the water regime image of the measured flash flood channel, the edge computing gateway is used to receive the water regime image collected by the camera and the water level depth value data measured by the water level meter, and the edge computing gateway is also used to calculate the flow rate of the measured flash flood channel according to the water regime image and the water level depth value data.

[0169] The water level meter 11 is fixed in the flash flood channel (the bottom of the ditch), which is used to measure the water level depth value data in the measured flash flood channel.

[0170] Referring to Figure 3-Figure 6The water level gauge 11 comprises a base 11a and an electronic water gauge 11b. The base 11a is approximately conical and comprises a bottom surface, a top surface and a side surface. A bottom-through cavity is formed in the base, and a reserved hole is arranged on the top of the base for fixing and mounting the electronic water gauge 11b in the cavity. A flow outlet is formed on the back surface of the base and communicates with the cavity. The side surface of the base is composed of a plurality of arc-shaped flow guide surfaces to reduce the impact force of the water flow. The arc-shaped flow guide surfaces and the flow guide ridges formed thereon form an optimized attack angle, guide the high-speed water flow to both sides and upwards, convert the front impact energy into lateral kinetic energy, and reduce the scouring effect of the water flow on the bottom of the base, thereby adapting to the high-impact scenario in the early stage of mountain flood (such as debris flow). In addition, although not shown in the figure, a silt discharge groove is arranged at the middle position of the base bottom (on the side facing the water flow), and the rear end of the silt discharge groove communicates with the cavity, so as to wash away the silt accumulated in the cavity by the water flow.

[0171] The electronic water gauge 11b comprises a shell 7, a support frame 1, a measurement circuit board 2, a plurality of positive electrodes 3, a plurality of negative electrodes 4, a water level detection unit, a system power supply unit, a signal conditioning unit, an MCU main control unit and a data communication unit. Specifically as follows:

[0172] The support frame 1 is vertically mounted on the outer surface of the shell 7, and the measurement circuit board 2 is vertically embedded and mounted on the support frame 1, and the two are fixedly connected by fixing screws 5.

[0173] The plurality of positive electrodes 3 are welded on the center line of the back surface of the measurement circuit board 2 in the vertical direction. In the embodiment shown in the figure, there are 4 positive electrodes, of which 2 positive electrodes are in the middle of the back surface of the measurement circuit board, and the other 2 positive electrodes are respectively located at the upper and bottom parts of the back surface of the measurement circuit board.

[0174] In this embodiment, the four positive electrodes and two fixing screws 5 are arranged at equal intervals on the center line of the back surface of the measurement circuit board 2. This design optimizes the appearance design without affecting the function. Multiple positive electrodes are arranged to avoid damage to the positive electrode at the bottom of the back surface of the measurement circuit board 2, which would result in failure to measure. In fact, only one positive electrode is needed at the bottom.

[0175] The plurality of negative electrodes 4 are divided into two columns and are welded on both sides of the center line (vertical direction) of the back surface of the measurement circuit board 2, and each column of negative electrodes 4 is distributed at equal intervals. The installation height of the negative electrodes on one side is the same as the height of the midpoint of the two negative electrodes adjacent to each other on the other side.

[0176] As Figure 3As shown, the support frame 1 of the electronic water gauge is provided with multiple glue injection holes 6. In the embodiment shown in the figure, there are eight glue injection holes 6, distributed on both sides of the centerline of the support frame 1. These injection holes 6 are used to inject sealant into the gap between the support frame 1 and the front surface of the measurement circuit board 2, thereby forming a sealing layer between the support frame 1 and the front surface of the measurement circuit board 2, preventing the front surface of the measurement circuit board 2 (the side adjacent to the support frame 1) from being soaked by water. The support frame 1 is also provided with vent holes 9 to exhaust gas during sealant injection to prevent the formation of bubbles and seal failure.

[0177] A wiring interface 10 is also provided on the support frame 1, and a wiring hole is also formed at a corresponding position on the housing 7. These are used by the system power supply unit to supply power to the positive electrode 3, negative electrode 4, and water level detection unit, as well as for data transmission between the positive electrode 3, negative electrode 4 and the signal conditioning unit, water level detection unit, and MCU main control unit. After the wiring is completed, the wiring interface 10 needs to be sealed with glue.

[0178] In the embodiment shown in the figure, the housing 7 is a barrel-shaped structure, and the upper cover 8 covers the upper opening of the housing 7, forming a seal therebetween to prevent water from entering the housing.

[0179] The water level detection unit is arranged on the front of the measurement circuit board 2 (not shown in the figure); the signal conditioning unit, system power supply unit, MCU main control unit and data communication unit are sealed and installed in the housing 7 (not shown in the figure).

[0180] See also Figure 4 , the system power supply unit is used to supply power to the signal conditioning unit, water level detection unit, MCU main control unit, positive electrode 3 and negative electrode 4, and to supply power to each negative electrode 4 separately and to the positive electrodes 3 in series. When the water level rises and submerges the positive electrode 3 and negative electrode 4, causing the circuit to conduct and produce a high and low level difference, the signal conditioning unit amplifies and filters the analog signal formed at this time, and then sends the processed analog signal to the water level detection unit. The water level detection unit is used to convert the received analog signal into a digital signal and send it to the MCU main control unit. The MCU main control unit is used to process the received digital signal, calculate the actual water level value and send it to the data communication unit. The data communication unit is used to send the received actual water level value to the edge computing gateway, and then upload it to the cloud platform

[0181] In addition, although not shown in the figure, a water level value is also set on the inner side of each negative electrode 4 on the measurement circuit board 2 (the side close to the positive electrode), and the water level value is the actual water level value at the negative pole.

[0182] The working principle of electronic water gauge 11b is as follows:

[0183] See also Figures 2 to 4 The system power supply unit applies a detection electrical signal, such as a pulse signal or an AC signal, to the positive electrode and each negative electrode simultaneously through the wiring interface 10. When there is no water, the negative electrodes are not connected, while the positive electrodes are connected (i.e., they share a common ground); see Figure 4 , when the water level rises from bottom to top, the first Figure 2 The bottom positive electrode in the middle and the bottom negative electrode on the left side are connected to the circuit under the action of rainwater, generating a high and low level difference, forming an analog signal. The signal conditioning unit amplifies and filters the analog signal and sends the processed analog signal to the water level detection unit. The water level detection unit senses the loop conduction or impedance change, converts the received processed analog signal into a corresponding digital signal, and sends it to the MCU main control unit. The MCU main control unit processes the received digital signal, calculates the current water level value, and stores it; after receiving the data transmission command from the edge computing gateway, it sends the current water level depth value to the data communication unit, and the data communication unit sends the actual water level value to the edge computing gateway, and then uploads it to the cloud platform.

[0184] As the water level continues to rise, the bottom negative electrode on the right side is also submerged. At this time, the signal conditioning unit detects the second analog signal and processes it in the same way as above. And so on, as the water level continues to rise, the water level value is continuously updated.

[0185] When the water level does not change, the last water level depth value stored in the MCU main control unit is the current water level depth value.

[0186] In one embodiment of the present invention, the data communication unit is a LoRa communication component.

Claims

1. A method for measuring flow in a mountain torrent channel, characterized in that: The following steps are involved: S1, the water level meter transmits the current water level depth value H of the flash flood channel to be measured every m minutes to the edge computing gateway and uploads it to the cloud platform; After receiving the water level depth value, the edge computing gateway controls the camera in real time to capture water condition images of the flash flood channel to be measured; S2, preprocessing the water condition image of the flash flood channel to be measured, segmenting the preprocessed water condition image to obtain the water surface area image, and uploading it to the cloud platform; Obtain the two-dimensional cross-sectional profile of the flash flood channel to be measured based on the water surface area image; S3, calculating the water area S in the water surface area image according to the two-dimensional cross-sectional profile of the flash flood channel to be measured; S4, obtaining the water level-water flow area relationship model, the specific steps are as follows: S4-1, collecting water regime images and water level depth values ​​of the flash flood channel to be tested at multiple time periods, executing steps S2-S3 for the water regime images and water level depth values ​​collected at each moment, generating multiple sets of sample pairs of water level depth values ​​H and flooded areas S, and forming a sample database; S4-2, using the sample pairs in the sample database to fit the water level-water flow area relationship model, to obtain the water level H-water flow area S relationship model of the flash flood channel to be measured, S(H) = aH 2 +bH+c; S5. Use the water level gauge in the flash flood ditch flow measurement system to measure the water level depth value H′ of the flash flood ditch to be measured, substitute the measured water level depth value H′ as H into the water level-flow area relationship model of the flash flood ditch to be measured, and calculate the flow area S′ corresponding to the water level depth value; use the Manning formula to calculate the flow Q of the flash flood ditch to be measured based on the flow area S′.

2. The method for measuring flow in a mountain torrent channel according to claim 1, characterized in that: Step S2 includes the following specific steps: S21, preprocessing the water regime image of the torrent channel to be measured to obtain a preprocessed water regime image; S22, using an improved UNet semantic segmentation algorithm model to segment the water surface area image in the preprocessed water condition image, wherein the loss function of the improved UNet semantic segmentation algorithm model adopts a combination of Dice Loss + BCE Loss; S23, obtaining a two-dimensional cross-sectional profile of the torrent channel to be measured based on the water surface area image, specifically comprising: S231, obtain the direction vector in the image coordinate system according to any pixel point A(u,v) on the "water surface boundary line" in the water surface area image Direction vector is the direction of the ray from the center of the camera lens to the pixel point A(u,v); using the intrinsic parameter matrix K of the camera, the direction vector in the image coordinate system is Convert to the camera coordinate system to get the direction vector in the camera coordinate system Among them, "water surface boundary line" is the boundary of the water surface area image; S232, using the camera's external parameter matrix, the direction vector Converted to the world coordinate system, the calculation formula is as follows: Where, P world is the three-dimensional coordinate point in the world coordinate system, R is the rotation matrix in the external parameter matrix, R -1 is the inverse matrix of the rotation matrix R, s is the distance scale factor, and the distance scale factor s represents the distance along the direction vector The extension direction is the distance from the center of the camera lens to the intersection with the plane F, and t is the translation vector in the external parameter matrix; The rotation matrix R is obtained based on the camera's top-down angle, field of view, and installation height in world coordinates. The translation vector t is obtained by manual measurement of the camera's installation position in world coordinates or based on the camera's construction drawings in world coordinates. The translation vector t is a fixed value. Plane F is a plane parallel to the XOY plane in the world coordinate system. O is the origin of the world coordinate system. The Z-axis coordinates of the three-dimensional coordinate points on plane F are all water level depth values ​​H. S233, obtain the coordinates of the pixel point A(u,v) in the world coordinate system: (1) Obtain the three-dimensional coordinate point P from the center of the camera lens world Vector So that the vector Intersecting with plane F, we get the coordinate system transformation equation, which is as follows: z0+s·d z =H Where z0 is the component of the translation vector t along the Z axis in the world coordinate system, d z is a vector The component of the Z axis in the world coordinate system, s is the distance scale factor; (2) The distance scale factor s is calculated from the coordinate system conversion equation: (3) According to the distance scale factor s, the coordinates (X i ,Y i ,Z i ), coordinates (X i ,Y i ,Z i ) is the three-dimensional coordinate point corresponding to the pixel point A(u,v) in the water surface area image in the world coordinate system, where: X i =x0+s·d x Y i =y0+s·d y Z i =H Where x0 is the component of the translation vector t on the X axis in the world coordinate system, y0 is the component of the translation vector t on the Y axis in the world coordinate system, and d x is a vector The component of the X axis in the world coordinate system, d y is a vector The component of the Y axis in the world coordinate system; S234, obtain the spatial point set and project it onto the cutting plane , The resulting set of points forms a 2D cross-sectional profile: Execute S231-S233 for all pixel points on the "water surface boundary line" in the water surface area image to obtain the corresponding coordinates of each pixel point in the world coordinate system and form a spatial point set P s ; Set the spatial point set P s The points are uniformly projected onto a cutting plane perpendicular to the XOZ plane in the world coordinate system to obtain a point set C; a two-dimensional cross-sectional profile is formed based on the point set C.

3. The method for measuring flow in a mountain torrent channel according to claim 2, characterized in that: The preprocessing in step S21 includes distortion correction and illumination compensation.

4. The method for measuring flow in a mountain torrent channel according to claim 1, characterized in that: The value range of m in step S1 is 1 to 60.

5. The method for measuring flow in a mountain torrent channel according to claim 1, characterized in that: The Manning formula in step S5 is as follows: Where n is the roughness, S' is the water flow area, R is the hydraulic radius, O is the wetted perimeter and I is the slope value.

6. The method for measuring flow in a mountain torrent channel according to claim 5, characterized in that: The roughness n in the Manning formula is preset according to the soil type of the ditch slope. When the soil type of the ditch slope to be tested is sandy, the roughness value range is 0.020-0.035; when the soil type of the ditch slope to be tested is rocky, the roughness value range is 0.030-0.050; when the soil type of the ditch slope to be tested is plant-covered, the roughness value range is 0.035-0.

070.

7. The method for measuring flow in a mountain torrent channel according to claim 1, characterized in that: In step S1, after receiving the water level depth value, the edge computing gateway also performs water level jump abnormality detection on the water level depth value. If a water level jump abnormality occurs, the camera is controlled in real time to capture the water condition image of the flash flood channel to be tested, and a log is recorded and an alarm strategy is triggered. The method for performing water level jump abnormality detection is as follows: When conditions 1 or 2 are met, it is determined that a water level jump abnormality has occurred: Condition 1: The difference between the current water level depth value and the water level depth value at the previous moment exceeds the set water level threshold; Condition 2: The water level depth values ​​collected at three consecutive moments show jumps in inconsistent directions, wherein the jumps in inconsistent directions are first rising and then falling, or suddenly falling and then rising.

8. The method for measuring flow in a mountain torrent channel according to claim 1, characterized in that: In step S2, the segmented water surface area image is also subjected to water surface recognition failure detection. If the water surface recognition fails, a log is recorded and an alarm strategy is triggered, and the pre-processed water condition image is re-segmented. The method for performing water surface recognition failure detection is as follows: If any of conditions 1 to 3 is met, it is considered that water surface recognition has failed, where: Condition 1: The water surface area of ​​the segmented water surface image is 0; Condition 2: The water surface area of ​​the segmented water surface image is smaller than the set water surface area threshold; Condition 3: The elevation of the water surface boundary of the segmented water surface area image changes dramatically or discontinuously.

9. A measurement system for implementing the method for measuring mountain torrent channel flow according to any one of claims 1 to 9, characterized in that: include: Water level gauge, solar power system, edge computing gateway, and camera, including: The solar power supply system is connected to the edge computing gateway to provide power to it; The camera is used to capture water condition images of the flash flood channel to be measured; The edge computing gateway is used to control the camera to capture the water condition image of the mountain torrent ditch to be measured, to receive the water condition image collected by the camera and the water level depth value data measured by the water level meter, to calculate the flow of the mountain torrent ditch to be measured based on the water condition image and the water level depth value data, and to control the water level meter to transmit the water level depth value H; The water level meter is fixed in the mountain torrent channel and is used to measure the water level depth value data in the mountain torrent channel to be measured; The water level meter includes a base and an electronic water gauge installed in the base, and the base is fixed in the ditch of the mountain torrent to be measured; The electronic water gauge includes: a housing, a support frame, a measuring circuit board, a positive electrode, multiple negative electrodes, a water level detection unit, a system power supply unit, a signal conditioning unit, an MCU main control unit and a data communication unit; wherein: The support frame is vertically mounted on the outer surface of the housing, and the measurement circuit board is vertically embedded and mounted on the support frame, with the back of the measurement circuit board facing outward, and a sealed and fixed connection is formed between the front of the measurement circuit board and the support frame; The multiple negative electrodes are divided into two columns and are respectively arranged on both sides of the center line of the back side of the measurement circuit board. The negative electrodes in each column are equidistantly distributed vertically, and the installation height of the negative electrodes on one side is the same as the height of the midpoint of two adjacent negative electrodes on the other side. The positive electrode is arranged at the bottom of the back side of the measurement circuit board and is located on the center line of the measurement circuit board; there are one or more positive electrodes, and when there are multiple positive electrodes, the multiple positive electrodes are connected in series; The water level detection unit is arranged on the front of the measurement circuit board; the signal conditioning unit, the system power supply unit, the MCU main control unit and the data communication unit are sealed and installed in the housing, wherein: The system power supply unit is used to supply power to the signal conditioning unit, the water level detection unit, the MCU main control unit, the positive electrode, and to supply power to each negative electrode separately; When the water level submerges the positive electrode and the negative electrode, the signal conditioning unit is used to amplify and filter the analog signal formed by the high and low level difference generated by the circuit conduction, and then send the processed analog signal to the water level detection unit; The water level detection unit is used to convert the received analog signal into a digital signal and send it to the MCU main control unit; The MCU main control unit is used to process the received digital signal, calculate the actual water level value, store it in real time and send it to the data communication unit; The data communication unit is used to send the received actual water level value to the edge computing gateway, and then upload it to the cloud platform.

10. The measuring system according to claim 9, characterized in that The method for measuring the water level depth of the mountain torrent channel by the water level meter is: When the bottom positive electrode and the bottom negative electrode on the measuring circuit board of the electronic water gauge are submerged, they are connected under the action of the water body, generating a high and low level difference, forming an analog signal, and the signal conditioning unit amplifies and filters the analog signal, and sends the processed analog signal to the water level detection unit; the water level detection unit senses the loop conduction or impedance change, converts the received processed analog signal into a corresponding digital signal, and sends it to the MCU main control unit; the MCU main control unit processes the received digital signal, calculates the current water level value, and stores it; after receiving the data transmission command from the edge computing gateway, the current water level depth value is sent to the data communication unit, and the data communication unit sends the actual water level value to the edge computing gateway, and then uploads it to the cloud platform; As the water level continues to rise, the second negative electrode is also submerged. At this time, the signal conditioning unit detects the second analog signal and processes it in the same way as above. Similarly, as the water level continues to rise, the water level value is continuously updated.