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

Through the river water velocity measurement method based on machine vision, multi-view image fusion and Navier-Stokes equation correction are used to solve the accuracy and real-time problems of traditional measurement methods and achieve high-precision and real-time river water velocity monitoring.

CN119338885AActive Publication Date: 2025-01-21KUNMING UNIV OF SCI & TECH +1
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional river flow velocity measurement methods have problems such as low accuracy, poor adaptability, high manual maintenance costs and poor real-time performance, and light changes and water surface fluctuations affect measurement accuracy.

Method used

Using a method based on machine vision, two cameras collect river water images, calculate the angle and set the shooting position, preprocess the images and extract and fuse feature points, extract the characteristic parameters of water surface fluctuations, and use the Navier-Stokes equation to perform Flow rate correction.

Benefits of technology

It improves measurement accuracy and adaptability, reduces manual maintenance costs, and achieves real-time monitoring and high-precision output of river water velocity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338885A_ABST
    Figure CN119338885A_ABST
Patent Text Reader

Abstract

The invention discloses a river surface river water flow velocity measurement method and system based on machine vision, and relates to the field of river water flow velocity measurement. Comprising the following steps: selecting two cameras, collecting river water image information at different angles, and calculating an included angle between the two cameras based on a distance to a to-be-detected river channel and view widths of the two cameras; after the camera is calibrated, collecting river surface river water image information of the same detection area at different angles, preprocessing the image, and performing feature point extraction and fusion on the preprocessed image to obtain a fused surface river water image; on the basis of the fused surface river water image, extracting water surface fluctuation characteristics, calculating water surface fluctuation characteristic parameters, and representing the surface river water flow velocity on the basis of the characteristic parameters; and based on the obtained surface river water flow velocity parameter, performing flow velocity correction on the surface river water flow velocity parameter through a Navier-Stokes equation, and outputting an 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 water flow velocity measurement, and in particular to a method and system for measuring river water flow velocity on a river surface based on machine vision. Background Art

[0002] In recent years, with the increasing shortage of water resources and the intensification 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 use of water resources, but also provide important references for flood warning, ecological protection and water quality monitoring. However, traditional water flow velocity measurement methods mostly rely on physical measuring instruments, such as flow meters and buoys. Although these methods can obtain river flow velocity to a certain extent, they often have some technical bottlenecks, such as low accuracy, poor adaptability, and high labor maintenance costs.

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

[0004] The real-time performance of flow velocity measurement is also an issue that cannot be ignored. Traditional equipment usually requires regular maintenance and calibration, and under extreme weather or water flow conditions, the measurement equipment may malfunction, resulting in inaccurate or missing data. In addition, the data acquisition and processing cycle is long, which affects the real-time monitoring and response capabilities of dynamic changes in water flow. Therefore, a new method is urgently needed to efficiently and accurately measure the water velocity on the river surface.

[0005] In the prior art, the publication number CN117788879A discloses a method for measuring the flow rate of a river surface based on machine vision, which includes the following steps: Step 1, obtaining multiple frames of images of the river surface, each frame of the image contains a marker; Step 2, determining the geometric size of the marker from each frame of the image obtained in Step 1, and calculating the reference distance of the floating object according to the geometric size of the marker; Step 3, using the trained target detection network to detect and identify each floating object from each frame of the image, and then determining the coordinates of each floating object in each frame of the image; Step 4, calculating the average flow velocity of all floating objects in the current frame of the image; Step 5, calculating the water flow velocity of the current frame of the image according to the average flow velocity of all floating objects in the current frame of the image. However, in this scheme, changes in lighting conditions (such as shadows, sunlight intensity, etc.) will affect the image quality and the visibility of the marker, thereby affecting the accuracy of target detection and speed calculation. At the same time, the fluctuations and ripples on the water surface will cause the movement trajectory of the floating object to become complicated, thereby increasing the measurement error. Therefore, calculating the water flow velocity on the river surface by identifying markers and the displacement and time of the standard objects not only wastes computing resources, but also reduces the accuracy and effectiveness of the acquired flow velocity data.

[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one 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 river water flow velocity on a river surface based on machine vision to solve the problems raised in the above-mentioned background technology.

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

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

[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 channel to be detected and the widths of the fields of view of the two cameras, and calculate the angle between the two cameras based on the distances to the river channel to be detected and the widths of the fields of view of the two cameras;

[0011] Based on the obtained angle between the two cameras, the shooting position of the camera is set according to the angle on the bank of the river to be detected. After the camera is calibrated, the river surface water image information of the river in the same detection area at different angles is collected, the image is preprocessed, and the feature points of the preprocessed image are extracted and fused to obtain the fused surface river water image;

[0012] Based on the fused surface river water image, the characteristics of water surface fluctuations are extracted, and the characteristic parameters of water surface fluctuations are calculated. The surface river water velocity of the river channel in the detection area is characterized based on the characteristic parameters of water surface fluctuations to obtain the surface river water velocity parameters. The characteristic parameters of water surface fluctuations include amplitude, wave spacing, water surface inclination and water surface fluctuation frequency;

[0013] Based on the obtained surface river water velocity parameters, the surface river water velocity parameters are corrected by the Navier-Stokes equation, and convergence conditions are set. When the output of the iterative correction of the river water velocity by the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

[0014] Furthermore, the height of the two cameras is calibrated as h, and the distance from the two cameras to the river to be detected is determined as d. At the same time, at least one marking point is set on the monitored river to ensure that the pictures collected by the two cameras contain all the set marking points, wherein the height of the two cameras and the distance from the two cameras to the river to be detected are consistent, and the field of view width of the two cameras is w, wherein the field of view width is the range of the field of view that can be seen when observing or shooting 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 angle between the two cameras is:

[0015]

[0016] Where α represents the angle between the two cameras.

[0017] Furthermore, the two cameras are calibrated using Zhang Zhengyou's calibration method, and the specific steps include: making a checkerboard calibration plate; moving the calibration plate to collect images; extracting corner points; calibrating another camera in the same way to obtain camera internal and external parameters, the internal and external parameters including focal length, principal point and distortion coefficient, the distortion coefficient including radial distortion coefficient and tangential distortion coefficient;

[0018] 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:

[0019]

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

[0021]

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

[0023]

[0024] In the formula, 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 the Zhang Zhengyou calibration method. ′ ,y ′ ) represents the image coordinates without distortion under an ideal optical system, (x", y") is the image coordinates of a pixel in the captured image, r is the distance from the correction point to the imaging center, where 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, and is established with the right as the positive direction of the X axis and the downward as the positive direction of the Y axis;

[0025] The image after radial distortion correction and tangential distortion correction is grayscale normalized to convert the color image into a grayscale image. The formula for grayscale normalization is:

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

[0027] Where 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 extracting and fusing feature points of the preprocessed image is as follows: using the SIFT algorithm to extract marker points and feature descriptors in the image, including the position, size and direction of the marker points; performing feature matching on the extracted marker points and feature descriptors using a matcher according to the K nearest neighbor matching algorithm; setting a ratio threshold, filtering the matching results based on the set ratio threshold, and retaining the matching results that meet the ratio threshold; fusing image features at different angles according to the matching results to obtain fused image features, and the formula for calculating the fused image features is:

[0029]

[0030] In the formula, BS F (x, y) represents the fused image features, E A (x,y) and E B (x, y) represent the matching features in two images at different angles, L A (x,y) and L B(x, y) respectively represent the pixel values ​​of two images at different angles at the point (x, y), and the image is reconstructed according to the fused image features obtained to obtain a fused surface river water image.

[0031] Furthermore, based on the fused surface river water image, the characteristics of the water surface fluctuation are extracted, and the characteristic parameters of the water surface fluctuation are calculated, wherein the peaks and troughs of the water surface fluctuation are identified by edge detection and contour extraction, and the characteristic parameters of the water surface fluctuation are calculated based on the coordinate information of the peaks and troughs, wherein the specific formula is as follows:

[0032]

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

[0034]

[0035] Where A, λ and θ are the amplitude, wave spacing and water surface inclination of the water surface, respectively. min and Y max Represent the height of the trough and the height of the peak, respectively, X peak,n+1 and X peak,n Respectively represent the abscissa of the n+1th peak and the abscissa of the nth peak;

[0036] The calculation formula of water surface fluctuation frequency is:

[0037]

[0038] Where f is the frequency of water surface fluctuation, N is the total number of wave peaks, and T is the total time of image acquisition.

[0039] Furthermore, the surface water velocity of the river in the detection area is characterized based on the water surface fluctuation characteristic parameters to obtain the surface water velocity parameters, where the formula is:

[0040]

[0041] Where V is the surface river velocity parameter, C is the proportional coefficient, ω1, ω2 and ω3 are the weight coefficients of the amplitude, wave spacing and frequency of water surface fluctuations, respectively, where ω1>ω2≥ω3 and ω1, ω2 and ω3 are all greater than 0.

[0042] Furthermore, based on the obtained surface river water velocity parameters, the formula for velocity correction of the surface river water velocity parameters by the Navier-Stokes equation is as follows:

[0043]

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

[0045] According to this equation, iterative update operation is performed, and each generated V cor , as the next updated surface river velocity parameter V, until it meets the set convergence conditions, stop the correction, and use the latest generation V cor The output is an accurate value of the surface river velocity.

[0046] The present invention also provides a river surface water flow velocity measurement system based on machine vision, wherein the river surface water flow velocity measurement system based on machine vision is used to perform the above-mentioned river surface water flow velocity measurement method based on machine vision, comprising:

[0047] The image acquisition position determination module 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 widths of the fields of view of the two cameras, and calculate the angle between the two cameras based on the distances to the river channel to be detected and the widths of the fields of view of the two cameras;

[0048] The image feature extraction and fusion module is used to set the shooting position of the camera according to the angle between the two cameras on the bank of the river to be detected, calibrate the camera, collect river water image information on the river surface of the same detection area at different angles, pre-process the image, extract and fuse the feature points of the pre-processed image, and obtain a fused surface river water image;

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

[0050] The river water velocity correction module is used to perform velocity correction on the surface river water velocity parameters through the Navier-Stokes equation based on the obtained surface river water velocity parameters, and set the convergence conditions at the same time. When the output of the iterative correction of the river water velocity through the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

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

[0052] First, through the reasonable arrangement and precise calibration of the cameras, the water surface fluctuation characteristics can be captured at different angles in 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 error caused by a single view, thus providing a more reliable basis for subsequent analysis.

[0053] Secondly, the extracted water surface fluctuation characteristic parameters, including amplitude, wave spacing, inclination and water surface fluctuation frequency, are used to quantitatively analyze the water flow velocity in the river. These fluctuation characteristics can fully reflect the dynamic characteristics of the water flow, so that the changes in water flow can be grasped in real time, so as to make timely responses in water resource allocation, ecological monitoring and flood prevention and early warning. In addition, the process of correcting the surface velocity parameters using the Navier-Stokes equation not only ensures the high accuracy and credibility of the final velocity output, but also makes this method scientific and rigorous. By setting appropriate convergence conditions, all calculation processes can be optimized in iterations, thereby gradually approaching the actual 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 DESCRIPTION

[0056] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is 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 be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0058] Example:

[0059] See also Figure 1, the present invention provides a technical solution:

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

[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 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 to the river channel to be detected and the field of view widths of the two cameras;

[0062] The height of the two cameras is calibrated as h, and the distance from the two cameras to the river to be detected is determined as d. At the same time, at least one marking point is set on the monitored river to ensure that the pictures collected by the two cameras contain all the set marking points. The height of the two cameras and the distance from the two cameras to the river to be detected are consistent. 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 shooting 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 angle between the two cameras is:

[0063]

[0064] Where α represents the angle between the two cameras.

[0065] By setting up two cameras, image information of the river surface can be captured from different angles and viewpoints at the same time. This multi-view configuration can more comprehensively obtain the characteristics of water surface fluctuations and avoid information loss or misjudgment caused by a single viewpoint. In traditional technology, measurements usually rely on a single sensor, which is easily affected by factors such as viewing angle limitations and light changes. This solution greatly improves the quality and reliability of data through the collaborative work of dual cameras.

[0066] At the same time, at least one marking point is set on the monitored river channel to ensure that the images captured by the two cameras contain all the set marking points. This marking point is used 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, the shooting position of the camera is set according to the angle on the bank of the river to be detected. After the camera is calibrated, the river surface image information of the river in the same detection area at different angles is collected, the image is preprocessed, and feature points are extracted and fused for the preprocessed image to obtain a 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] In the formula, 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 the Zhang Zhengyou calibration method. ′ ,y ′ ) represents the image coordinates without distortion under an ideal optical system, (x", y") is the image coordinates of a pixel in the captured image, r is the distance from the correction point to the imaging center, where 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, and is established with the right as the positive direction of the X axis and the downward as the positive direction of the Y axis;

[0079] The image after radial distortion correction and tangential distortion correction is grayscale normalized to 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] Where 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 color images to grayscale images can reduce data dimensions and make image processing more efficient. Color images usually involve more calculations and complex color space conversions when extracting features, while grayscale images simplify this process. Especially when processing high-frequency fluctuation features, grayscale images can often show changes more clearly, and the amount of data in grayscale images is relatively small, and the processing speed is significantly improved. Especially in real-time monitoring scenarios, fast processing can provide timely data support for subsequent flow velocity calculations, avoiding response lags caused by calculation delays.

[0083] The SIFT algorithm is used to extract the markers and feature descriptors in the image, including the position, size and direction of the markers; the extracted markers and feature descriptors are matched using a matcher according to the K nearest neighbor matching algorithm; a ratio threshold is set, and based on the set ratio threshold, the matching results are screened, and the matching results that meet the ratio threshold are retained; according to the matching results, the image features at different angles are fused to obtain the fused image features. The formula for calculating the fused image features is:

[0084]

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

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

[0087] Based on the fused surface river water image, the characteristics of the water surface fluctuation are extracted and the characteristic parameters of the water surface fluctuation are calculated. The water surface fluctuation peaks and troughs are identified by edge detection and contour extraction. Common edge detection algorithms such as Canny edge detection and Sobel operator can be used. The contour detection function (such as findContours) in OpenCV and other libraries is used to extract the contour from the edge image. The characteristic parameters of the water surface fluctuation are calculated based on the coordinate information of the peaks and troughs. The specific formula is as follows:

[0088]

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

[0090]

[0091] Where A, λ and θ are the amplitude, wave spacing and water surface inclination of the water surface, respectively. min and Y max Represent the height of the trough and the height of the peak, respectively, X peak,n+1 and X peak,n Respectively represent the abscissa of the n+1th peak and the abscissa of the nth peak;

[0092] The calculation formula of water surface fluctuation frequency is:

[0093]

[0094] Where f is the frequency of water surface fluctuation, N is the total number of wave peaks, and T is the total time of image acquisition.

[0095] Based on the water surface fluctuation characteristic parameters, the surface water velocity of the river in the detection area is characterized to obtain the surface water velocity parameters, where the formula is:

[0096]

[0097] Where V is the surface river velocity parameter, C is the proportional coefficient, ω1, ω2 and ω3 are the weight coefficients of the amplitude, wave spacing and frequency of water surface fluctuations, respectively, where ω1>ω2≥ω3 and ω1, ω2 and ω3 are all greater than 0.

[0098] Larger amplitudes usually mean stronger water flows. The larger the amplitude, the stronger the flow energy, making the fluctuation process more obvious. The wave spacing is proportional to the flow velocity. A longer wave spacing often indicates a faster flow velocity. An inclined water surface indicates the presence of water flow. The greater the flow velocity, the greater the inclination angle. The fluctuation frequency is the number of times the fluctuation occurs per unit time. The frequency is directly related to the flow velocity. The fluctuation frequency of a water surface with a fast flow velocity is usually higher. Since the amplitude of the water surface fluctuation reflects the water flow velocity to a greater extent than the frequency of the water surface fluctuation and the wave spacing, ω1>ω2≥ω3 is set.

[0099] Step 4: Based on the obtained surface river water velocity parameters, the surface river water velocity parameters are corrected by the Navier-Stokes equation, and the convergence conditions are set at the same time. When the output of the iterative correction of the river water velocity by the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

[0100] Based on the obtained surface river water velocity parameters, the formula for velocity correction of the surface river water velocity parameters by the Navier-Stokes equation is as follows:

[0101]

[0102] Where V cor is the corrected surface river velocity, V is the surface river velocity parameter, Δt represents the set time step, ρ is the fluid density, i.e., the density of the river water, is the pressure gradient, μ is the kinematic viscosity, represents the Laplace operator of velocity, F represents the external volume force, including the gravity of the river water and the friction between the 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 about 0.001 Pa·s, but it is affected by temperature and dissolved substances. The Laplace operator of the velocity field is calculated in the computational domain by numerical methods (such as finite difference method, finite element method, etc.), and the pressure field data can be obtained by CFD simulation.

[0104] According to this equation, iterative update operation is performed, and each generated V cor , as the next updated surface river velocity parameter V, until it meets the set convergence conditions, stop the correction, and use the latest generation V cor The output is an accurate value of the surface river velocity.

[0105] The iterative update operation includes: updating the corrected surface river flow velocity, calculating the velocity Laplace operator at the current water flow velocity Since the velocity V changes in each iteration, it needs to be recalculated. The external body force F is updated according to the latest 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 these steps and iterative updates of variables, the accurate value of the surface river flow velocity can be gradually approached.

[0106] The convergence condition can be set as a fixed number of iterations. When the number of iterations of the loop reaches the set number of iterations, the iterative update operation is stopped and the final V cor As output, it represents the corrected surface river velocity; or define a convergence index of the velocity field, compare the velocity difference in each iteration with the convergence index of the velocity field, and stop the iterative update operation if the velocity difference between two iterations is less than the convergence index of the velocity field, and use the final V cor As output, the corrected surface river velocity is represented.

[0107] See also Figure 2 The present invention also provides a river surface water flow velocity measurement system based on machine vision, wherein the river surface water flow velocity measurement system based on machine vision is used to perform the above-mentioned river surface water flow velocity measurement method based on machine vision, comprising:

[0108] The image acquisition position determination module 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 widths of the fields of view of the two cameras, and calculate the angle between the two cameras based on the distances to the river channel to be detected and the widths of the fields of view of the two cameras;

[0109] The image feature extraction and fusion module is used to set the shooting position of the camera according to the angle between the two cameras on the bank of the river to be detected, calibrate the camera, collect river water image information on the river surface of the same detection area at different angles, pre-process the image, extract and fuse the feature points of the pre-processed image, and obtain a fused surface river water image;

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

[0111] The river water velocity correction module is used to perform velocity correction on the surface river water velocity parameters through the Navier-Stokes equation based on the obtained surface river water velocity parameters, and set the convergence conditions at the same time. When the output of the iterative correction of the river water velocity through the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

[0112] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0113] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed 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, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A method for measuring river flow velocity on a river surface 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 channel to be detected and the widths of the fields of view of the two cameras, and calculate the angle between the two cameras based on the distances to the river channel to be detected and the widths of the fields of view of the two cameras; Based on the obtained angle between the two cameras, the shooting position of the camera is set according to the angle on the bank of the river to be detected. After the camera is calibrated, the river surface water image information of the river in the same detection area at different angles is collected, the image is preprocessed, and the feature points of the preprocessed image are extracted and fused to obtain the fused surface river water image; Based on the fused surface river water image, the characteristics of water surface fluctuations are extracted, and the characteristic parameters of water surface fluctuations are calculated. The surface river water velocity of the river channel in the detection area is characterized based on the characteristic parameters of water surface fluctuations to obtain the surface river water velocity parameters. The characteristic parameters of water surface fluctuations include amplitude, wave spacing, water surface inclination and water surface fluctuation frequency; Based on the obtained surface river water velocity parameters, the surface river water velocity parameters are corrected by the Navier-Stokes equation, and convergence conditions are set. When the output of the iterative correction of the river water velocity by the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

2. The method for measuring river flow velocity on a river surface based on machine vision according to claim 1, characterized in that: The height of the two cameras is calibrated as h, and the distance from the two cameras to the river to be detected is determined as d. At the same time, at least one marking point is set on the monitored river to ensure that the pictures collected by the two cameras contain all the set marking points. The height of the two cameras and the distance from the two cameras to the river to be detected are consistent. 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 shooting 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 angle between the two cameras is: Where α represents the angle between the two cameras.

3. The method for measuring river flow velocity on a river surface based on machine vision according to claim 2, characterized in that: The logic for calibrating the camera is as follows: two cameras are calibrated using Zhang Zhengyou's calibration method, and the specific steps include: making a checkerboard calibration plate; moving the calibration plate to collect images; extracting corner points; calibrating another camera in the same way to obtain the camera's internal and external parameters, the internal and external parameters including focal length, principal point and distortion coefficient, the distortion coefficient including radial distortion coefficient and tangential distortion coefficient; 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: Two tangential distortion coefficients are established and calibrated as p1 and p2. The model expression of tangential distortion is: By combining the two distortions, the effects of both can be eliminated at the same time. The parameter expression after superposition is: In the formula, 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 the Zhang Zhengyou calibration method. ′ ,y ′ ) represents the image coordinates without distortion under an ideal optical system, (x", y") is the image coordinates of a pixel in the captured image, r is the distance from the correction point to the imaging center, where 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, and is established with the right as the positive direction of the X axis and the downward as the positive direction of the Y axis; The image after radial distortion correction and tangential distortion correction is grayscale normalized to convert the color image into a grayscale image. The formula for grayscale normalization is: gra=0.2989*R+0.5870*G+0.1140*B Where 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.

4. The method for measuring river flow velocity on a river surface based on machine vision according to claim 2, characterized in that: The logic for extracting and fusing feature points of the preprocessed image is as follows: using the SIFT algorithm to extract markers and feature descriptors in the image, including the position, size and direction of the markers; using a matcher to match the extracted markers and feature descriptors according to the K nearest neighbor matching algorithm; setting a ratio threshold, filtering the matching results based on the set ratio threshold, and retaining the matching results that meet the ratio threshold; fusing image features at different angles according to the matching results to obtain fused image features. The formula for calculating fused image features is: In the formula, BS F (x, y) represents the fused image features, E A (x,y) and E B (x, y) represent the matching features in two images at different angles, L A (x,y) and L B (x, y) respectively represent the pixel values ​​of two images at different angles at the point (x, y), and the image is reconstructed according to the fused image features obtained to obtain a fused surface river water image.

5. The method for measuring river water flow velocity on a river surface based on machine vision according to claim 4, characterized in that: Based on the fused surface river water image, the characteristics of water surface fluctuations are extracted and the characteristic parameters of water surface fluctuations are calculated. The peaks and troughs of water surface fluctuations are identified by edge detection and contour extraction, and the characteristic parameters of water surface fluctuations are calculated based on the coordinate information of the peaks and troughs. The specific formula is as follows: λ=X peak,n+1 -X peak,n Where A, λ and θ are the amplitude, wave spacing and water surface inclination of the water surface, respectively. min and Y max Represent the height of the trough and the height of the peak, respectively, X peak,n+1 and X peak,n Respectively represent the abscissa of the n+1th peak and the abscissa of the nth peak; The calculation formula of water surface fluctuation frequency is: Where f is the frequency of water surface fluctuation, N is the total number of wave peaks, and T is the total time of image acquisition.

6. The method for measuring river flow velocity on a river surface based on machine vision according to claim 5, characterized in that: Based on the water surface fluctuation characteristic parameters, the surface water velocity of the river in the detection area is characterized to obtain the surface water velocity parameters, where the formula is: Where V is the surface river velocity parameter, C is the proportional coefficient, ω1, ω2 and ω3 are the weight coefficients of the amplitude, wave spacing and frequency of water surface fluctuations, respectively, where ω1>ω2≥ω3 and ω1, ω2 and ω3 are all greater than 0.

7. The method for measuring river flow velocity on a river surface based on machine vision according to claim 1, characterized in that: Based on the obtained surface river water velocity parameters, the formula for velocity correction of the surface river water velocity parameters by the Navier-Stokes equation is as follows: Where V cor is the corrected surface river velocity, V is the surface river velocity parameter, Δt represents the set time step, ρ is the fluid density, i.e., the density of the river water, is the pressure gradient, μ is the kinematic viscosity, represents the Laplace operator of velocity, F represents the external volume force, including the gravity of the river water and the friction between the river water and the river bank; According to this equation, iterative update operation is performed, and each generated V cor , as the next updated surface river velocity parameter V, until it meets the set convergence conditions, stop the correction, and use the latest generation V cor The output is an accurate value of the surface river velocity.

8. A river surface water velocity measurement system based on machine vision, characterized in that: The river surface water flow velocity measurement system based on machine vision is used to execute the river surface water flow velocity measurement method based on machine vision according to any one of claims 1 to 7, and specifically comprises: The image acquisition position determination module 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 widths of the fields of view of the two cameras, and calculate the angle between the two cameras based on the distances to the river channel to be detected and the widths of the fields of view of the two cameras; The image feature extraction and fusion module is used to set the shooting position of the camera according to the angle between the two cameras on the bank of the river to be detected, calibrate the camera, collect river water image information on the river surface of the same detection area at different angles, pre-process the image, extract and fuse the feature points of the pre-processed image, and obtain a fused surface river water image; A river water velocity calculation module is used to extract the characteristics of water surface fluctuations based on the fused surface river water image, calculate the water surface fluctuation characteristic parameters, characterize the river water velocity on the surface of the river channel in the detection area based on the water surface fluctuation characteristic parameters, and obtain the surface river water velocity parameters, wherein the water surface fluctuation characteristic parameters include amplitude, wave spacing, water surface inclination angle and water surface fluctuation frequency; The river water velocity correction module is used to perform velocity correction on the surface river water velocity parameters through the Navier-Stokes equation based on the obtained surface river water velocity parameters, and set the convergence conditions at the same time. When the output of the iterative correction of the river water velocity through the Navier-Stokes equation meets the convergence conditions, the correction is stopped and the current surface river water velocity is output as the precise value of the surface river water velocity.

Citation Information

Patent Citations

  • River surface flow velocity estimation method based on optical flow calculation and readable storage medium

    CN113012195A

  • High-precision flow velocity estimation method

    CN116930948A

  • River surface flow velocity measurement method based on water surface floating object target tracking

    CN116934808A

  • Water flow velocity estimation method and system based on traditional optical flow calculation

    CN117576168A

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

    CN117788879A