River flow determination method and device, electronic equipment and storage medium

By combining video frame recognition and radar correction technologies from floating and shore-based cameras, the accuracy and coverage issues of traditional river flow measurement methods under high flow velocity or severe hydrological conditions have been resolved, enabling accurate and stable measurement of river flow.

CN122192445APending Publication Date: 2026-06-12CHINA YANGTZE POWER

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA YANGTZE POWER
Filing Date
2026-02-12
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional methods for measuring river flow are easily affected by water flow under high flow velocity or severe hydrological conditions, are cumbersome to operate, and are difficult to obtain the velocity distribution across the entire cross section, thus failing to accurately reflect the spatial variation of river flow velocity.

Method used

By combining floating and shore-based cameras, the floating cameras acquire local high-precision flow velocities, while the shore-based cameras acquire global flow velocity distributions. Through video frame recognition and correction processing, combined with radar equipment for flow velocity correction and data fusion, accurate measurement of the flow velocity distribution across the entire cross-section is achieved.

Benefits of technology

It enables accurate and stable measurement of river flow under high flow velocity or severe hydrological conditions, improves the accuracy and full cross-sectional coverage of flow velocity data, reduces systematic errors, and ensures the accuracy and reliability of flow calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122192445A_ABST
    Figure CN122192445A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of river flow, and particularly relates to a river flow determination method and device, electronic equipment and a storage medium. A first water surface video frame collected by at least one floating camera corresponding to a flow section of a target river is acquired; each first water surface video frame is identified to determine a first initial surface flow rate corresponding to each first water surface video frame; a second water surface video frame collected by at least one shore-based camera corresponding to the flow section of the target river is acquired; each second water surface video frame is identified to determine a second initial surface flow rate corresponding to each second water surface video frame; and based on the first initial surface flow rate and the second initial surface flow rate, a target river flow of the flow section corresponding to the target river is determined. The accuracy of the flow rate data is ensured, full-section coverage is achieved, and the final calculated flow result is more accurate and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of river flow technology, specifically to methods, apparatus, electronic devices, and storage media for determining river flow. Background Technology

[0002] River flow monitoring is a crucial foundational task in hydrological and water resources management, flood control, and water resources development and utilization. The accuracy of its data directly supports important decisions such as water resources allocation, water conservancy project design, and water environment assessment. Traditional river flow measurement methods typically involve placing measuring equipment directly into the water body to obtain flow velocity data. Typical techniques include: Velocimeter method: using propeller or cup-type velocimeters to measure point flow velocity, combined with multi-point measurements to estimate cross-sectional flow rate; Acoustic Doppler Current Profiler (ADCP): based on the Doppler effect, measuring the velocity profile at different depths in the water body, enabling rapid acquisition of cross-sectional velocity distribution.

[0003] However, while the aforementioned contact method has high measurement accuracy, it has limitations such as being susceptible to water flow interference, being cumbersome to operate, being difficult to operate under high flow velocity or severe hydrological conditions, having a certain impact on navigation, and being unable to obtain the full cross-sectional flow velocity distribution, thus failing to accurately reflect the spatial changes in river flow velocity (such as the difference in flow velocity between the bank and the center, backflow zones, etc.).

[0004] Therefore, there is an urgent need for a method that can obtain the velocity distribution across the entire cross section to achieve accurate and stable measurement of river flow. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus, electronic device and storage medium for determining river flow, so as to provide a method that can obtain the flow velocity distribution across the entire cross section and achieve accurate and stable measurement of river flow.

[0006] In a first aspect, the present invention provides a method for determining river flow, the method comprising: acquiring first water surface video frames captured by at least one floating camera corresponding to a flow measurement section of a target river; each floating camera being mounted on a floating platform corresponding to the target river, the floating platform being mounted on the water surface corresponding to the target river; each first water surface video frame corresponding to a first preset range of water surface; identifying each first water surface video frame to determine a first initial surface velocity corresponding to each first water surface video frame; acquiring second water surface video frames captured by at least one shore-based camera corresponding to a flow measurement section of the target river; the shore-based camera being mounted on the riverbank corresponding to the target river; the second water surface video frames corresponding to a second preset range of water surface, the second preset range of water surface being larger than the first preset range of water surface; identifying each second water surface video frame to determine a second initial surface velocity corresponding to each second water surface video frame; and determining the target river flow at the flow measurement section corresponding to the target river based on each first initial surface velocity and each second initial surface velocity.

[0007] The river flow determination method provided in this application acquires a first water surface video frame from a floating camera. The floating camera, close to the water surface, can capture fine textures and movement details of the local water surface. Furthermore, the floating platform adaptively adjusts with water level changes, stably covering the target local area, laying a data foundation for subsequent high-precision local flow velocity acquisition. A first initial surface flow velocity is determined. Flow velocity is calculated based on the close-range, high-detail first water surface video frame, resulting in higher local flow velocity accuracy. This can serve as a "benchmark reference" for subsequent global flow velocity calibration, reducing system errors. A second water surface video frame from a shore-based camera is acquired. The shore-based camera, located at a higher elevation, has a much wider field of view than the floating camera, capturing water surface movement across the entire flow measurement cross-section, compensating for the limitations of the floating camera's "local field of view" and achieving global water surface monitoring. A second initial surface flow velocity is determined. Based on the wide-coverage second water surface video frame, the flow velocity distribution trend across the entire cross-section can be initially obtained, providing a "global framework" for subsequent fusion of high-precision local data, avoiding flow calculation deviations caused by limited field of view. Data fusion to determine target river flow: By combining local high-precision first velocity (calibration benchmark) with global wide-coverage second velocity (distribution frame), the accuracy of velocity data is guaranteed and full cross-section coverage is achieved, resulting in more accurate and reliable flow calculation results.

[0008] In one optional implementation, identifying each first water surface video frame and determining the first initial surface velocity corresponding to each first water surface video frame includes: for each first water surface video frame, selecting at least one consecutive first water surface image from the first water surface video frames; performing distortion correction and orthorectification processing on each first water surface image, and performing brightness normalization and noise suppression processing to obtain processed first target images; performing background motion consistency analysis on each first target image to generate a background motion model; determining the target foreground region in each first target image based on the background motion model; detecting the target foreground region to determine non-water body interference objects in the target foreground region in each first target image. The target location is determined by: 1) the location of the non-aquatic interfering object in each first target image; 2) the target location is converted into a first target mask in each first target image; 3) the mask corresponding to the target location is different from the masks corresponding to other locations; 4) the target mask region vector corresponding to the target location is set to invalid; 5) the vector of the target mask region is filled using the surrounding water surface region vector corresponding to the target mask region to obtain a first target vector field; 6) feature matching and pixel displacement estimation are performed on each first target vector field to output a pixel-level motion vector field; 7) the pixel-level motion vector field is divided by the inter-frame time interval to convert it into a water surface velocity vector field; 8) the water surface velocity vector field is mapped to the physical coordinate system to obtain the first initial surface flow velocity.

[0009] The river flow determination method provided in this application selects N consecutive first water surface images and establishes temporal correlation through continuous frame sampling, providing a stable temporal data foundation for subsequent analysis and ensuring the continuity of motion feature extraction. Distortion correction and orthorectification are performed on each first water surface image, followed by brightness normalization and noise suppression to obtain processed first target images. Lens distortion and perspective errors are eliminated, brightness is unified, and noise is suppressed, enhancing the spatiotemporal consistency of water surface texture and improving the accuracy of subsequent motion analysis. Then, a normal water surface flow pattern benchmark is established through background motion consistency analysis, providing a reference framework for identifying abnormal moving targets. The target foreground region is determined, and regions inconsistent with the background motion pattern are accurately separated, effectively extracting interfering targets that may affect flow velocity calculation. Next, non-aquatic interference objects are detected, identifying and locating vessels, floating objects, and other interference objects to avoid misleading the water surface flow velocity analysis and improve the purity of flow velocity calculation. Then, a first target mask is generated, clearly marking the interference area through the mask, providing spatial positioning basis for subsequent targeted processing and achieving separation of the interference area from the normal area. The process involves several steps: First, a mask region vector is created to directly eliminate erroneous vector data from interfering areas, thus removing the influence of interference on the velocity field at its source. Then, a mask region vector is filled in using surrounding valid data to fill in the interference areas, ensuring the spatial continuity and integrity of the velocity field and avoiding computational biases caused by missing data. Finally, a pixel-level motion vector field is output, obtaining dense motion information through feature matching to provide fine-grained pixel-level displacement data for velocity calculation. This data is then converted into a surface velocity vector field, transforming the displacement information into velocity dimensions to establish a velocity description corresponding to actual physical motion. Finally, the data is mapped to a physical coordinate system, achieving a transformation from image pixel space to real physical space, resulting in a surface velocity with practical physical meaning, providing a direct basis for subsequent flow rate calculations.

[0010] In one optional implementation, determining the target river flow rate at the flow measurement section corresponding to the target river channel based on each first initial surface velocity and each second initial surface velocity includes: acquiring the second initial surface velocity obtained by a radar device on a floating platform measuring the surface velocity of a first target point within a first preset range of water surface; correcting the first initial surface velocity based on the second initial surface velocity to obtain a first backup surface velocity; and determining the target river flow rate at the flow measurement section corresponding to the target river channel based on the first backup surface velocity and the second initial surface velocity.

[0011] The river flow determination method provided in this application utilizes radar equipment on a floating platform to directly measure the flow velocity at a specific target point, obtaining a high-precision single-point reference flow velocity, providing a reliable "true value" benchmark for the image-based inversion results. The initial surface flow velocity is calibrated using radar measurement data to eliminate potential systematic errors in optical flow calculations, improving the quantitative accuracy of the overall flow velocity field and making the local flow velocity distribution closer to reality. The target river flow is determined by combining the calibrated high-precision local flow velocity (first backup surface flow velocity) with broad-coverage global flow velocity information, achieving accurate calculation of the entire cross-section flow, balancing accuracy and spatial coverage, and improving the reliability of the final flow inversion.

[0012] In one optional implementation, the first initial surface flow velocity is corrected based on the second initial surface flow velocity to obtain a first backup surface flow velocity, including: mapping the first target point to a target pixel in the first water surface video frame; obtaining the surface flow velocity of the pixel corresponding to the target pixel; calculating the surface flow velocity difference between the pixel surface flow velocity and the second initial surface flow velocity; and correcting the first initial surface flow velocity based on the surface flow velocity difference to obtain the first backup surface flow velocity.

[0013] The river flow determination method provided in this application accurately maps physical points measured by radar to pixel coordinates of video frames through spatial registration, establishing a one-to-one correspondence between the radar ground truth and the image-based flow velocity, providing an accurate spatial reference for subsequent comparisons. The surface flow velocity of each pixel is obtained, and the corresponding pixel's flow velocity is calculated using the image-based method, serving as the original data to be corrected and providing basic data support for subsequent difference calculations. The calculated flow velocity difference is directly compared with the radar ground truth and the image-based method results, quantifying the deviation between the two, clarifying the correction requirements and direction, and providing a basis for adaptive adjustment. Based on the surface flow velocity difference, the flow velocity field is corrected by using single-point deviation to deduce the global correction coefficient, performing a consistent adjustment on the entire first initial surface flow velocity field. This retains the spatial distribution advantages of the image-based method while incorporating the high-precision characteristics of radar, significantly improving the quantitative accuracy of the flow velocity field.

[0014] In one optional implementation, determining the target river flow rate at the flow measurement section corresponding to the target river channel based on the first backup surface velocity and the second initial surface velocity includes: acquiring the overlapping water surface range between the second preset range water surface and the first preset range water surface; determining the maximum spatial resolution among the spatial resolutions corresponding to the first water surface video frame and the second water surface video frame; dividing the overlapping water surface range into multiple sub-grids according to the maximum spatial resolution; determining the sub-second initial surface velocity corresponding to each sub-grid based on the second initial surface velocity; downsampling the first water surface video frame according to the size of each sub-grid, and determining the sub-first backup surface velocity corresponding to each sub-grid based on the first backup surface velocity; Based on the sub-second initial surface velocity and the sub-first alternative surface velocity corresponding to each sub-grid, a surface velocity vector pair corresponding to each sub-grid is generated; based on the surface velocity vector pair corresponding to each sub-grid, a correction coefficient is calculated using the least squares method; based on the correction coefficient, the second initial surface velocity is corrected to obtain the second alternative surface velocity; based on each second alternative surface velocity, the target channel flow rate of the flow measurement section corresponding to the target channel is determined.

[0015] The river flow determination method provided in this application identifies the intersection area of ​​two fields of view by acquiring overlapping water surface ranges, providing a unified spatial basis for multi-source data comparison and registration, and ensuring that subsequent analysis is conducted within the same geographical area. The maximum spatial resolution is determined by selecting a lower precision resolution as the benchmark to avoid registration errors caused by resolution differences, ensuring data comparison at the same scale. The overlapping range is divided into regular sub-grids by gridding the continuous overlapping area, facilitating data matching and calculation on a unit-by-unit basis, improving the efficiency and accuracy of subsequent processing. A second initial flow velocity is determined for each sub-grid, mapping the global flow velocity of the shore-based system onto a unified grid, providing a reference flow velocity for large-scale observation of each sub-grid. Downsampling the first video frame reduces the high-precision data of the floating platform to a unified grid scale, eliminating inconsistencies caused by resolution differences and facilitating direct comparison with shore-based data. Surface flow velocity vector pairs are generated to establish a "shore-platform" flow velocity correspondence on each sub-grid, forming a sample set to provide data support for subsequent correction. Least square correction coefficients are calculated based on multiple pairs of sub-grid flow velocity data, obtaining the optimal correction parameters through statistical methods to ensure minimal overall error and improve global consistency. Correction coefficients were applied to adjust the global velocity field of the shore-based system, ensuring consistency with platform data in overlapping areas and improving overall accuracy. Finally, the target channel flow rate was calculated based on the corrected global velocity field, balancing the advantages of wide coverage and high-precision measurement to obtain more reliable final results.

[0016] In one optional implementation, determining the target river flow rate of the flow measurement section corresponding to the target river channel based on each of the second candidate surface velocities includes: acquiring the current wind speed and current wind direction angle corresponding to the flow measurement section; constructing a wind-induced velocity profile based on the current wind speed and current wind direction angle; correcting each of the second candidate surface velocities based on the wind-induced velocity profile to obtain the target surface velocity corresponding to each of the second candidate surface velocities; and determining the target river flow rate of the flow measurement section corresponding to the target river channel based on each target surface velocity.

[0017] The river flow determination method provided in this application acquires real-time meteorological data, including current wind speed and wind direction, to provide input for subsequent wind-induced effect modeling, making the flow velocity calculation more closely reflect actual environmental conditions. A wind-induced velocity profile is constructed, establishing a wind-induced velocity distribution model perpendicular to the water surface based on wind speed and direction, accurately describing the degree of wind influence at different water depths. The second alternative surface velocity is corrected by removing the wind-induced drift component from the surface velocity, eliminating the systematic bias of wind interference on the measurement results and obtaining a more realistic water flow velocity. The target river flow is determined using the wind-disturbed velocity field for flow calculation, significantly improving the accuracy of flow inversion, especially suitable for open water areas or windy weather conditions.

[0018] In one optional implementation, determining the target channel flow rate at the flow measurement section corresponding to the target channel based on the target surface velocity includes: obtaining initial entropy parameters; calculating a current entropy parameter correction term corresponding to each second candidate surface velocity based on the wind-induced velocity profile velocity, each second candidate surface flow, and the initial entropy parameters; calculating a velocity distribution reduction factor corresponding to each second candidate surface velocity based on each current entropy parameter correction term; multiplying each target surface velocity by the corresponding velocity distribution reduction factor to obtain the target average velocity corresponding to each target surface velocity; determining the initial channel flow rate at the flow measurement section corresponding to the target channel based on each target average velocity; and determining the target channel flow rate based on the initial channel flow rate.

[0019] The river flow determination method provided in this application obtains initial entropy parameters to provide a starting point for calculation. Reasonable initial values ​​are set based on existing experience or historical data to ensure stable convergence in subsequent iterations. The current entropy parameter correction term is calculated, and the entropy parameter is dynamically adjusted in conjunction with aeolian profiles and measured surface velocities, making the model more adaptable to real-time flow conditions and improving the match between theory and reality. The velocity distribution conversion coefficient is calculated to transform the entropy parameter into a directly applicable correction factor, realizing the physical conversion from surface velocity to vertical average velocity, providing a crucial bridge for flow calculation. The target average velocity is obtained by converting it to the average velocity of each vertical line through coefficient conversion, avoiding systematic errors caused by estimating only surface velocity and improving the accuracy of cross-sectional velocity distribution. The initial river flow is determined based on a more accurate vertical average velocity to calculate the preliminary flow, providing high-quality basic data for the final result. The target river flow is determined by combining multi-source data fusion and quality control to output the final flow result, balancing accuracy and reliability to meet the needs of actual hydrological monitoring.

[0020] In a second aspect, the present invention provides a river flow determination device, the device comprising: The first acquisition module is used to acquire first water surface video frames captured by at least one floating camera corresponding to the flow measurement section of the target river; each floating camera is installed on a floating platform corresponding to the target river, and the floating platform is installed on the water surface corresponding to the target river; each first water surface video frame corresponds to a first preset range of water surface; The first determining module is used to identify each first water surface video frame and determine the first initial surface flow velocity corresponding to each first water surface video frame. The second acquisition module is used to acquire a second water surface video frame collected by at least one shore-based camera corresponding to the flow measurement section of the target river channel; the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to a second preset range of water surface, which is larger than a first preset range of water surface. The second determining module is used to identify each second water surface video frame and determine the second initial surface flow velocity corresponding to each second water surface video frame. The third determining module is used to determine the target river flow rate at the flow measurement section corresponding to the target river channel based on each first initial surface velocity and each second initial surface velocity.

[0021] The river flow determination device provided in this application acquires a first water surface video frame from a floating camera. The floating camera, close to the water surface, can capture fine textures and movement details of the local water surface. Furthermore, the floating platform adaptively adjusts with water level changes, stably covering the target local area, laying a data foundation for subsequent high-precision local flow velocity acquisition. A first initial surface flow velocity is determined. Flow velocity is calculated based on the close-range, high-detail first water surface video frame, resulting in higher local flow velocity accuracy. This can serve as a "benchmark reference" for subsequent global flow velocity calibration, reducing system errors. A second water surface video frame is acquired from a shore-based camera: the shore-based camera, located at a higher elevation, has a much wider field of view than the floating camera, capturing water surface movement across the entire flow measurement cross-section, compensating for the limitations of the floating camera's "local field of view," and achieving global water surface monitoring. A second initial surface flow velocity is determined: based on the wide-coverage second water surface video frame, the flow velocity distribution trend across the entire cross-section can be initially obtained, providing a "global framework" for subsequent fusion of high-precision local data, avoiding flow calculation deviations caused by limited field of view. Data fusion to determine target river flow: By combining local high-precision first velocity (calibration benchmark) with global wide-coverage second velocity (distribution frame), the accuracy of velocity data is guaranteed and full cross-section coverage is achieved, resulting in more accurate and reliable flow calculation results.

[0022] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the river flow determination method of the first aspect or any corresponding embodiment described above.

[0023] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the river flow determination method of the first aspect or any corresponding embodiment described above.

[0024] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the river flow determination method of the first aspect or any corresponding embodiment thereof. Attached Figure Description

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

[0026] Figure 1 This is a flowchart illustrating a method for determining river flow according to an embodiment of the present invention; Figure 2 This is a schematic diagram showing the installation positions of the floating camera and the shore-based camera according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a second preset range water surface and a first preset range water surface according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating another method for determining river flow according to an embodiment of the present invention; Figure 5 This is a flowchart illustrating another method for determining river flow according to an embodiment of the present invention; Figure 6 This is a structural block diagram of a river flow determination device according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

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

[0028] It should be noted that the method for determining river flow provided in this application can be executed by a device for determining river flow. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The electronic device can be a server or a terminal. In this application embodiment, the server can be a single server or a server cluster composed of multiple servers. The terminal in this application embodiment can be a smartphone, personal computer, tablet computer, wearable device, or other intelligent hardware device such as an intelligent robot. The following method embodiments will use an electronic device as an example for explanation.

[0029] According to an embodiment of the present invention, a method for determining river flow is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] This embodiment provides a method for determining river flow, which can be used in the aforementioned electronic equipment. Figure 1 This is a flowchart of a river flow determination method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the first water surface video frame captured by at least one floating camera corresponding to the flow measurement section of the target river channel.

[0031] Each floating camera is mounted on a floating platform corresponding to the target river channel, and the floating platform is mounted on the water surface corresponding to the target river channel. Each first water surface video frame corresponds to a first preset range of water surface. The first preset range of water surface is usually a local area centered on the floating platform, and the size of the range is determined by the camera focal length and installation height, and must include sufficient water surface texture features.

[0032] The floating platform is installed on the surface of the target river channel and can adaptively adjust to changes in water level. A floating camera is fixed to the platform with its lens facing the water. The floating camera should be kept stable to minimize the impact of platform swaying; the lens axis should be as perpendicular to the water surface as possible; and protective measures should ensure the equipment operates safely in the water.

[0033] Electronic devices can acquire the first water surface video frames captured by each floating camera based on the communication connection between the electronic devices and each floating camera.

[0034] The floating camera is recommended to have a resolution of 1080p or higher to ensure clear texture details. The frame rate should be 25-30fps to balance temporal resolution and data volume. The floating camera will wirelessly transmit the first video frame from the water surface back to the electronic device in real time.

[0035] Step S102: Identify each first water surface video frame and determine the first initial surface flow velocity corresponding to each first water surface video frame.

[0036] Specifically, the electronic device can input each first water surface video frame into a preset surface velocity recognition model to determine the first initial surface velocity corresponding to each first water surface video frame.

[0037] This step will be explained in detail below.

[0038] Step S103: Obtain the second water surface video frame captured by at least one shore-based camera corresponding to the flow measurement section of the target river channel.

[0039] The shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to a second preset water surface range, which is larger than the first preset water surface range. For example, as shown... Figure 2 The diagram shows the installation locations of the floating camera and the shore-based camera. For example, as shown... Figure 3 The diagram shown is a schematic of the second preset range water surface and the first preset range water surface.

[0040] Specifically, electronic devices can acquire wider-coverage video of the water surface using shore-based cameras installed on the riverbank, obtaining the flow velocity distribution trend across the entire cross-section and providing a global framework for subsequent data fusion with floating cameras. The shore-based cameras can be high-definition industrial cameras or network cameras (1080p or higher), equipped with motorized zoom lenses for easy remote adjustment of the field of view, and featuring wide dynamic range capabilities to adapt to reflective water conditions. The shore-based cameras are installed on high ground near the target river section, in a location with an unobstructed view, ensuring coverage of the entire measurement section and sufficient upstream and downstream areas. The lens axis of the shore-based cameras maintains an appropriate downward angle (30°-60°) to the water surface and is fixed using a stable bracket to reduce the impact of wind vibration. Install waterproof, dustproof, and anti-fog protective covers, and install lightning protection devices to ensure safe operation.

[0041] The shore-based camera has a resolution of 1920×1080 or higher and a frame rate of 25-30fps to ensure continuous motion information. The exposure time is 1 / 500s-1 / 1000s to reduce water surface blur.

[0042] The second preset range of water surface covers the entire flow measurement section, and it is recommended to include an extension area of ​​10%-20% upstream and downstream of the section to ensure that complex flow patterns such as main flow and backflow can be observed.

[0043] The electronic device acquires a second water surface video frame captured by at least one shore-based camera corresponding to the flow measurement section of the target river channel based on the communication connection between the electronic device and the shore-based camera.

[0044] Step S104: Identify each second water surface video frame and determine the second initial surface flow velocity corresponding to each second water surface video frame.

[0045] Specifically, the electronic device can input each second water surface video frame into a preset surface velocity recognition model to determine the second initial surface velocity corresponding to each second water surface video frame.

[0046] This step will be explained in detail below.

[0047] Step S105: Based on each first initial surface velocity and each second initial surface velocity, determine the target river flow rate at the flow measurement section corresponding to the target river channel.

[0048] Specifically, the electronic device can calculate the target surface velocity corresponding to the target channel based on each first initial surface velocity and each second initial surface velocity, and then determine the target channel flow rate of the flow measurement section corresponding to the target channel based on the target surface velocity corresponding to the target channel.

[0049] This step will be explained in detail below.

[0050] The river flow determination method provided in this application acquires a first water surface video frame from a floating camera. The floating camera, close to the water surface, can capture fine textures and movement details of the local water surface. Furthermore, the floating platform adaptively adjusts with water level changes, stably covering the target local area, laying a data foundation for subsequent high-precision local flow velocity acquisition. A first initial surface flow velocity is determined. Flow velocity is calculated based on the close-range, high-detail first water surface video frame, resulting in higher local flow velocity accuracy. This can serve as a "benchmark reference" for subsequent global flow velocity calibration, reducing system errors. A second water surface video frame from a shore-based camera is acquired. The shore-based camera, located at a higher elevation, has a much wider field of view than the floating camera, capturing water surface movement across the entire flow measurement cross-section, compensating for the limitations of the floating camera's "local field of view" and achieving global water surface monitoring. A second initial surface flow velocity is determined. Based on the wide-coverage second water surface video frame, the flow velocity distribution trend across the entire cross-section can be initially obtained, providing a "global framework" for subsequent fusion of high-precision local data, avoiding flow calculation deviations caused by limited field of view. Data fusion to determine target river flow: By combining local high-precision first velocity (calibration benchmark) with global wide-coverage second velocity (distribution frame), the accuracy of velocity data is guaranteed and full cross-section coverage is achieved, resulting in more accurate and reliable flow calculation results.

[0051] This embodiment provides a method for determining river flow, which can be used in the aforementioned electronic equipment. Figure 4This is a flowchart of a river flow determination method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps: Step S201: Obtain the first water surface video frame captured by at least one floating camera corresponding to the flow measurement section of the target river channel.

[0052] Each floating camera is installed on a floating platform corresponding to the target river channel, and the floating platform is installed on the water surface corresponding to the target river channel; each first water surface video frame corresponds to a first preset range of water surface.

[0053] Please refer to the above description of step S101 for details on this step, which will not be repeated here.

[0054] Step S202: Identify each first water surface video frame and determine the first initial surface flow velocity corresponding to each first water surface video frame.

[0055] Specifically, step S202 above may include the following steps: Step S2021: For each first water surface video frame, select at least one consecutive first water surface image from the first water surface video frames.

[0056] Specifically, for each floating camera's corresponding first water surface video frame, the electronic device can extract N consecutive first water surface images (usually N=5-10 frames) from the first water surface video frames captured by the floating camera.

[0057] Optionally, the N value needs to balance computational efficiency and accuracy. When the water flow is turbulent, the N value can be increased (e.g., 10 frames) to capture complete motion features, while it can be reduced to 5 frames when the water flow is gentle. This provides a continuous temporal data foundation for subsequent motion analysis, ensuring the temporal continuity of pixel displacement calculation.

[0058] Step S2022: Perform distortion correction and orthorectification processing on each first water surface image, and perform brightness normalization and noise suppression processing to obtain each processed first target image.

[0059] Specifically, the electronic device can use the camera intrinsic parameter matrix (obtained through pre-calibration) to eliminate radial and tangential distortion of the lens. Then, based on the water surface elevation data and camera extrinsic parameters, the tilted view image is converted into a vertical top view. Next, the effects of uneven illumination are eliminated through histogram equalization or adaptive threshold adjustment. Gaussian filtering or bilateral filtering is used to remove sensor noise and water surface reflection interference to obtain the processed images of each first target.

[0060] The procedures for distortion correction and orthophoto correction can be as follows: (1) Calibration preparation: Calibration board setup and image acquisition: Calibration board selection: A black and white checkerboard calibration board that fully covers the field of view of the floating camera is used to ensure that the corner points of the checkerboard are evenly distributed and cover the entire image area.

[0061] Calibration plate placement: Place the calibration plate on a plane parallel to the water surface (or a plane at a known height) to ensure that its relative position to the actual measurement scene is fixed.

[0062] Image acquisition: Take at least 3-5 images of the calibration board from different angles using the floating camera to be calibrated, ensuring that all possible imaging areas of the camera are covered.

[0063] (2) Distortion correction process: Step 1: Corner detection and coordinate extraction.

[0064] For each calibration board image, an automatic corner detection algorithm (such as Harris corner detection) is used to extract the precise pixel coordinates (x, y) of all internal corners, and the known physical coordinates (X, Y, 0) of the corresponding corners in the world coordinate system are recorded (the calibration board plane is set as the world coordinate system XY plane).

[0065] Step 2: Solve for camera parameters.

[0066] Establish a camera imaging model, considering radial and tangential distortion: Radial distortion: (k1, k2, k3 are radial distortion coefficients); Tangential distortion: δ_t=p1(2xy+r²)+p2(r²+2x²) (p1,p2 are tangential distortion coefficients).

[0067] Solve for the parameters by minimizing the reprojection error: minΣΣ‖(u_ij,v_ij)-proj(P,K,D,(X_ij,Y_ij,0))‖²; Where: (u_ij, v_ij) are the detected corner pixel coordinates, P is the extrinsic parameter matrix (rotation matrix + translation vector), K is the intrinsic parameter matrix (focal length, principal point coordinates), D is the distortion coefficient vector, and proj is the projection function.

[0068] Step 3: Perform distortion correction.

[0069] The electronic device uses the obtained intrinsic parameter matrix K and distortion coefficient D to perform distortion correction calculations on each pixel in each first target image, generating a corrected image that eliminates radial and tangential distortion.

[0070] (3) Orthogonal correction process.

[0071] Step 1: Homography matrix calculation.

[0072] Based on the distortion-corrected image, the pixel coordinates (u', v') of the corner points of the calibration board are extracted, and the correspondence between the corner pixel coordinates and the physical coordinates of the world coordinate system is established.

[0073] Solve the homography matrix H by overdetermining the equation: [u'_i,v'_i,1]^T=H·[X_i,Y_i,1]^T; Singular value decomposition (SVD) is used to solve the least squares solution, and H is normalized. The RANSAC algorithm is used to remove outlier matching pairs to improve the robustness of H.

[0074] Step 2: Construct the orthophoto mesh.

[0075] Define the physical size and resolution of the target orthophoto, and generate regular orthophoto grid points, with each point corresponding to a physical location in the world coordinate system.

[0076] Step 3: Inverse transformation and interpolation.

[0077] For each orthophoto grid point, its source coordinates in the distortion-corrected image are calculated using inverse homography transformation.

[0078] [X,Y,1]^T=H -1 The pixel values ​​of corresponding points in the distortion-corrected image are obtained using a bicubic interpolation algorithm [u',v',1]^T. This generates a geometrically accurate orthorectified image (equivalent to a vertical top-down view). Step S2023: Perform background motion consistency analysis on each first target image to generate a background motion model.

[0079] Specifically, electronic devices can apply dense optical flow algorithms (such as the Farneback algorithm) to adjacent first target image frames within a time window to obtain the motion vector (u,v) of each pixel, forming a complete initial motion vector field. Compared to sparse optical flow, it can provide motion information covering the entire image, making it suitable for analyzing overall flow trends.

[0080] Then, the electronic device calculates the direction angle θ=arctan2(v,u) for each vector and calculates the magnitude of the velocity. .

[0081] Then, a histogram of orientation angles (0°~360°) is plotted to determine the mainstream direction θ0 (the direction corresponding to the peak value). A histogram of velocity magnitude distribution is also plotted to analyze the velocity distribution characteristics. The electronic equipment calculates the average flow velocity. (N is the number of effective vectors), velocity standard deviation σ v This reflects the uniformity of flow velocity.

[0082] Next, the electronic device performs a weighted fitting of each pixel using vectors within its neighborhood (the closer the distance, the greater the weight). Gaussian filtering (5×5 or 7×7 kernels are recommended) is then applied to smooth the entire velocity field, preserving a large range of continuous motion patterns (motions that conform to the mainstream direction θ0) and suppressing local small disturbances (such as high-frequency noise caused by waves or small floating objects). This generates a background velocity vector (u_b, v_b) for each pixel, and a background motion model is generated based on the background velocity vector (u_b, v_b) for each pixel.

[0083] Where u_b is the background velocity component of the pixel in the horizontal direction (image x-axis); v_b is the background velocity component of the pixel in the vertical direction (image y-axis), and together they describe the motion state of the pure water flow at that location.

[0084] Step S2024: Based on the background motion model, determine the target foreground region in each first target image.

[0085] Specifically, the electronic device can calculate difference indices, including the directional difference Δθ = |θ - θ_b| (the difference between the current pixel direction and the background direction); and the velocity ratio r = V / V_b (the ratio of the current pixel velocity to the background velocity). Among these, the background velocity magnitude... Background direction angle .

[0086] Next, the electronic device compares the orientation difference corresponding to each pixel with a preset orientation difference threshold, and compares the speed ratio with a preset speed ratio threshold. If the orientation difference of a pixel is greater than the preset orientation difference threshold, and / or the speed ratio is greater than the preset speed ratio threshold, then the pixel is determined to be an abnormal pixel. All abnormal pixels are marked as 1 (foreground), and normal pixels are marked as 0 (background).

[0087] Then, adjacent abnormal regions are connected to remove isolated noise points, resulting in an initial foreground mask containing potential interference. The area of ​​the initial foreground mask is compared with a preset area threshold. If the area of ​​the initial foreground mask is less than the preset area threshold, the initial foreground mask is determined to be a false target.

[0088] In addition, the electronic device tracks the initial foreground mask region in consecutive frames to determine whether there is consistent motion. If there is consistent motion, the initial foreground mask is confirmed to be a real non-aquatic interference object (such as a ship or floating object), and finally the target foreground region in each first target image is determined.

[0089] Step S2025: Detect the target foreground region and determine the target position of non-water interference objects in each first target image within the target foreground region.

[0090] Specifically, electronic devices can detect target foreground regions and extract corresponding static and dynamic features. Static features include: shape features such as area, perimeter, bounding rectangle, and circularity; and texture features such as gray-level co-occurrence matrix and local binary pattern (LBP). Dynamic features include: motion trajectory such as positional changes in consecutive frames; and velocity features such as movement speed, acceleration, and direction changes.

[0091] Then, the static and dynamic features corresponding to the target foreground region are input into a lightweight object detection network. This lightweight object detection network can be a model such as MobileNet-SSD, suitable for edge computing devices, capable of handling complex scenes, and identifying various types of interference. It is suitable for complex environments with diverse types of interference.

[0092] The lightweight object detection network uses a classifier based on preset rules to identify non-aquatic interference in the target foreground region and determine the target location of these non-aquatic interferences in each first target image. The preset rules can be configured with threshold conditions (e.g., area > 50 pixels, aspect ratio < 5, etc.).

[0093] Step S2026: Based on the target position of the non-aquatic interference in each first target image, convert each first target image into a first target mask.

[0094] The mask corresponding to the target location is different from the masks corresponding to other locations.

[0095] Specifically, the electronic device can generate a binary first target mask of the same size as the first target image based on the target position of the non-aquatic interference in each first target image. The marking rule is as follows: the area where the interference is located (target position) is marked as 1 (or 255), and the normal water surface area is marked as 0. The edge of the first target mask is aligned with the outline of the interference, with an error of no more than 1-2 pixels, clearly distinguishing the interference area to be processed from the normal area that can be used directly.

[0096] Step S2027: Invalidate the target mask region vector corresponding to the target position.

[0097] Specifically, the electronic device can traverse the velocity vector field and set all motion vectors within the region marked as 1 on the mask to invalid values ​​(such as NaN). This completely eliminates erroneous motion data from interfering regions, preventing them from affecting subsequent flow velocity calculations.

[0098] Step S2028: Using the vector of the surrounding water surface region corresponding to the target mask region, fill in the vector of the target mask region to obtain the first target vector field.

[0099] Specifically, the electronic device can extract the effective vectors within a range of 5-10 pixels around the target mask area. For each pixel in the invalid area, it calculates a reasonable motion vector through interpolation to ensure that the filled vector transitions smoothly with the surrounding vectors. Finally, it outputs a complete and continuous first target vector field with no missing data areas.

[0100] Step S2029: Perform feature matching and pixel displacement estimation on each first target vector field to output pixel-level motion vector fields.

[0101] Specifically, the electronic device can perform secondary feature matching (such as using SIFT features) on the infilled vector field to optimize the pixel correspondence between adjacent frames. Then, sub-pixel level displacement estimation is used to improve the accuracy to the 0.1 pixel level, eliminate potential errors introduced by interpolation, and finally output an accurate pixel-level motion vector field, with each pixel corresponding to a reliable displacement vector.

[0102] Step S20210: Divide the pixel-level motion vector field by the inter-frame time interval to convert it into a water surface velocity vector field.

[0103] Specifically, the electronic device can determine the inter-frame time interval Δt of the first water surface video frame based on the video frame rate (e.g., 30fps corresponds to Δt = 1 / 30 seconds). Then, the displacement vector (u, v) of each pixel is divided by Δt to obtain the velocity vector (u / Δt, v / Δt). The velocity unit is pixels per second, reflecting the motion rate in the image space.

[0104] Step S20211: Map the water surface velocity vector field to the physical coordinate system to obtain the first initial surface flow velocity.

[0105] Specifically, the electronic device can use the pixel-to-physical conversion coefficient k (meters / pixel) obtained from camera calibration to multiply the pixel velocity vector by k to obtain the physical velocity in meters per second, thereby obtaining the first initial surface velocity, which is velocity data with practical hydrological measurement significance.

[0106] Step S203: Obtain the second water surface video frame captured by at least one shore-based camera corresponding to the flow measurement section of the target river channel.

[0107] Among them, the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to the second preset range of water surface, which is larger than the first preset range of water surface.

[0108] Please refer to the above description of step S103 for details on this step, which will not be repeated here.

[0109] Step S204: Identify each second water surface video frame and determine the second initial surface flow velocity corresponding to each second water surface video frame.

[0110] Specifically, please refer to the above description of step S104 for details on this step, which will not be elaborated upon here.

[0111] Step S205: Based on each first initial surface velocity and each second initial surface velocity, determine the target river flow rate at the flow measurement section corresponding to the target river channel.

[0112] Please refer to the above description of step S105 for details on this step, which will not be repeated here.

[0113] The river flow determination method provided in this application selects N consecutive first water surface images and establishes temporal correlation through continuous frame sampling, providing a stable temporal data foundation for subsequent analysis and ensuring the continuity of motion feature extraction. Distortion correction and orthorectification are performed on each first water surface image, followed by brightness normalization and noise suppression to obtain processed first target images. Lens distortion and perspective errors are eliminated, brightness is unified, and noise is suppressed, enhancing the spatiotemporal consistency of water surface texture and improving the accuracy of subsequent motion analysis. Then, a normal water surface flow pattern benchmark is established through background motion consistency analysis, providing a reference framework for identifying abnormal moving targets. The target foreground region is determined, and regions inconsistent with the background motion pattern are accurately separated, effectively extracting interfering targets that may affect flow velocity calculation. Next, non-aquatic interference objects are detected, identifying and locating vessels, floating objects, and other interference objects to avoid misleading the water surface flow velocity analysis and improve the purity of flow velocity calculation. Then, a first target mask is generated, clearly marking the interference area through the mask, providing spatial positioning basis for subsequent targeted processing and achieving separation of the interference area from the normal area. The process involves several steps: First, a mask region vector is created to directly eliminate erroneous vector data from interfering areas, thus removing the influence of interference on the velocity field at its source. Then, a mask region vector is filled in using surrounding valid data to fill in the interference areas, ensuring the spatial continuity and integrity of the velocity field and avoiding computational biases caused by missing data. Finally, a pixel-level motion vector field is output, obtaining dense motion information through feature matching to provide fine-grained pixel-level displacement data for velocity calculation. This data is then converted into a surface velocity vector field, transforming the displacement information into velocity dimensions to establish a velocity description corresponding to actual physical motion. Finally, the data is mapped to a physical coordinate system, achieving a transformation from image pixel space to real physical space, resulting in a surface velocity with practical physical meaning, providing a direct basis for subsequent flow rate calculations.

[0114] This embodiment provides a method for determining river flow, which can be used in the aforementioned electronic equipment. Figure 5 This is a flowchart of a river flow determination method according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps: Step S301: Obtain the first water surface video frame captured by at least one floating camera corresponding to the flow measurement section of the target river channel.

[0115] Each floating camera is installed on a floating platform corresponding to the target river channel, and the floating platform is installed on the water surface corresponding to the target river channel; each first water surface video frame corresponds to a first preset range of water surface.

[0116] Please refer to the above description of step S201 for details on this step, which will not be repeated here.

[0117] Step S302: Identify each first water surface video frame and determine the first initial surface flow velocity corresponding to each first water surface video frame.

[0118] Please refer to the above description of step S202 for details on this step, which will not be repeated here.

[0119] Step S303: Obtain the second water surface video frame captured by at least one shore-based camera corresponding to the flow measurement section of the target river channel.

[0120] Among them, the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to the second preset range of water surface, which is larger than the first preset range of water surface.

[0121] Please refer to the above description of step S203 for details on this step, which will not be repeated here.

[0122] Step S304: Identify each second water surface video frame and determine the second initial surface flow velocity corresponding to each second water surface video frame.

[0123] Please refer to the above description of step S204 for details on this step, which will not be repeated here.

[0124] Step S305: Based on each first initial surface velocity and each second initial surface velocity, determine the target river flow rate at the flow measurement section corresponding to the target river channel.

[0125] Specifically, step S305 above may include the following steps: Step S3051: Obtain the second initial surface velocity obtained by the radar device on the floating platform measuring the surface velocity of the first target point within the first preset range of water surface.

[0126] Specifically, the electronic device can use radar equipment (usually high-frequency microwave radar or Doppler radar) mounted on the floating platform to measure the surface velocity of a specific first target point within a first preset range of water surface.

[0127] Specifically, radar can directly calculate the flow velocity at a target point based on the Doppler effect by emitting electromagnetic waves and receiving reflected signals from the water surface. This method features high accuracy (typically with an error of <5%) and strong anti-interference capability (unaffected by illumination or water surface reflection). This yields a second initial surface flow velocity, which is the true physical flow velocity (unit: m / s) at the first target point, serving as a correction benchmark for the image-based flow velocity method.

[0128] Step S3052: Correct the first initial surface velocity based on the second initial surface velocity to obtain the first backup surface velocity.

[0129] Specifically, step S3052 above may include the following steps: Step a1: Map the first target point to the target pixel in the first water surface video frame.

[0130] Specifically, electronic devices can establish a spatial correspondence between radar measurement points and image pixels through pre-calibration. This includes determining the installation position parameters of the radar antenna (coordinate offset relative to the floating platform). Combining the camera's intrinsic parameters (focal length, principal point coordinates) and extrinsic parameters (attitude angle, altitude), the physical coordinates (X, Y) of the first target point are converted into pixel coordinates (u, v) in the first water surface video frame using coordinate transformation formulas (such as perspective projection models), thus obtaining the target pixel point corresponding to the first target point in the image.

[0131] The mapping error needs to be controlled within 1-2 pixels to ensure accurate correspondence between radar measurement points and image pixels.

[0132] Step a2: Obtain the surface flow velocity of the pixel corresponding to the target pixel.

[0133] Specifically, the electronic device can extract the flow velocity value corresponding to the target pixel (u, v) from the first initial surface flow velocity data obtained in step S20211. This flow velocity is the surface flow velocity obtained through an image method (optical flow analysis + physical mapping), which may contain systematic errors (such as those caused by assumptions or calibration errors in the optical flow algorithm). The pixel surface flow velocity (unit: meters per second) is then output as V_img.

[0134] Step a3: Calculate the surface velocity difference between the pixel surface velocity and the second initial surface velocity.

[0135] Specifically, the electronic device can calculate the absolute or relative difference between the surface velocity of a pixel and the second initial surface velocity measured by the radar: Absolute difference: ΔV = V_radar - V_img (where V_radar is the second initial surface velocity); Relative difference: ΔV% = (V_radar - V_img) / V_radar × 100%. This difference reflects the degree of systematic bias in the image method of flow velocity, providing a quantitative basis for subsequent correction. For example, if ΔV is positive, it means that the image method underestimates the flow velocity; if it is negative, it means that the flow velocity is overestimated.

[0136] Step a4: Based on the surface velocity difference, the first initial surface velocity is corrected to obtain the first backup surface velocity.

[0137] Specifically, the electronic device can use the initial velocity vectors {(u1,v1),(u2,v2),...,(u...} corresponding to N water surface pixels in the first target image. n ,v n )}, that is, the first initial surface velocity, and obtain the second initial surface velocity measured by radar: V_radar (the actual velocity of the first target point, a scalar). Wherein, the image pixel velocity vector corresponding to the first target point is: (u t ,v t The mainstream direction angle is θ0 (obtained from background motion analysis). The mainstream direction unit vector is e = (cosθ0, sinθ0), where e x =cosθ0 (x-direction component), e y =sinθ0 (y-direction component).

[0138] Then, the electronic equipment calculates the mainstream flow velocity of the corresponding pixel at the radar measurement point. The pixel velocity vector (u...) t ,v t Projecting onto the mainstream direction e, we obtain the mainstream direction velocity obtained by image inversion: V_img=u t ·e x +v t ·e y This value represents the velocity component along the main flow direction of the water at the first target point calculated by the image method, and serves as a benchmark for comparison with radar measurements.

[0139] Next, the electronic device can extract the deviation in the mainstream direction based on the surface velocity difference in step a3: ΔV = V_radar - V_img; if ΔV > 0, the image method underestimates the mainstream velocity, and if ΔV < 0, the image method overestimates the mainstream velocity.

[0140] Then, the electronic device corrects the velocity vector of each pixel. For N water surface pixels, the deviation ΔV is superimposed along the main flow direction, as shown in the formula: u_corrected=u i +ΔV·e x ; v_corrected=v i +ΔV·ey ; Where: (u i ,v i Let (u_corrected, v_corrected) be the initial velocity vector of the i-th pixel, and let (u_corrected, v_corrected) be the corrected velocity vector. ΔV·e x and ΔV·e y These are the correction amounts in the x and y directions, respectively, ensuring that the correction strictly follows the mainstream direction.

[0141] Finally, the electronic equipment checks whether the corrected mainstream flow velocity at the first target point is equal to the radar measured value: V_corrected = u_corrected·e x +v_corrected·e y =V_radar. If this equation is satisfied, it indicates that the single-point correction is effective. Ensure that the corrected velocity field retains the original spatial distribution characteristics (such as velocity gradient and recirculation zone), correcting only systematic deviations and avoiding abnormal abrupt changes. Finally, the set of velocity vectors after correction for all pixels obtained by the electronic device is the first backup surface velocity.

[0142] Step S3053: Based on the first backup surface velocity and the second initial surface velocity, determine the target river flow rate at the flow measurement section corresponding to the target river channel.

[0143] Specifically, step S3053 above may include the following steps: Step b1: Obtain the overlapping water surface range between the second preset range water surface and the first preset range water surface.

[0144] Specifically, the electronic device can determine the coverage area of ​​the fields of view of the floating camera and the shore-based camera in physical space based on the calibration parameters (intrinsic and extrinsic parameters). The intersection area of ​​the two fields of view, i.e. the overlapping water surface area, is calculated through coordinate transformation. Then, the physical boundary coordinates of the overlapping area (such as the coordinates of the upper left and lower right corners of a rectangular area) are output.

[0145] The intrinsic parameters include focal length, principal point coordinates, and distortion coefficients, while the extrinsic parameters include position and orientation information (x, y, z, roll, pitch, yaw). Coordinate transformation can be achieved using a perspective projection model. This technique is existing and will not be elaborated upon here.

[0146] Step b2: Determine the maximum spatial resolution among the spatial resolutions corresponding to the first and second water surface video frames.

[0147] Specifically, the electronic device can calculate the spatial resolution corresponding to the first and second surface video frames. Spatial resolution = physical coverage width ÷ pixel width (unit: meters / pixel). Then, the electronic device compares the two spatial resolution values ​​and selects the smaller value as the "maximum spatial resolution." For example, if the floating camera has a resolution of 0.05 meters / pixel and the shore-based camera has a resolution of 0.10 meters / pixel, then 0.05 meters / pixel is selected. Note: Here, "maximum spatial resolution" refers to the highest precision, not the largest numerical value.

[0148] Step b3: Divide the overlapping water surface area into multiple sub-grids according to the maximum spatial resolution.

[0149] Specifically, the electronic device can use the maximum spatial resolution determined in step b2 as the grid spacing, that is, the smallest number among the spatial resolution values ​​as the grid spacing. The overlapping water surface area is divided into regular M×N sub-grids, and the center coordinates and boundary range of each sub-grid are recorded.

[0150] Step b4: Based on the second initial surface velocity, determine the sub-second initial surface velocity corresponding to each sub-mesh.

[0151] Specifically, the electronic device can extract all velocity vectors within each subgrid from the second initial surface velocity field (shore-based data), and then calculate the average velocity (vector average) for each subgrid: The average u component is the average value of all u components within the grid; the average v component is the average value of all v components within the grid. This average velocity is used as the "sub-second initial surface velocity" of the sub-grid.

[0152] Step b5: Downsample the first water surface video frame according to the size of each sub-grid, and determine the sub-first backup surface velocity corresponding to each sub-grid based on the first backup surface velocity.

[0153] Specifically, the electronic device can set the size of the convolution kernel (sampling window) to be equal to the pixel size of the subgrid, such as a 5×5 pixel window. The window sliding step size is equal to the subgrid size to ensure no overlap or according to the designed overlap rate (usually 0 to avoid duplicate calculations).

[0154] Then, starting from the top left corner of the first water surface video frame, the sampling window is slid in row and column order, and the pixels within each window are aggregated. For image brightness information: the average or maximum value is retained (minor, mainly for visualization). For velocity vectors: see below. Then, the downsampled image frame is generated, and the output is a downsampled image structure with a size of (number of grid rows × number of grid columns), where each grid position corresponds to a sub-region in the original image.

[0155] Then, the electronic device can establish a spatial correspondence between the downsampled grid and the original velocity field: The pixel range of the original first water surface video frame corresponding to grid (i,j) is: row: [i×s,(i+1)×s-1], column: [j×s,(j+1)×s-1]; where s is the pixel size of the sub-grid (e.g., 5). Then, all valid velocity vectors (u,v) within the range corresponding to each grid are extracted, invalid values ​​(e.g., NaN or outliers exceeding the physical reasonable range, such as flow velocity >10m / s) are removed, and the number of valid vectors is recorded. If it is lower than the threshold (e.g., 50% coverage), the grid is marked as invalid.

[0156] Finally, for the effective velocity vector within each subgrid, the electronic device can calculate the average values ​​of the u and v components separately: u_avg=(u1+u2+...+u n ) / n;v_avg=(v1+v2+...+v n (u_avg, v_avg) / n; where n is the number of effective vectors. The calculated (u_avg, v_avg) is assigned to the center position of the corresponding sub-grid.

[0157] Record the flow rate of the grid. ) and direction ( ), to obtain the sub-first backup surface velocity corresponding to each sub-grid.

[0158] Step b6: Based on the sub-second initial surface velocity and the sub-first spare surface velocity corresponding to each sub-grid, generate surface velocity vector pairs corresponding to each sub-grid.

[0159] Specifically, for each subgrid, a velocity vector pair is created: (sub-second initial surface velocity, sub-first alternate surface velocity). Invalid vector pairs are discarded (e.g., missing data for a certain grid) to provide sample data for subsequent least-squares correction, ensuring "equal-dimensional vector pairs".

[0160] Step b7: Calculate the correction coefficients based on the least squares method according to the surface velocity vector pairs corresponding to each subgrid.

[0161] Specifically, assume there are M valid vector pairs {(u 2_i ,v 2_i ),(u 1_i ,v 1_i Establish a linear transformation model: u 2_ corrected = α·u1 + β;v 2_ corrected = γ·v1 + δ.

[0162] Construct the objective function (minimize the sum of squared errors): minΣ[(u 2_i -(α·u1_i +β))²+(v 2_i -(γ·v 1_i +δ))²]; The optimal parameters α, β, γ, δ are solved using the least squares method. Here, α and γ are scaling factors that correct for amplitude differences, and β and δ are translation factors that correct for system bias.

[0163] Step b8: Based on the correction coefficient, the second initial surface velocity is corrected to obtain the second alternative surface velocity.

[0164] Specifically, the electronic device can apply the correction coefficient obtained in step b7 to correct the second initial surface flow velocity to obtain the second alternative surface flow velocity. The details are as follows: u component for all pixels: u 2_ corrected = α·u² + β; for all pixels, the v component: v 2_ corrected = γ·v² + δ. Based on the u-components of all pixels and the v-components of all pixels, the second alternative surface velocity is obtained, using... express.

[0165] Step b9: Based on the flow velocities of each of the second alternative surfaces, determine the target channel flow rate at the flow measurement section corresponding to the target channel.

[0166] Specifically, step b9 above may include the following steps: Step b91: Obtain the current wind speed and current wind direction angle corresponding to the flow measurement section.

[0167] Specifically, the electronic device can obtain real-time current wind speed V and current wind direction angle θ from meteorological stations or equipment near the flow measurement section, ensuring that the data time is synchronized with the video frame time (error < 1 second).

[0168] Step b92: Based on the current wind speed and current wind direction angle, construct the wind-induced velocity profile.

[0169] Specifically, the electronic device can use a wind-induced velocity vertical distribution model to construct a wind-induced velocity profile: u_wind(z)=f·V_wind·exp(-z / δ); where: f is the wind drift coefficient (0.05~0.08); δ is the wind influence depth (0.2~0.3 times the water depth h); z is the water depth coordinate of the calculation point (z=0 is the water surface, z=h is the river bottom).

[0170] Step b93: Based on the wind-induced velocity profile, the velocity of each second candidate surface is corrected to obtain the target surface velocity corresponding to each second candidate surface velocity.

[0171] Specifically, the electronic equipment can calculate the component of the wind-induced velocity profile velocity in the direction of water flow: u_wind_parallel = u_wind·cos(Δθ); where Δθ is the angle between the wind direction and the mainstream water flow direction. Then, the electronic device removes the wind-induced component from the second candidate surface velocities to obtain the target surface velocity corresponding to each second candidate surface velocity: v_target = v_candidate - u_wind_parallel; where v_candidate is the second candidate surface velocity and v_target is the target surface velocity. This eliminates the interference of wind on surface velocity measurement and obtains a more accurate water flow velocity.

[0172] Step b94: Based on the surface velocity of each target, determine the target channel flow rate at the corresponding flow measurement section of the target channel.

[0173] Specifically, step b94 above may include the following steps: Step b941: Obtain the initial entropy parameters.

[0174] Specifically, electronic devices can receive initial entropy parameters input by the user, receive initial entropy parameters sent by other devices, and retrieve initial entropy parameters from storage space.

[0175] For example, the initial entropy parameter can be 2 or 3. This application embodiment does not specifically limit the initial entropy parameter.

[0176] Step b942: Based on the wind-induced velocity profile, the flow on each of the second candidate surfaces, and the initial entropy parameters, calculate the current entropy parameter correction term corresponding to the flow velocity on each of the second candidate surfaces.

[0177] Specifically, the electronic device can calculate the current entropy parameter correction term corresponding to each second alternative surface flow velocity based on the following formula, according to the wind-induced flow velocity profile velocity, each second alternative surface flow, and the initial entropy parameter.

[0178] ; Where M is the initial entropy parameter, and ΔM is the current entropy parameter correction term. The velocity profile of the wind-induced flow. The second alternative surface flow rate.

[0179] Optionally, the electronic device can correct the current entropy parameter correction term based on Kalman filtering. The process of correcting the current entropy parameter correction term based on Kalman filtering is existing technology and will not be elaborated here.

[0180] Step b943: Based on each current entropy parameter correction term, calculate the velocity distribution conversion factor corresponding to each second candidate surface velocity.

[0181] Specifically, the electronic device can calculate the velocity distribution reduction factor corresponding to the velocity of each second alternative surface using the following formula, based on each current entropy parameter correction term.

[0182] For example, ; in, This is the correction term for the current entropy parameter. This is the velocity distribution conversion factor corresponding to the flow velocity of each second alternative surface.

[0183] Optionally, the electronic device can also use Kalman filtering to correct the velocity distribution reduction factor. The process of correcting the velocity distribution reduction factor based on Kalman filtering is existing technology and will not be elaborated here.

[0184] Step b944: Multiply the flow velocity of each target surface by the corresponding flow velocity distribution conversion factor to obtain the target average flow velocity corresponding to the flow velocity of each target surface.

[0185] Specifically, electronic devices can multiply the flow velocity of each target surface by the corresponding flow velocity distribution conversion factor to obtain the target average flow velocity corresponding to the flow velocity of each target surface.

[0186] Step b945: Based on the average flow velocity of each target, determine the initial channel flow at the flow measurement section corresponding to the target channel.

[0187] Specifically, the electronic device can determine the initial channel flow at the flow measurement section corresponding to the target channel using the following formula, based on the average flow velocity of each target.

[0188] For example, ; in, The initial river flow. The average flow velocity for each target. This represents the area of ​​the flow measurement section corresponding to the average flow velocity of each target.

[0189] Step b946: Determine the target river flow based on the initial river flow.

[0190] Specifically, electronic devices can acquire the initial river flow sequence Q=[Q1,Q2,...,Q] over consecutive time periods. t ,...,Q N ], where t is the time index (e.g., minutes, seconds) and N is the total amount of data.

[0191] Next, define the window size W (which needs to be set according to the monitoring frequency and water flow stability; for example, if one flow value is collected every 5 minutes, W=5, which covers 25 minutes of flow data). Use a sliding step size of 1 (that is, each time point corresponds to a window centered or ending at it) to ensure continuous coverage of all data.

[0192] For data at the beginning and end of a sequence that is less than a window (such as the first W / 2 and the last W / 2 data), an "edge padding" strategy (such as repeating the first and last values ​​or mirroring) is adopted to avoid missing boundary data.

[0193] For each time point t, the corresponding sliding window W t =[Q t-W / 2 ,...,Q t ,...,Q t+W / 2 (Assuming the window is centrally symmetric), perform the following calculations: Window mean The formula reflects the average flow rate within the window: Among them, Q t,i Let be the i-th flow value within window Wt.

[0194] Window standard deviation The formula reflects the dispersion (fluctuation magnitude) of the flow within the window: The denominator uses W-1 to calculate the "unbiased standard deviation," which better reflects the statistical characteristics of a finite sample.

[0195] Then, the initial flow Q at each time point t t Determine whether the following conditions are met: .

[0196] If the above conditions are met, then Q is determined. t This is an outlier (e.g., a flow rate jump caused by a momentary equipment malfunction, or a false high flow rate caused by a sudden strong wind). If it does not meet the criteria: determine Q. t If the value is normal, keep it directly.

[0197] Finally, the traffic value Q was determined to be abnormal. t Anomalies are corrected by interpolating normal flow rates between adjacent time points to ensure the continuity of the flow sequence. Common interpolation methods are as follows: Linear interpolation (most commonly used, simple to calculate and with clear physical meaning): If Q t For outliers, take the flow rate Q at the previous normal time t-1. t-1 The flow Q at the next normal time t+1 t+1 The interpolation formula is: If outliers occur consecutively (e.g., Q...), t Q t+1 If both are abnormal, then take the two closest normal times (such as t-1 and t+2) for linear interpolation.

[0198] Weighted interpolation (suitable for scenarios with relatively gentle water flow changes): Different weights are assigned to flow rates at adjacent normal times (the closer the distance, the greater the weight). For example: Qt repair = 0.6Q. t-1 +0.4Q t+1 The weights can be adjusted according to the actual water flow stability (e.g., the weight difference for steady water flow can be reduced, while the weight difference for turbulent water flow can be increased).

[0199] Finally, the electronic equipment generates a restored flow sequence: all outliers are replaced with restored values ​​to obtain a continuous and smooth target river flow, Q. 最终 =[Q1 修复 / 正常 Q2 修复 / 正常 ,...,Q N 修复 / 正常 ].

[0200] The river flow determination method provided in this application utilizes radar equipment on a floating platform to directly measure the flow velocity at a specific target point, obtaining a high-precision single-point reference flow velocity, providing a reliable "true value" benchmark for image-based inversion results. Spatial registration accurately maps the physical points measured by the radar to the pixel coordinates of video frames, establishing a one-to-one correspondence between the radar true value and the image-based flow velocity, providing an accurate spatial benchmark for subsequent comparisons. The surface flow velocity of each pixel is obtained, and the corresponding pixel's image-based calculated flow velocity is extracted as the original data to be corrected, providing basic data support for subsequent difference calculations. The calculated flow velocity difference is directly compared with the radar true value and the image-based result, quantifying the deviation between the two, clarifying the correction requirements and direction, and providing a basis for adaptive adjustment. Based on the surface flow velocity difference, the flow velocity field is corrected by using single-point deviation to calculate the global correction coefficient, performing a consistent adjustment on the entire first initial surface flow velocity field. This retains the spatial distribution advantages of the image method while incorporating the high-precision characteristics of radar, significantly improving the quantitative accuracy of the flow velocity field.

[0201] Then, the overlapping water surface range is acquired to identify the intersection area of ​​the two fields of view, providing a unified spatial basis for multi-source data comparison and registration, ensuring that subsequent analysis is conducted within the same geographical area. The maximum spatial resolution is determined by selecting a lower precision resolution as the benchmark to avoid registration errors caused by resolution differences, ensuring data comparison at the same scale. The overlapping range is divided into regular sub-grids, facilitating data matching and calculation on a unit-by-unit basis, improving the efficiency and accuracy of subsequent processing. A second initial flow velocity is determined for each sub-grid, mapping the global flow velocity of the shore-based system onto a unified grid, providing a reference flow velocity for large-scale observations in each sub-grid. Downsampling the first video frame reduces the high-precision data of the floating platform to a unified grid scale, eliminating inconsistencies caused by resolution differences and facilitating direct comparison with shore-based data. Surface flow velocity vector pairs are generated to establish a "shore-platform" flow velocity correspondence in each sub-grid, forming a sample set to provide data support for subsequent correction. Least square correction coefficients are calculated based on multiple pairs of sub-grid flow velocity data, using statistical methods to obtain the optimal correction parameters, ensuring minimal overall error and improving global consistency. Based on the correction coefficient, the second initial surface velocity is corrected to obtain the second alternative surface velocity, so that it is consistent with the platform data in the overlapping area, thereby improving the overall accuracy.

[0202] Next, real-time meteorological data, including current wind speed and wind direction, is acquired to provide input for subsequent wind-induced effect modeling, making the velocity calculation more closely reflect actual environmental conditions. A wind-induced velocity profile is constructed, establishing a wind-induced velocity distribution model perpendicular to the water surface based on wind speed and direction, accurately describing the degree of wind influence at different water depths. The second alternative surface velocity is corrected by removing the wind-induced drift component from the surface velocity, eliminating the systematic bias of wind interference on the measurement results, and obtaining a more realistic water flow velocity. Initial entropy parameters are obtained to provide a starting point for calculation; reasonable initial values ​​are set based on existing experience or historical data to ensure stable convergence in subsequent iterations. The current entropy parameter correction term is calculated, dynamically adjusting the entropy parameter in conjunction with the wind-induced profile and measured surface velocity, making the model more adaptable to real-time water flow conditions and improving the matching degree between theory and reality. The velocity distribution conversion factor is calculated to transform the entropy parameter into a directly applicable correction factor, realizing the physical conversion from surface velocity to vertical average velocity, providing a crucial bridge for flow rate calculation. The target average velocity is obtained by converting it to the average velocity of each vertical line through coefficients, avoiding systematic errors caused by estimating only the surface velocity and improving the accuracy of the cross-sectional velocity distribution. The initial channel flow is determined by calculating the preliminary flow based on a more accurate vertical average velocity, providing high-quality basic data for the final result. The target channel flow is determined by combining multi-source data fusion and quality control to output the final flow result, balancing accuracy and reliability to meet the needs of actual hydrological monitoring.

[0203] This embodiment also provides a river flow determination device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0204] This embodiment provides a river flow determination device, such as... Figure 6 As shown, it includes: The first acquisition module 401 is used to acquire first water surface video frames captured by at least one floating camera corresponding to the flow measurement section of the target river; each floating camera is installed on a floating platform corresponding to the target river, and the floating platform is installed on the water surface corresponding to the target river; each first water surface video frame corresponds to a first preset range of water surface. The first determining module 402 is used to identify each first water surface video frame and determine the first initial surface flow velocity corresponding to each first water surface video frame. The second acquisition module 403 is used to acquire a second water surface video frame collected by at least one shore-based camera corresponding to the flow measurement section of the target river channel; the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to a second preset range of water surface, which is larger than the first preset range of water surface. The second determining module 404 is used to identify each second water surface video frame and determine the second initial surface flow velocity corresponding to each second water surface video frame. The third determining module 405 is used to determine the target river flow rate of the flow measurement section corresponding to the target river channel based on each first initial surface velocity and each second initial surface velocity.

[0205] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0206] In this embodiment, the river flow determination device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0207] This invention also provides an electronic device having the above-described features. Figure 6 The shown is a device for determining river flow.

[0208] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 7 As shown, the electronic device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.

[0209] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0210] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0211] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0212] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0213] The electronic device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0214] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.

[0215] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0216] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0217] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for determining river flow, characterized in that, The method includes: Acquire first water surface video frames captured by at least one floating camera corresponding to the flow measurement section of the target river; each of the floating cameras is installed on a floating platform corresponding to the target river, and the floating platform is installed on the water surface corresponding to the target river; each of the first water surface video frames corresponds to a first preset range of water surface; Each of the first water surface video frames is identified to determine the first initial surface flow velocity corresponding to each of the first water surface video frames. Acquire a second water surface video frame captured by at least one shore-based camera corresponding to the flow measurement section of the target river channel; the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to a second preset range of water surface, which is larger than the first preset range of water surface; Each of the second water surface video frames is identified to determine the second initial surface flow velocity corresponding to each of the second water surface video frames. Based on the first initial surface velocity and the second initial surface velocity, the target river flow rate of the flow measurement section corresponding to the target river channel is determined.

2. The method according to claim 1, characterized in that, The step of identifying each of the first water surface video frames and determining the first initial surface flow velocity corresponding to each of the first water surface video frames includes: For each of the first water surface video frames, at least one consecutive first water surface image is selected from the first water surface video frames; Distortion correction and orthorectification processing are performed on each of the first water surface images, and brightness normalization and noise suppression processing are performed to obtain the processed first target images. Perform background motion consistency analysis on each of the first target images to generate a background motion model; Based on the background motion model, the target foreground region in each of the first target images is determined; The target foreground region is detected to determine the target location of non-water body interference objects in each of the first target images; Based on the target position of the non-aquatic interference in each of the first target images, each of the first target images is converted into a first target mask; wherein the mask corresponding to the target position is different from the mask corresponding to other positions. Invalidate the target mask region vector corresponding to the target location; The vector of the target mask area is filled in using the vector of the surrounding water surface area corresponding to the target mask area to obtain the first target vector field; Perform feature matching and pixel displacement estimation on each of the first target vector fields to output pixel-level motion vector fields; Divide the pixel-level motion vector field by the inter-frame time interval to convert it into a water surface velocity vector field; The water surface velocity vector field is mapped to the physical coordinate system to obtain the first initial surface flow velocity.

3. The method according to claim 1, characterized in that, The step of determining the target river flow rate at the flow measurement section corresponding to the target river channel based on each of the first initial surface flow velocities and each of the second initial surface flow velocities includes: The second initial surface velocity is obtained by the radar device on the floating platform measuring the surface velocity of the first target point within the first preset range of water surface; The first initial surface flow velocity is corrected based on the second initial surface flow velocity to obtain the first backup surface flow velocity; Based on the first backup surface velocity and the second initial surface velocity, the target river flow rate of the flow measurement section corresponding to the target river is determined.

4. The method according to claim 3, characterized in that, The step of correcting the first initial surface flow velocity based on the second initial surface flow velocity to obtain the first backup surface flow velocity includes: Map the first target point to the target pixel in the first water surface video frame; Obtain the surface flow velocity of the pixel corresponding to the target pixel; Calculate the surface velocity difference between the pixel surface velocity and the second initial surface velocity; Based on the surface velocity difference, the first initial surface velocity is corrected to obtain the first backup surface velocity.

5. The method according to claim 4, characterized in that, The step of determining the target river flow rate at the flow measurement section corresponding to the target river channel based on the first backup surface velocity and the second initial surface velocity includes: Obtain the overlapping water surface range between the second preset range water surface and the first preset range water surface; Determine the maximum spatial resolution among the spatial resolutions corresponding to the first water surface video frame and the second water surface video frame; The overlapping water surface area is divided into multiple sub-grids based on the maximum spatial resolution. Based on the second initial surface velocity, determine the sub-second initial surface velocity corresponding to each of the sub-mesh; The first water surface video frame is downsampled according to the size of each sub-grid, and the sub-first backup surface velocity corresponding to each sub-grid is determined based on the first backup surface velocity. Based on the sub-second initial surface velocity and the sub-first spare surface velocity corresponding to each sub-mesh, a surface velocity vector pair corresponding to each sub-mesh is generated; Based on the surface velocity vector pairs corresponding to each sub-grid, the correction coefficients are calculated using the least squares method; Based on the correction coefficient, the second initial surface velocity is corrected to obtain the second alternative surface velocity; Based on the flow velocity of each of the second alternative surfaces, the flow rate of the target river at the corresponding flow measurement section is determined.

6. The method according to claim 5, characterized in that, The step of determining the target river flow rate at the flow measurement section corresponding to the target river based on the flow velocity of each of the second candidate surfaces includes: Obtain the current wind speed and current wind direction angle corresponding to the flow measurement section; Based on the current wind speed and the current wind direction angle, construct the wind-induced flow velocity profile. Based on the wind-induced velocity profile velocity, the velocity of each of the second candidate surfaces is corrected to obtain the target surface velocity corresponding to each of the second candidate surface velocities. Based on the flow velocity at each target surface, the flow rate of the target river channel at the corresponding flow measurement section is determined.

7. The method according to claim 6, characterized in that, The step of determining the target river channel flow rate at the corresponding flow measurement section based on the target surface velocity includes: Obtain the initial entropy parameter; Based on the wind-induced velocity profile velocity, each of the second candidate surface flows, and the initial entropy parameter, calculate the current entropy parameter correction term corresponding to each of the second candidate surface flows. Based on each of the current entropy parameter correction terms, calculate the velocity distribution conversion factor corresponding to each of the second candidate surface velocities; Multiply the flow velocity of each target surface by the corresponding flow velocity distribution conversion factor to obtain the target average flow velocity corresponding to each target surface flow velocity; Based on the average flow velocity of each target, the initial channel flow rate of the flow measurement section corresponding to the target channel is determined; The target river flow is determined based on the initial river flow.

8. A device for determining river flow, characterized in that, The device includes: The first acquisition module is used to acquire first water surface video frames captured by at least one floating camera corresponding to the flow measurement section of the target river; each of the floating cameras is installed on a floating platform corresponding to the target river, and the floating platform is installed on the water surface corresponding to the target river; each of the first water surface video frames corresponds to a first preset range of water surface; The first determining module is used to identify each of the first water surface video frames and determine the first initial surface flow velocity corresponding to each of the first water surface video frames. The second acquisition module is used to acquire a second water surface video frame collected by at least one shore-based camera corresponding to the flow measurement section of the target river channel; the shore-based camera is installed on the riverbank corresponding to the target river channel; the second water surface video frame corresponds to a second preset range of water surface, which is larger than the first preset range of water surface. The second determining module is used to identify each of the second water surface video frames and determine the second initial surface flow velocity corresponding to each of the second water surface video frames. The third determining module is used to determine the target river flow rate of the flow measurement section corresponding to the target river channel based on each of the first initial surface flow velocities and each of the second initial surface flow velocities.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the river flow determination method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the river flow determination method according to any one of claims 1 to 7.