Method and System for Measuring River Water Flow Velocity on the River Surface Based on Machine Vision

The method uses dual-camera imaging and iterative Navier-Stokes correction to improve river flow speed measurement accuracy and coverage, addressing traditional method inefficiencies for real-time monitoring.

CN119338885BActive Publication Date: 2025-07-15KUNMING UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411592886.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-07-15
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

Traditional river velocity measurement methods have low accuracy, poor adaptability, high manual maintenance costs, and insufficient real-time performance. Light and water surface fluctuations affect measurement accuracy. The existing machine vision methods are affected by light changes and the complexity of floating objects' movement trajectory, and computational resources are wasted and data accuracy is low.

Method used

The camera is calibrated by the Zhang Zhengyou calibration method, and radial and tangential distortion correction is performed. The feature points are extracted in combination with the SIFT algorithm, the image features are fused, and the flow velocity is corrected using the Navi-Stokes equation to calculate the characteristic parameters of water surface fluctuations, and the multi-view data acquisition and flow velocity correction are realized.

Benefits of technology

It improves measurement accuracy and real-time performance, reduces errors, can grasp the dynamic changes of water flow in real time, and provides high-precision flow rate data support, which is suitable for water resource allocation, ecological monitoring and flood control warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338885B_ABST
    Figure CN119338885B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for measuring the surface river water flow velocity based on machine vision. The present invention relates to the field of river water flow velocity measurement. The method includes the following steps: selecting two cameras to collect river water image information at different angles, and calculating the angle between the two cameras based on the distance to the river to be detected and the field of view widths of the two cameras; after calibrating the cameras, collecting river water image information of the same detection area on the river surface at different angles, preprocessing the images, and extracting and fusing feature points from the preprocessed images to obtain the fused surface river water image; based on the fused surface river water image, extracting the characteristics of the water surface fluctuations, calculating the characteristic parameters of the water surface fluctuations, and characterizing the surface river water flow velocity based on the characteristic parameters; based on the obtained surface river water flow velocity parameters, correcting the flow velocity of the surface river water flow velocity parameters through the Navier-Stokes equation, and outputting the accurate value of the surface river water flow velocity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of river flow velocity measurement, and particularly to a method and system for measuring the surface river flow velocity of a river channel based on machine vision. Background Technique

[0002] In recent years, with the increasing tension of water resources and the exacerbation of water environment problems, the measurement of river flow velocity has become particularly important. This measurement can not only provide data support for the rational utilization of water resources, but also provide important references for flood warning, ecological protection, water quality monitoring, etc. However, traditional methods for measuring flow velocity mostly rely on physical measurement instruments, such as current meters and buoys. Although these methods can obtain river flow velocity to a certain extent, there are often some technical bottlenecks, such as low accuracy, poor adaptability, high manual maintenance costs, etc.

[0003] The installation and maintenance of traditional flow velocity measurement tools are relatively difficult, especially in complex water flow environments. Devices such as current meters and buoys are affected by various factors such as flow, water waves, and wind on the water surface, which may lead to unstable measurement results. In addition, traditional methods usually can only provide flow velocity information at a single measurement location and cannot effectively reflect the water flow dynamics of the entire river channel.

[0004] The real-time nature of flow velocity measurement is also an issue that cannot be ignored. Traditional devices usually require regular maintenance and calibration, and in extreme weather or water flow conditions, the measurement devices may malfunction, resulting in inaccurate or missing data. In addition, the cycle of data acquisition and processing is relatively long, affecting the real-time monitoring and response ability to water flow dynamic changes. Therefore, there is an urgent need for a new method that can efficiently and accurately measure the water flow velocity on the surface of the river channel.

[0005] In the prior art, the publication number CN117788879A discloses a method for measuring the water flow velocity on the surface of a river based on machine vision, including the following steps: Step 1, obtain multiple frames of images of the river surface, and each frame of image contains identification markers; Step 2, respectively determine the geometric dimensions of the identification markers from each frame of image obtained in Step 1, and calculate the reference distance of the floating object according to the geometric dimensions of the identification markers; Step 3, use the trained object detection network to respectively detect and identify each floating object from each frame of image, and then determine the coordinates of each floating object in each frame of image; Step 4, calculate the average flow velocity of all floating objects in the current frame of image; Step 5, calculate the water flow velocity of the current frame of image according to the average flow velocity of all floating objects in the current frame of image. However, in this solution, changes in lighting conditions (such as shadows, sunlight intensity, etc.) will affect the image quality and the visibility of the identification markers, and further affect the accuracy of object detection and speed calculation. At the same time, the fluctuations and ripples on the water surface will make the movement trajectories of the floating objects become complex, thereby increasing the measurement error. Therefore, simply identifying the markers and calculating the water flow velocity on the surface of the river by the displacement and time of the standard object's movement not only wastes computing resources, but also reduces the accuracy and effectiveness of the obtained flow velocity data.

[0006] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present disclosure, and thus it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0007] The purpose of the present invention is to provide a method and system for measuring the water flow velocity on the surface of a river based on machine vision to solve the problems raised in the above background art.

[0008] To achieve the above purpose, the present invention provides the following technical solutions:

[0009] A method for measuring the water flow velocity on the surface of a river based on machine vision, the specific steps include:

[0010] Select two cameras for collecting river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river to be detected and the field of view widths of the two cameras, and calculate the included angle between the two cameras based on the distances to the river to be detected and the field of view widths of the two cameras;

[0011] Based on the obtained included angle between the two cameras, set the shooting positions of the cameras on the bank of the river to be detected according to this included angle. After calibrating the cameras, collect the river water image information on the surface of the river in the same detection area at different angles, preprocess the images, and extract and fuse the feature points of the preprocessed images to obtain the fused surface river water image;

[0012] Based on the fused surface river water image, extract the characteristics of the water surface fluctuations, calculate the characteristic parameters of the water surface fluctuations, and characterize the surface river water flow velocity in the detection area based on the characteristic parameters of the water surface fluctuations to obtain the surface river water flow velocity parameters. The characteristic parameters of the water surface fluctuations include wave amplitude, wave spacing, water surface inclination, and water surface fluctuation frequency;

[0013] Based on the obtained surface river water flow velocity parameters, perform flow velocity correction on the surface river water flow velocity parameters through the Navier - Stokes equation, and at the same time set the convergence condition. When the output of the iterative correction of the river water flow velocity through the Navier - Stokes equation meets the convergence condition, stop the correction and output the current surface river water flow velocity as the accurate value of the surface river water flow velocity.

[0014] Further, calibrate the heights of two cameras as h, determine the distances from the two cameras to the river to be detected as d, and at the same time set at least one marking point on the monitored river to ensure that all the set marking points are included in the pictures collected by the two cameras. Among them, the heights of the two cameras and the distances from the two cameras to the river to be detected are kept consistent. The field - of - view width w of the two cameras, where the field - of - view width is the range of the field of view that can be seen when observing or photographing a scene. Based on the distance to the river to be detected and the field - of - view width of the two cameras, the specific formula for calculating the included angle between the two cameras is:

[0015]

[0016] In the formula, α represents the included angle between the two cameras.

[0017] Further, use the Zhang Zhengyou calibration method to calibrate the two cameras. The specific steps include: making a checkerboard calibration board; moving the calibration board and collecting images; extracting corner points; calibrating the other camera in the same way to obtain the internal and external parameters of the camera. The internal and external parameters include focal length, principal point, and distortion coefficients. The distortion coefficients include radial distortion coefficients and tangential distortion coefficients;

[0018] Pre - process the images. The pre - processing includes radial distortion correction, tangential distortion correction, and gray - level normalization. The specific logic for radial distortion correction and tangential distortion correction is as follows: Establish three radial distortion coefficients, labeled as k1, k2, and k3. The formula for obtaining the ideal image coordinates without distortion is:

[0019]

[0020] Establish two tangential distortion coefficients, labeled as p1 and p2. The model expression for tangential distortion is:

[0021]

[0022] By superimposing and combining the two types of distortions, the impacts brought by both can be eliminated simultaneously. The parameter expression after superposition is as follows:

[0023]

[0024] In the formula, k1, k2, and k3 are three different radial distortion coefficients, p1 and p2 are two different tangential distortion coefficients. The values of the distortion coefficients are determined according to the Zhang Zhengyou calibration method. (x ′ , y ′ ) represents the image coordinates without distortion in the ideal optical system, (x", y") is the image coordinates of a certain pixel point in the captured image, and r is the distance from the correction point to the imaging center. Here, the image coordinate system takes the optical center as the image center, the origin is the intersection point of the camera optical axis and the imaging plane, with the rightward direction as the positive X-axis direction and the downward direction as the positive Y-axis direction to establish;

[0025] Normalize the grayscale of the image after radial distortion correction and tangential distortion correction, and convert the color image into a grayscale image. The formula for grayscale normalization is as follows:

[0026] gra = 0.2989 * R + 0.5870 * G + 0.1140 * B

[0027] In the formula, gra is the pixel value of the generated grayscale image, R represents the pixel value of the red channel in the image after radial distortion correction and tangential distortion correction, G is the pixel value of the green channel in the image, and B is the pixel value of the blue channel in the image.

[0028] Furthermore, the logic for feature point extraction and fusion of the preprocessed image is as follows: Use the SIFT algorithm to extract the marked points and feature descriptors in the image, including the position, size, and direction of the marked points; perform feature matching on the extracted marked points and feature descriptors using the matcher according to the K-nearest neighbor matching algorithm; set a ratio threshold, and based on the set ratio threshold, screen the matching results and retain the matching results that meet the ratio threshold; fuse the image features at different angles according to the matching results to obtain the fused image features. The formula for calculating the fused image features is as follows:

[0029]

[0030] In the formula, BS F (x, y) represents the fused image features obtained by fusion, E A (x, y) and E B (x, y) respectively represent the matching features in two different angle images, L A (x, y) and L B(x, y) represent the pixel values of two different - angle images at the point (x, y), and reconstruct the image according to the characteristics of the fused image to obtain the fused surface river water image.

[0031] Further, based on the fused surface river water image, extract the characteristics of the water surface fluctuation, calculate the water surface fluctuation characteristic parameters. Among them, identify the wave crests and wave troughs of the water surface fluctuation through edge detection and contour extraction, and calculate the water surface fluctuation characteristic parameters based on the coordinate information of the wave crests and wave troughs. The specific formula is as follows:

[0032]

[0033] λ = X peak,n+1 -X peak,n

[0034]

[0035] In the formula, A, λ, and θ are the wave amplitude, wave spacing, and water surface inclination of the water surface fluctuation respectively, Y min and Y max represent the height of the wave trough and the height of the wave crest respectively, X peak,n+1 and X peak,n represent the abscissa of the (n + 1)-th wave crest and the abscissa of the n-th wave crest respectively;

[0036] Among them, the formula for calculating the water surface fluctuation frequency is:

[0037]

[0038] In the formula, f represents the water surface fluctuation frequency, N is the total number of wave crests, and T is the total time of image acquisition.

[0039] Further, characterize the surface river water flow velocity in the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The formula is as follows:

[0040]

[0041] In the formula, V is the surface river water flow velocity parameter, C is the proportionality coefficient, ω1, ω2, and ω3 are the weight coefficients of the wave amplitude, wave spacing, and water surface fluctuation frequency of the water surface fluctuation respectively. Among them, ω1>ω2≥ω3 and ω1, ω2, and ω3 are all greater than 0.

[0042] Further, based on the obtained surface river water flow velocity parameters, the formula for velocity correction of the surface river water flow velocity parameters through the Navier - Stokes equation is:

[0043]

[0044] In the formula, Vcor is the corrected surface river water flow velocity, V is the surface river water flow velocity parameter, Δt represents the set time step, ρ is the fluid density, i.e., the density of river water, is the pressure gradient, and μ is the kinematic viscosity, represents the Laplacian operator of velocity, and F represents the external volume force, including the gravity of river water and the frictional force between river water and the river bank;

[0045] Perform iterative update operations according to this equation, and use the generated V each time cor as the surface river water flow velocity parameter V for the next update until the set convergence condition is met, stop the correction, and use the currently generated latest generation of V cor as the output to represent the accurate value of the surface river water flow velocity.

[0046] The present invention also provides a system for measuring the surface river water flow velocity based on machine vision. The system for measuring the surface river water flow velocity based on machine vision is used to execute the above-mentioned method for measuring the surface river water flow velocity based on machine vision, and includes:

[0047] An image acquisition position determination module, which is used to select two cameras, collect river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river to be detected and the field of view widths of the two cameras, and calculate the angle between the two cameras based on the distances from the two cameras to the river to be detected and the field of view widths of the two cameras;

[0048] An image feature extraction and fusion module, which is used to set the shooting positions of the cameras at the angle on the bank of the river to be detected based on the angle between the two obtained cameras. After calibrating the cameras, collect river water image information on the surface of the river in the same detection area at different angles, preprocess the images, and extract and fuse feature points from the preprocessed images to obtain a fused surface river water image;

[0049] A river water flow velocity calculation module, which is used to extract the characteristics of the water surface fluctuation based on the fused surface river water image, calculate the water surface fluctuation characteristic parameters, and characterize the surface river water flow velocity in the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameter. The water surface fluctuation characteristic parameters include wave amplitude, wave spacing, water surface inclination and water surface fluctuation frequency;

[0050] A river water flow velocity correction module, which is used to correct the surface river water flow velocity parameter based on the obtained surface river water flow velocity parameter through the Navier-Stokes equation, and set the convergence condition at the same time. When the output of the iterative correction of the river water flow velocity through the Navier-Stokes equation meets the convergence condition, stop the correction and output the current surface river water flow velocity as the accurate value of the surface river water flow velocity.

[0051] Compared with the prior art, the beneficial effects of the present invention are:

[0052] First, through the reasonable arrangement and precise calibration of cameras, the characteristics of water surface fluctuations can be captured at different angles within the same detection area, greatly enhancing the comprehensiveness of data collection. This multi-view image fusion strategy not only improves the measurement accuracy but also effectively reduces the errors caused by a single view, thus providing a more reliable basis for subsequent analysis.

[0053] Secondly, the extracted water surface fluctuation characteristic parameters, including wave amplitude, wave spacing, inclination angle, and water surface fluctuation frequency, etc., are used to quantitatively analyze the flow velocity of the river channel. These fluctuation characteristics can fully reflect the dynamic characteristics of the water flow, enabling real-time monitoring of water flow changes, and thus making timely responses in aspects such as water resource allocation, ecological monitoring, and flood prevention warning. In addition, the process of correcting the surface flow velocity parameters using the Navier-Stokes equation not only ensures the high accuracy and credibility of the final flow velocity output but also makes this method scientific and rigorous. By setting appropriate convergence conditions, all calculation processes can be optimized during iteration, gradually approaching the real water flow state. Brief Description of the Drawings

[0054] Figure 1 It is a schematic diagram of the overall method flow of the present invention;

[0055] Figure 2 It is a schematic diagram of the overall system structure of the present invention. Detailed Embodiment

[0056] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with specific embodiments.

[0057] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the present invention should have the ordinary meanings understood by those with ordinary skills in the field to which the present invention belongs. The "first", "second", and similar terms used in the present invention do not indicate any order, quantity, or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this term cover the elements or objects listed after this term and their equivalents, without excluding other elements or objects. The terms such as "connected" or "linked" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left", "right", etc. are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0058] Embodiment:

[0059] Please refer to Figure 1, the present invention provides a technical solution:

[0060] A method for measuring the flow velocity of river water on the surface of a river based on machine vision, the specific steps include:

[0061] Step 1: Select two cameras for collecting river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river to be detected and the field of view widths of the two cameras, and calculate the angle between the two cameras based on the distances from the two cameras to the river to be detected and the field of view widths of the two cameras;

[0062] Calibrate the heights of the two cameras as h, determine the distances from the two cameras to the river to be detected as d, and at the same time set at least one marking point on the monitored river to ensure that all the set marking points are included in the pictures collected by the two cameras. Among them, the heights of the two cameras and the distances from the two cameras to the river to be detected are both kept consistent. The field of view width w of the two cameras, where the field of view width is the range of the field of view that can be seen when observing or photographing a scene. The specific formula for calculating the angle between the two cameras based on the distances from the two cameras to the river to be detected and the field of view widths of the two cameras is:

[0063]

[0064] In the formula, α represents the angle between the two cameras.

[0065] By setting two cameras, the image information on the surface of the river water can be captured simultaneously from different angles and viewpoints. This multi-view configuration can obtain the surface fluctuation characteristics more comprehensively and avoid information loss or misjudgment caused by a single view. In traditional technologies, usually relying on a single sensor for measurement, it is easily affected by factors such as view limitations and light changes. However, in this solution, through the collaborative work of two cameras, the quality and reliability of the data are greatly improved;

[0066] At the same time, set at least one marking point on the monitored river to ensure that all the set marking points are included in the pictures collected by the two cameras. This marking point serves as a feature point for feature fusion to increase the accuracy of image fusion.

[0067] Step 2: Based on the obtained angle between the two cameras, set the shooting positions of the cameras on the bank of the river to be detected according to this angle. After calibrating the cameras, collect the image information of the river water on the surface of the same detection area at different angles, preprocess the images, and extract and fuse the feature points of the preprocessed images to obtain the fused surface river water image;

[0068] The two cameras are calibrated using Zhang Zhengyou's calibration method. The specific steps include: making a checkerboard calibration plate; moving the calibration plate and acquiring images; extracting corner points. First, you need to prepare a calibration plate with a known geometric shape. The commonly used one is a checkerboard calibration plate. There are several black squares or circles on the calibration plate. Their geometric shapes and sizes are known. Place the calibration plate in the shooting field of view of the digital camera. Keep the camera position fixed during the entire calibration process, and move the calibration plate to different positions to ensure that the image captured by the camera each time is completely covered by the calibration plate and the image quality is clear, until about 20 groups of calibration plate images with different positions are collected.

[0069] Use the CameraCalibrator toolbox in Matlab software to import all calibration plate images and input the actual size of the checkerboard. Filter all imported images, remove images with inconsistent coordinate systems, and extract the corner points of each image;

[0070] After extracting corner points from all calibration plate images, use the detected corner point data and the geometric parameters of the calibration plate to run the calibration program using the Calibration toolbox. The program will output calibration-related parameters, including the camera's internal parameters: focal length, principal point position, and lens distortion. Under the assumed calibration plate parameters, the camera parameters are generated to complete the calibration.

[0071] Calibrate another camera in the same manner to obtain internal and external parameters of the camera, where the internal and external parameters include focal length, principal point and distortion coefficient, where the distortion coefficient includes radial distortion coefficient and tangential distortion coefficient;

[0072] The image is preprocessed, and the preprocessing includes radial distortion correction, tangential distortion correction and grayscale normalization. The specific logic of radial distortion correction and tangential distortion correction is: three radial distortion coefficients are established, calibrated as k1, k2 and k3, and the formula for obtaining the ideal image coordinates without distortion is:

[0073]

[0074] Two tangential distortion coefficients are established and calibrated as p1 and p2. The model expression of tangential distortion is:

[0075]

[0076] By combining the two distortions, the effects of both can be eliminated at the same time. The parameter expression after superposition is:

[0077]

[0078] Wherein, k1, k2, and k3 are three different radial distortion coefficients, p1 and p2 are two different tangential distortion coefficients, and the values of the distortion coefficients are determined according to Zhang Zhengyou calibration method. (x ′ , y ′ ) represents the image coordinates without distortion under the ideal optical system, (x", y") is the image coordinates of a certain pixel point in the captured image, and r is the distance from the correction point to the imaging center. The image coordinate system takes the optical center as the image center, the origin as the intersection of the camera optical axis and the imaging plane, with the right direction as the positive direction of the X-axis and the downward direction as the positive direction of the Y-axis.

[0079] Normalize the grayscale of the image after radial distortion correction and tangential distortion correction, and convert the color image into a grayscale image. The formula for grayscale normalization is:

[0080] gra = 0.2989 * R + 0.5870 * G + 0.1140 * B

[0081] Wherein, gra is the pixel value of the generated grayscale image, R represents the pixel value of the red channel in the image after radial distortion correction and tangential distortion correction, G is the pixel value of the green channel in the image, and B is the pixel value of the blue channel in the image.

[0082] Converting the color image into a grayscale image can reduce the data dimension and make the image processing more efficient. Color images usually involve more calculations and complex color space conversions during feature extraction, while grayscale images simplify this process. Especially when dealing with high-frequency fluctuation features, grayscale images can often show changes more clearly, and the data volume of grayscale images is relatively small, resulting in a significant improvement in processing speed. Especially in real-time monitoring scenarios, fast processing can provide timely data support for subsequent flow rate calculations and avoid response lags caused by calculation delays.

[0083] Use the SIFT algorithm to extract the marked points and feature descriptors in the image, including the position, size, and direction of the marked points; perform feature matching on the extracted marked points and feature descriptors using a matcher according to the K-nearest neighbor matching algorithm; set a ratio threshold, and based on the set ratio threshold, screen the matching results and retain the matching results that meet the ratio threshold; fuse the image features at different angles according to the matching results to obtain fused image features. The formula for calculating the fused image features is:

[0084]

[0085] Wherein, BS F (x, y) represents the fused image features obtained by fusion, E A (x, y) and E B(x, y) represent the matching features in two different - angle images, L A (x, y) and L B (x, y) represent the pixel values at the point (x, y) in two different - angle images respectively, and reconstruct the image according to the fused image features to obtain the fused surface river water image. Select a suitable image - fusion method (such as image weighting, principal - component analysis, Laplacian pyramid, etc.), combine the extracted features to form a fused feature. Based on the fused feature, use an interpolation or reconstruction algorithm (such as inverse interpolation, deep - learning reconstruction network) to reconstruct the image, and synthesize the reconstructed images to generate the final fused surface river water image.

[0086] Step 3: Based on the fused surface river water image, extract the features of the water surface fluctuation, calculate the water - surface - fluctuation characteristic parameters, and characterize the surface river water flow velocity in the detection area based on the water - surface - fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The water - surface - fluctuation characteristic parameters include wave amplitude, wave spacing, water - surface inclination angle, and water - surface fluctuation frequency;

[0087] Based on the fused surface river water image, extract the features of the water surface fluctuation, calculate the water - surface - fluctuation characteristic parameters. Among them, identify the wave crests and wave troughs of the water surface fluctuation through edge detection and contour extraction. Common edge - detection algorithms such as Canny edge detection, Sobel operator, etc. can be used. Use the contour - detection function (such as findContours) in libraries such as OpenCV to extract the contours from the edge image. Calculate the water - surface - fluctuation characteristic parameters based on the coordinate information of the wave crests and wave troughs. The specific formulas are as follows:

[0088]

[0089] λ = X peak,n+1 -X peak,n

[0090]

[0091] In the formula, A, λ, and θ are the wave amplitude, wave spacing, and water - surface inclination angle of the water surface fluctuation respectively, Y min and Y max represent the height of the wave trough and the height of the wave crest respectively, X peak,n+1 and X peak,n represent the abscissa of the (n + 1)-th wave crest and the abscissa of the n - th wave crest respectively;

[0092] The formula for calculating the water - surface fluctuation frequency is as follows:

[0093]

[0094] In the formula, \(f\) represents the water surface fluctuation frequency, \(N\) represents the total number of wave crests, and \(T\) represents the total time of image acquisition.

[0095] Characterize the surface river water flow velocity in the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The formula used is as follows:

[0096]

[0097] In the formula, \(V\) is the surface river water flow velocity parameter, \(C\) is the proportionality coefficient, \(\omega_1\), \(\omega_2\), and \(\omega_3\) are the weight coefficients of the wave amplitude, wave spacing, and water surface fluctuation frequency of the water surface fluctuation respectively. Among them, \(\omega_1 > \omega_2 \geq \omega_3\) and \(\omega_1\), \(\omega_2\), and \(\omega_3\) are all greater than 0.

[0098] A larger wave amplitude usually means stronger water flow. The larger the wave amplitude, the stronger the flow energy, making the fluctuation process more obvious; the wave spacing is proportional to the flow velocity, and a longer wave spacing often indicates a faster flow velocity; an inclined water surface indicates the presence of water flow, and the larger the flow velocity, the larger the inclination angle usually is; the fluctuation frequency is the number of fluctuations occurring per unit time, and the frequency is directly related to the flow velocity. The water surface with a faster flow velocity usually has a higher fluctuation frequency. Since the degree to which the wave amplitude of the water surface fluctuation reflects the water flow velocity is greater than the ability of the water surface fluctuation frequency and wave spacing to reflect the water flow velocity, \(\omega_1 > \omega_2 \geq \omega_3\) is set.

[0099] Step 4: Based on the obtained surface river water flow velocity parameters, perform flow velocity correction on the surface river water flow velocity parameters through the Navier - Stokes equation, and set the convergence condition. When the output of the iterative correction of the river water flow velocity through the Navier - Stokes equation meets the convergence condition, stop the correction and output the current surface river water flow velocity as the accurate value of the surface river water flow velocity.

[0100] The formula for performing flow velocity correction on the surface river water flow velocity parameters through the Navier - Stokes equation based on the obtained surface river water flow velocity parameters is as follows:

[0101]

[0102] In the formula, \(V\) cor is the corrected surface river water flow velocity, \(V\) is the surface river water flow velocity parameter, \(\Delta t\) represents the set time step, \(\rho\) is the fluid density, that is, the density of river water, is the pressure gradient, \(\mu\) is the kinematic viscosity, represents the Laplace operator of velocity, and \(F\) represents the external volume force, including the gravity of river water and the friction force between river water and the river bank;

[0103] The kinematic viscosity of river water is measured by a viscometer. Under standard conditions, the kinematic viscosity of water is approximately 0.001 Pa·s, but it is affected by temperature and dissolved substances. The Laplacian operator of the velocity field is calculated numerically (such as by the finite difference method, finite element method, etc.) within the computational domain, and the pressure field data can be obtained through CFD simulation.

[0104] Perform iterative update operations according to this equation, and take the generated V cor , as the surface river flow velocity parameter V for the next update, until the set convergence condition is met, stop the correction, and take the currently generated latest generation V cor as the output representing the exact value of the surface river flow velocity.

[0105] Among them, the iterative update operation includes: updating the corrected surface river flow velocity and calculating the velocity Laplacian operator at the current water flow velocity Since the flow velocity V changes in each iteration, it needs to be recalculated. The external volume force F is updated according to the latest flow velocity parameters and environmental conditions. At the same time, if the pressure of the fluid changes with the change of velocity, it also needs to be updated. Through the iterative update of these steps and variables, the exact value of the surface river flow velocity can be gradually approximated.

[0106] The set convergence condition can be a fixed number of iterations. When the number of iterations of the loop reaches the set number of iterations, stop the iterative update operation, and take the final V cor as the output, representing the corrected surface river flow velocity; or define a convergence index for the flow velocity field, compare the difference in flow velocity and the convergence index of the flow velocity field during each iteration. If the difference in flow velocity between two iterations is less than the convergence index of the flow velocity field, stop the iterative update operation, and take the final V cor as the output, representing the corrected surface river flow velocity.

[0107] Please refer to Figure 2 , the present invention also provides a system for measuring the surface river flow velocity of a river channel based on machine vision. The system for measuring the surface river flow velocity of a river channel based on machine vision is used to execute the above-mentioned method for measuring the surface river flow velocity of a river channel based on machine vision, and includes:

[0108] An image acquisition position determination module, which is used to select two cameras, collect river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river channel to be detected and the field of view widths of the two cameras, and calculate the angle between the two cameras based on the distances from the two cameras to the river channel to be detected and the field of view widths of the two cameras;

[0109] The image feature extraction and fusion module is used to set the shooting positions of the cameras on the bank of the river to be detected according to the included angle between the two cameras obtained, calibrate the cameras, collect the river water image information of the same detection area at different angles, preprocess the images, and extract and fuse the feature points of the preprocessed images to obtain the fused surface river water image;

[0110] The river water flow velocity calculation module is used to extract the characteristics of the water surface fluctuation based on the fused surface river water image, calculate the characteristic parameters of the water surface fluctuation, and characterize the river water flow velocity on the surface of the detection area based on the characteristic parameters of the water surface fluctuation to obtain the surface river water flow velocity parameters. The characteristic parameters of the water surface fluctuation include wave amplitude, wave spacing, water surface inclination, and water surface fluctuation frequency;

[0111] The river water flow velocity correction module is used to correct the surface river water flow velocity parameters through the Navier-Stokes equation based on the obtained surface river water flow velocity parameters, and set the convergence condition. When the output of the iterative correction of the river water flow velocity through the Navier-Stokes equation satisfies the convergence condition, stop the correction and output the current surface river water flow velocity as the accurate value of the surface river water flow velocity.

[0112] The above formulas are all dimensionless and take their numerical calculations. The formula is a formula obtained by software simulation of a large amount of collected data to approximate the real situation. The preset parameters in the formula are set by those skilled in the art according to the actual situation.

[0113] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0114] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units. They may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application.

Claims

1. A method for measuring the water flow velocity on the surface of a river based on machine vision, characterized in that, The specific steps include: Select two cameras for collecting river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river section to be detected and the field of view widths of the two cameras, and calculate the angle between the two cameras based on the distances from the two cameras to the river section to be detected and the field of view widths of the two cameras. Calibrate the heights of the two cameras as h, determine the distances from the two cameras to the river section to be detected as d, and at the same time set at least one marking point on the monitored river section to ensure that all the set marking points are included in the pictures collected by the two cameras. Among them, the heights of the two cameras and the distances from the two cameras to the river section to be detected are both kept consistent, and the field of view width of the two cameras is w, where the field of view width is the range of the field of view that can be seen when observing or photographing a scene. The specific formula for calculating the angle between the two cameras based on the distances from the two cameras to the river section to be detected and the field of view widths of the two cameras is: In the formula, α represents the angle between the two cameras. Based on the obtained angle between the two cameras, set the shooting positions of the cameras on the bank of the river section to be detected according to this angle. After calibrating the cameras, collect the river water image information on the surface of the river section in the same detection area at different angles, preprocess the images, and extract and fuse the feature points of the preprocessed images to obtain the fused surface river water image. The logic for extracting and fusing the feature points of the preprocessed images is: use the SIFT algorithm to extract the marking points and feature descriptors in the images, including the positions, sizes and directions of the marking points; perform feature matching on the extracted marking points and feature descriptors using a matcher according to the K-nearest neighbor matching algorithm; set a ratio threshold, and based on the set ratio threshold, screen the matching results and retain the matching results that meet the ratio threshold; fuse the image features at different angles according to the matching results to obtain the fused image features. The formula for calculating the fused image features is: Wherein, BS F (x, y) represents the fused image feature obtained by fusion, E A (x, y) and E B (x, y) respectively represent the matching features in two images with different angles, L A (x, y) and L B (x, y) respectively represent the pixel values at the point (x, y) in two images with different angles, and the image is reconstructed according to the fused image feature obtained by fusion to obtain the fused surface river water image; Based on the fused surface river water image, extract the features of the water surface fluctuations, calculate the water surface fluctuation characteristic parameters, and characterize the surface river water flow velocity in the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The water surface fluctuation characteristic parameters include wave amplitude, wave spacing, water surface inclination and water surface fluctuation frequency. Among them, the wave peaks and wave troughs of the water surface fluctuations are identified through edge detection and contour extraction, and the water surface fluctuation characteristic parameters are calculated based on the coordinate information of the wave peaks and wave troughs. The specific formula is: λ = X peak,n+1 -X peak,n where A, λ, and θ are the amplitude, wavelength, and water surface inclination of the water surface fluctuation, respectively, Y min and Y max represent the height of the wave trough and the height of the wave crest, respectively, X peak,n+1 and X peak,n represent the abscissa of the (n + 1)-th wave crest and the abscissa of the n-th wave crest, respectively; The formula for calculating the water surface fluctuation frequency is: In the formula, f represents the water surface fluctuation frequency, N is the total number of wave peaks, and T is the total time of image acquisition. Characterize the surface river water flow velocity in the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The formula is: In the formula, V is the surface river water flow velocity parameter, C is a proportionality coefficient, ω1, ω2 and ω3 are the weight coefficients of the wave amplitude, wave spacing and water surface fluctuation frequency of the water surface fluctuations respectively. Among them, ω1>ω2≥ω3 and ω1, ω2 and ω3 are all greater than 0. Based on the obtained surface river flow velocity parameters, the flow velocity of the surface river flow velocity parameters is corrected through the Navier-Stokes equation. At the same time, a convergence condition is set. When the output of the iterative correction of the river flow velocity through the Navier-Stokes equation meets the convergence condition, the correction is stopped, and the current surface river flow velocity is output as the accurate value of the surface river flow velocity.

2. The method for measuring the river water flow velocity on the river surface based on machine vision according to claim 1, wherein: The logic for calibrating the cameras is as follows: The Zhang Zhengyou calibration method is used to calibrate two cameras. The specific steps include: making a checkerboard calibration board; moving the calibration board and collecting images; extracting corner points; calibrating the other camera in the same way to obtain the internal and external parameters of the camera. The internal and external parameters include focal length, principal point, and distortion coefficients. The distortion coefficients include radial distortion coefficients and tangential distortion coefficients. Preprocess the image. The preprocessing includes radial distortion correction, tangential distortion correction, and gray normalization. The specific logic for radial distortion correction and tangential distortion correction is as follows: Establish three radial distortion coefficients, calibrated as k1, k2, and k3. The formula for obtaining the ideal image coordinates without distortion is: Establish two tangential distortion coefficients, calibrated as p1 and p2. The model expression of tangential distortion is: Superimpose and combine the two distortions to simultaneously eliminate the influence brought by both. The parameter expression after superimposition is: In the formula, k1, k2, and k3 are three different radial distortion coefficients, p1 and p2 are two different tangential distortion coefficients. The values of the distortion coefficients are determined according to the Zhang Zhengyou calibration method. (x′, y′) represents the image coordinates without distortion under the ideal optical system, (x", y") is the image coordinates of a certain pixel point in the captured image, and r is the distance from the correction point to the imaging center. The image coordinate system takes the optical center as the image center, the origin is the intersection of the camera optical axis and the imaging plane, the positive direction of the X-axis is to the right, and the positive direction of the Y-axis is downward. Normalize the gray level of the image after radial distortion correction and tangential distortion correction, and convert the color image into a gray image. The formula for gray normalization is: gra = 0.2989*R + 0.5870*G + 0.1140*B In the formula, gra is the pixel value of the generated gray image, R represents the pixel value of the red channel in the image after radial distortion correction and tangential distortion correction, G is the pixel value of the green channel in the image, and B is the pixel value of the blue channel in the image.

3. The method for measuring the water flow velocity on the river surface based on machine vision according to claim 1, characterized in that: Based on the obtained surface river flow velocity parameters, the formula for correcting the flow velocity of the surface river flow velocity parameters through the Navier-Stokes equation is: where V cor is the corrected surface river water velocity, V is the surface river water velocity parameter, Δt represents the set time step, ρ is the fluid density, i.e., the density of river water, is the pressure gradient, μ is the kinematic viscosity, represents the Laplacian operator of velocity, and F represents the external volume force, including the gravity of river water and the friction between river water and the river bank; Perform iterative update operations according to this equation, and use the generated V each time cor , as the surface river flow velocity parameter V for the next update, until the set convergence condition is met, stop the correction, and use the currently generated latest generation of V cor as the output representing the exact value of the surface river flow velocity.

4. A river surface water flow velocity measurement system based on machine vision, characterized in that: The machine vision-based river channel surface river flow velocity measurement system is used to execute the machine vision-based river channel surface river flow velocity measurement method according to any one of claims 1-3, and specifically includes: An image acquisition position determination module, used to select two cameras, collect river water image information, determine the heights of the two cameras, determine the distances from the two cameras to the river channel to be detected and the field of view widths of the two cameras, and calculate the included angle between the two cameras based on the distances to the river channel to be detected and the field of view widths of the two cameras. The image feature extraction and fusion module is used to set the shooting positions of the cameras at the angle obtained for the two cameras on the bank of the river to be detected according to this angle. After calibrating the cameras, it collects the river water image information on the surface of the river in the same detection area at different angles, preprocesses the images, and extracts and fuses the feature points of the preprocessed images to obtain the fused surface river water image; The river water flow velocity calculation module is used to extract the characteristics of the water surface fluctuation based on the fused surface river water image, calculate the water surface fluctuation characteristic parameters, and characterize the river water flow velocity on the surface of the detection area based on the water surface fluctuation characteristic parameters to obtain the surface river water flow velocity parameters. The water surface fluctuation characteristic parameters include wave amplitude, wave spacing, water surface inclination angle, and water surface fluctuation frequency; The river water flow velocity correction module is used to correct the surface river water flow velocity parameters through the Navier-Stokes equation based on the obtained surface river water flow velocity parameters, and set the convergence condition at the same time. When the output of the iterative correction of the river water flow velocity through the Navier-Stokes equation meets the convergence condition, stop the correction and output the current surface river water flow velocity as the accurate value of the surface river water flow velocity.

Citation Information

Patent Citations

  • High-precision flow velocity estimation method

    CN116930948A

  • River surface river water flow velocity measurement method based on machine vision

    CN117788879A