River flow measurements are of great significance for flood prevention. Traditional immersion measurement methods not only consume manpower and material resources but are also greatly affected by the environment. Non-immersion image flow measurement methods have attracted widespread attention owing to their simplicity and safety. This paper proposes a flow measurement algorithm based on the scalar transport equation. Combining the scalar transport equation with fluid mechanics is more consistent with hydrodynamic characteristics and provides a better physical basis than other methods. Simultaneously, to calculate the two-dimensional velocity vector, it is assumed that the 3 × 3-pixel area at the speed measurement point exhibits exactly the same motion trend between two adjacent frames. Because only a few key speed measurement points are calculated, the calculation time of this method is significantly reduced compared with other methods. To verify the feasibility of the algorithm, two rivers at hydrological stations were selected to estimate their flow. The experimental results show that the total flow error of the proposed method is only 3.29 and 2.79% compared with the total flow measured by the current meter, which is a significant improvement over other methods.

  • In fluid mechanics, based on the scalar transport equation, endow the model with better physical interpretability.

  • Assumption of small-scale motion consistency.

  • Describes the Eulerian motion of the flow field rather than Lagrangian motion.

  • Calculations are made more efficient by only a few specific speed measurement points.

River flow measurements are crucial for predicting and managing floods. Accurate flood warning information can be provided by monitoring river flow changes in real-time, helping to take timely response measures and reduce losses caused by floods (Jiang et al. 2022). It is also crucial to protect and restore river ecosystems. By understanding flow changes, we can assess the impact of rivers on ecosystems, develop appropriate protection measures, and maintain river biodiversity and ecological balance. It is difficult to perform normal measurements during the flood season by using traditional immersion flow measurement methods. With the development of computer vision, nonimmersion image flow measurement methods have become more mature and efficient. Currently, image velocimetry methods are divided into two categories: particle and variational optical flow-based image velocimetry.

Particle image velocimetry (PIV) technique (Adrian 1991), as a classical method in the field of image velocimetry, is used to calculate the flow rate by dispersing tiny particles as tracers into the fluid and capturing the motion trajectories of these particles using a high-speed camera, which is then used to calculate the flow rate by image analysis techniques. However, the effectiveness of the PIV technique is highly dependent on the uniform distribution and proper size of the tracers, which is often challenging in practice. To address this limitation, Fujita et al. (1998) innovatively proposed large scale particle image velocimetry (LSPIV), which does not require the artificial addition of tracers but rather utilizes the natural texture of the river surface or floating objects (e.g., leaves and bubbles) as the markers of velocimetry, which avoids the potential impact of tracers on the environment and broadens the scope of velocimetry techniques. Nevertheless, LSPIV still faces the problems of high computational complexity and difficulty in real-time data processing.

To overcome this difficulty, Fujita et al. (2007) further developed the spatio-temporal image velocimetry (STIV) method, which calculates the flow velocity by setting up velocimetry lines parallel to the main flow direction in the river and utilizing the texture angle formed by the velocimetry lines in the consecutive frames of the image. STIV is well known for its simplicity and efficiency but is limited to the acquisition of one-dimensional flow velocity information, which makes it difficult to comprehensively reflect the 2D characteristics of the flow field and is susceptible to image noise interference. In order to improve the accuracy and robustness of velocimetry, researchers have explored a variety of image preprocessing and post-processing techniques, such as Hu et al. (2023), who proposed a sample-enhanced hybrid frequency domain dataset and improved MobileNet-STIV algorithm based on the sample-enhanced hybrid frequency domain dataset to optimize the flow velocity estimation through deep learning techniques.

Meanwhile, the velocimetry methods based on variable spectral flow have been developing continuously. The classical model of Horn & Schunck (1981) is based on the assumption of luminance constancy, which is mathematically concise and clear but lacks a physical basis, which restricts its application in real complex flow fields. In order to enhance the physical meaning of the model, researchers have attempted to replace the brightness constancy assumption with the mass conservation equation (Béréziat et al. 2000) or the continuity equation (Corpetti et al. 2000; Corpetti et al. 2002; Corpetti et al. 2003; Corpetti et al. 2006) and to incorporate higher-order regularization techniques, such as second-order scattering-rotation regularization, in order to better capture the scattering and rotational characteristics of the fluid. However, while these improvements improve the physical accuracy of the model, they also increase the computational complexity and demand for computational resources.

In order to balance the model accuracy and computational efficiency, Liu & Shen (2008) proposed the projected equations of motion for fluid visualization, which provides physical constraints by introducing the Navier–Stokes equations, but the resulting nonlinear equations are complicated to solve, and an approximate solution method is required for practical applications. Cassisa et al. (2011) and Zille et al. (2014) studies, on the other hand, focus on the combination of the large vortex simulation with the subgrid transport equation model to improve the ability to describe complex flow fields by considering the small-scale velocity components of turbulence, but the turbulent diffusion coefficients in the model still need to be selected empirically, which limits the generalization of the model.

To overcome these limitations, Cai et al. (2018) constructed a stochastic optical flow constraint equation based on the theoretical framework of Mémin (2014) by decomposing the fluid motion into a large-scale component and a small-scale component (positional uncertainty) and combining it with a stochastic expression of the Reynolds transport theorem, in which the parameters can be obtained by estimation without relying on empirical values. In addition, the grouped flow measurement method (FD-DIS-G) combining inter-frame differencing and fast dense optical flow proposed by Wang et al. (2022) effectively improves the accuracy and efficiency of the velocity measurement by calculating the motion saliency map and optimizing the dense optical flow displacement. Zach et al. (2007), in order to solve the problem of the discontinuity of the flow field in the variationally divergent optic flow, proposed a method based on the full-variation (TV) regularization and the data term in the robust L1 paradigm, which is more robust to illumination errors and outliers.

In recent years, with the rapid development of computational technology, the integration of variational optical flow algorithms with other advanced techniques has become a new research hotspot, such as orthogonal decomposition (Stapf & Garbe 2014), wavelet expansion with higher-order regularization (Dérian et al. 2013), optimal control scheme (Papadakis & Mémin 2008), and Bayesian stochastic filtering (Beyou et al. 2013), and the introduction of these methods has provided a richer and more flexible solution for flow velocity measurement, which further promotes non-immersive image flow measurement technology development and application.

The classical variational optical flow is not derived from physical derivation, without a certain physical basis, and is not robust to light changes. Other methods transform the data term and regular term of classical variational photocurrent, due to the need to seek the optimal solution of photocurrent for all pixel points of the whole image by iterating continuously, which leads to low computational efficiency and cannot be well calculated in real-time, the existing algorithms need to be improved. Based on the scalar transport equation, Batchelor (1967) can better conform to the hydrodynamic characteristics of the fluid, with certain physical interpretations, and only for a few characteristics of the velocimetry points, the computational efficiency is more efficient compared to other methods. Therefore, this study proposes a novel optical flow computation method based on the scalar transport equation, aiming to address the deficiencies of existing algorithms in terms of physical basis and computational efficiency. By incorporating the scalar transport equation, which has a clear physical interpretation, this method can better adapt to optical flow estimation under complex conditions and significantly enhance computational efficiency. It provides an innovative solution for real-time and efficient optical flow computation, paving the way for new possibilities in applications related to computer vision, fluid dynamics, and other relevant fields.

Algorithmic principle

The classical variational optical flow method is based on the brightness constant assumption, in which the brightness of the same target remains constant between adjacent frames. The target's movement is small: the target's displacement between adjacent frames is very small; that is, the speed change rate is basically zero.

According to the constant brightness assumption, considering that the light intensity of a pixel at time t is , represents the horizontal and vertical coordinates of the pixel and moves to at time . From the constant brightness assumption, we know that according to the brightness constant assumption.
(1)
Taylor expansion of the right side of Equation (1) yields:
(2)
where denotes a high-order infinitesimal quantity that can be ignored. Subtract from the left and right sides of Equation (2) and divide by simultaneously.
(3)
Then let formula (3) can be rewritten as:
(4)
where is the partial derivative of the grayscale of the pixel in the image along the direction of direction. is the velocity vector of optical flow along the x and y axes. At this time, there are two unknown variables but only one constraint equation. This is called the aperture problem in optical flow. A second assumption was introduced to solve this problem: the velocity change rate of the target is zero. That is:
(5)
For all pixels, the above equation and the minimum equation must be satisfied, and by combining Equations (4) and (5), we establish the minimization equation of the following equation:
(6)

denotes the weight coefficient at which the equation is solved to obtain the minimum solution.

The optical flow method essentially solves the aperture problem under the assumption of constant brightness, and the data items in the variational optical flow method proposed by Horn and Schunck have no physical meaning. Therefore, a scalar transport equation derived from the convection–diffusion equation with physical meaning is introduced to replace the constant brightness assumption of the traditional variational optical flow, which is used to describe the velocity field of the scalar concentration C in the fluid.
(7)
where C is the scalar field concentration, is the Hamiltonian operator, and represents the direction vectors along the axes. is the velocity vector and is the Laplace operator. Where and denote the Reynolds and Schmidt numbers, respectively.
For a two-dimensional incompressible fluid, the density remains constant, and the velocity divergence is zero.
(8)
Then, formula (7) can be transformed into:
(9)
In a scalar image, grayscale I is related to the scalar concentration CCorpetti et al. (2002) proposed to estimate cloud motion, where Z is the observation depth. In a two-dimensional scalar image, the observation depth Z is zero. Therefore, in , Equation (9) can be rewritten as:
(10)
Make appropriate transformation and expansion of formula (10):
(11)
Then, we let , , , , , Equation (11) can be rewritten as:
(12)
where represents the difference in the image in the direction, as shown in Figure 1.
Figure 1

Differential schematic diagram.

Figure 1

Differential schematic diagram.

Close modal
According to Figure 1, can be approximately calculated using the following equations:
(13)
(14)
(15)
it is related to the first-order difference, as shown in the following equations:
(16)
(17)
At this point, there are still two unknowns in the formula . In order to solve this problem, the condition is set that the 3 × 3-pixel area around the calculation point and it have the same motion, as shown in Figure 2. Therefore, 9-pixel points within the 3 × 3-pixel window in the range of the calculation point are selected to be associated, and the equation is established, as shown in the following equation:
(18)
Figure 2

Schematic diagram of the motion consistency assumption.

Figure 2

Schematic diagram of the motion consistency assumption.

Close modal
Let , , , and after matrix operation, we can get:
(19)
Expand to:
(20)

Projective transformations and displacement transformations

Using an optimized algorithm, the pixel-level displacement changes between two adjacent frames at each velocimetry point on the section line can be accurately calculated. Using the principle of projection transformation (Gonzalez 2009), we can convert this pixel-level displacement change into displacement in real physical space. Subsequently, the average flow rate as well as the flow rate can be further calculated by combining the specific data of the section line. In order to establish the correspondence between the coordinates on the image and the actual geographic location, I selected four iconic reference points on both sides of the river. As shown in Figure 3, point A is set as the origin of the coordinate system; subsequently, using point A as the reference, line segment AB is defined as the X-axis and line segment AD as the Y-axis, thus constructing a complete right-angle coordinate system. Within the framework of this coordinate system, it is possible to accurately determine the actual coordinate position of each calibrated point .
Figure 3

Ground calibration and image coordinate conversion.

Figure 3

Ground calibration and image coordinate conversion.

Close modal
On the river image, find the pixel coordinates of each calibration point , establish a one-to-one correspondence between and , and utilize the principle of projection transformation to find the transformation matrix , and the pixel point coordinates correspond to the points in the actual coordinates, whose relationship is:
(21)
(22)
The actual coordinates are: , i.e.:
(23)

The initial coordinates of the velocimetry points on the section line can be accurately mapped to their corresponding positions in the real environment by applying a projection transformation matrix p. When the optical flow information is updated, the pixel coordinates of these velocimetry points on the image change accordingly to . Subsequently, these updated pixel coordinates are again transformed back to the coordinates in the actual environment using the projection transformation matrix . After this conversion process is complete, the actual displacement of each velocimeter point between two consecutive frames can be easily calculated . This displacement value is obtained by comparing the difference in the actual coordinates of the velocimeter point in the two frames before and after. Next, in order to find the surface flow velocity of each velocimetry point as well as the plumb line average flow velocity, it is only necessary to divide this displacement value by the time interval between the two neighboring frames.

Calculation of average river flow rate and total flow

The river cross-section is shown schematically in Figure 4, Assuming that the surface velocity at the velocity point i is , , n is the number of velocity points on the cross-section, the cross-sectional area corresponding to the velocity points to i is , and the average surface velocity between velocity points to i is :
(24)
(25)
(26)
where is the water depth corresponding to the velocity point i, are the shore depths, is the distance between points i and , is the distance from the velocity point n to the shore, and m is the shore coefficient. The relationship between the plumbline mean flow velocity and the surface flow velocity is:
(27)
where is the vertical average velocity and k is the surface velocity coefficient. According to the velocity-area method (River Flow Test Specification 2015), the flow rate of the water-passing section can be obtained as follows:
(28)
Figure 4

Schematic diagram of river cross-section.

Figure 4

Schematic diagram of river cross-section.

Close modal
The total flow of the river Q is:
(29)
Finally, the average flow velocity of the entire river can be obtained from the river flow and area, as follows:
(30)
where S is the total cross-sectional area.

Experimental platform

The processor of the experimental equipment was Intel(R) Core(TM) i7-6700K, and the operating system was Windows 10 (X64), which runs Python 3. 8 and opencv4. 2.

Evaluation indicators

In the river surface flow velocity measurement, the measurement results of the current meter conforming to the national standard GB/T 11826-2019 are regarded as the true value. The picture of the current meter is shown in Figure 5. Therefore, in this experiment, the plumb line average flow velocity, the section total flow, and the average flow velocity measured by the LJ-20 current meter conforming to the national standard are regarded as the true value, and the range of its velocity is 0.04–10.00 m/s. The rotor of the current meter is driven by the water flow at a certain angular velocity, and the angular velocity and the water flow velocity have a relatively stable relationship within the allowable error when the water flow velocity is more than a certain velocity. Through the pulse signal on the current meter to record the number of revolutions of the current meter rotor in the specified time, query the current meter calibration equation to calculate the actual flow rate. The flow velocity calculation formula is shown in the following equation:
(31)
where n is the time required per revolution (1/s), b is the hydraulic pitch (m), and a is the instrument calibration constant (m/s).
Figure 5

Working diagram of the current meter.

Figure 5

Working diagram of the current meter.

Close modal

In order to comprehensively evaluate the accuracy of different methods in measuring the plumb mean flow rate, the total flow rate, and the mean flow rate in this cross-section. Root mean square error (RMSE) and relative error were selected as evaluation metrics (Alakbar & Burgan 2024).

In the measurement of vertical mean flow rate, there are two sets of key data: one is the result of the vertical mean flow rate at each velocity point measured by different methods , which is recorded as dataset A. The other is the result of the vertical mean flow rate at the corresponding velocity point measured by the standard instrument LJ-20 , which is recorded as dataset B. By calculating the RMSE between datasets A and B, the accuracy and reliability of the measurement of vertical mean flow rate by different methods can be quantified. By calculating the RMSE between dataset A and dataset B, it is possible to quantify the degree of deviation of different methods from the standardized values of the mean vertical flow velocity measurements and to evaluate their accuracy. The RMSE is a commonly used metric for assessing the accuracy of predictive models. The calculation of RMSE involves squaring the difference between each pair of measurements and the true value of the current meter, then averaging these squared values, and finally taking the square root. The formula for RMSE is shown in the following equation:
(32)

For measurements of mean flow rate and total cross-section flow, the relative error is used as a key indicator to assess the performance of different methods. The relative error is obtained by calculating the difference between the measured value and the true value (or standard value) and dividing by the true value (or standard value), which visualizes the extent to which the measured value deviates from the true value. By comparing the relative errors between the average flow rate and the total cross-section flow rate measured by different methods and the standard values, we can gain insight into the reliability and accuracy of these methods.

In addition, in order to measure the agreement or correlation between the different measurement methods, the statistical index of the Pearson correlation coefficient (PCC) is equally important. The PCC is a value between −1 and 1 that measures the strength and direction of a linear relationship between two variables. When the PCC is 1, it indicates that there is a perfect positive correlation between the two variables; when the coefficient is −1, it indicates that there is a perfect negative correlation between the two variables; and when the coefficient is 0, it indicates that there is no linear correlation between the two variables. By calculating the PCC between the data measured by different measurement methods and the standard values, the correlation and consistency between these methods can be further verified. The given PCC r can be calculated by the following equation:
(33)

Experimental design and analysis

Rivers of rules

In order to verify the feasibility of the algorithm, the artificial nullah section of Dali Train City Hydrological Station in Yunnan Province was selected for velocity measurement. According to the years of actual measurement experience of this hydrological station, the bank coefficient is 0.80 and the surface flow velocity coefficient is 0.82. The camera model is Hikvision DS-2CD1225-I3/I5 with a focal length of 6 mm. The camera is 20.3 m from point A, 32.4 m from point B, 16.2 m from point C, and 6.3 m from point D The experimental video was shot for 10 s, cut into 325 frames, and captured the image resolution of the video at 1,920 × 1,080 pixels.

The surface calibration points of the nullah are shown in Figure 6. The left bank is arranged with two points, AB, and the right bank is arranged with two points CD. The starting point coincides with point D, the endpoint coincides with point A, and DA is the section line. Among them, the velocity measurement section line is laid according to equal distance, the starting point is 2 m away from the bank, and a velocity measurement point is laid every 1 m until the 11th m. There are 10 velocity measurement points, and the site section data and the results of the current meter measurement are shown in Table 1.
Table 1

Current meter measurement results

Starting point distance b/mVertical average velocity/(m·s−1)Partial average flow velocity /(m·s−1)Partial area/(m2)Partial flow/(m3·s−1)
0 (shore) – – – 
0–2 – 0.29 1.45 0.42 
0.36 – – – 
2–3 – 0.40 0.85 0.34 
0.43 – – – 
3–4 – 0.39 0.92 0.36 
0.35 – – – 
4–5 – 0.40 0.99 0.40 
0.45 – – – 
5–6 – 0.60 0.98 0.59 
0.76 – – – 
6–7 – 0.72 0.95 0.68 
0.68 – – – 
7–8 – 0.64 0.80 0.51 
0.61 – – – 
8–9 – 0.54 0.77 0.42 
0.48 – – – 
9–10 – 0.43 0.86 0.37 
10 0.38 – – – 
10–11 – 0.44 0.71 0.31 
11 0.49 – – – 
11–11.9 – 0.39 0.42 0.16 
11.9 (shore) – – – 
Starting point distance b/mVertical average velocity/(m·s−1)Partial average flow velocity /(m·s−1)Partial area/(m2)Partial flow/(m3·s−1)
0 (shore) – – – 
0–2 – 0.29 1.45 0.42 
0.36 – – – 
2–3 – 0.40 0.85 0.34 
0.43 – – – 
3–4 – 0.39 0.92 0.36 
0.35 – – – 
4–5 – 0.40 0.99 0.40 
0.45 – – – 
5–6 – 0.60 0.98 0.59 
0.76 – – – 
6–7 – 0.72 0.95 0.68 
0.68 – – – 
7–8 – 0.64 0.80 0.51 
0.61 – – – 
8–9 – 0.54 0.77 0.42 
0.48 – – – 
9–10 – 0.43 0.86 0.37 
10 0.38 – – – 
10–11 – 0.44 0.71 0.31 
11 0.49 – – – 
11–11.9 – 0.39 0.42 0.16 
11.9 (shore) – – – 
Figure 6

Schematic diagram of the surface calibration points of the open channel.

Figure 6

Schematic diagram of the surface calibration points of the open channel.

Close modal

In order to verify the superiority of this method over other methods, the LSPIV method (Fujita et al. 1998), STIV method (Fujita et al. 2007), and FD-DIS-G method (Wang et al. 2022) were selected to compare with the new-method proposed in this paper. The implementation steps of several other algorithms are shown as follows:

Specific steps of the LSPIV method: the captured video image is affine transformed to a bird's-eye view. Grayscaling and Contrast Limited Adaptive Histogram Equalization (CLAHE) image enhancement are performed to enhance the texture of the image. Subsequently, flow field intercorrelation calculation is performed using the LSPIV algorithm. Finally, the pixel displacements of the velocimetry points are extracted and transformed into actual displacements and actual surface flow velocities by means of the projection transformation matrix.

Specific steps of the STIV method: the captured video image is subjected to CLAHE image enhancement, the corresponding velocity lines are set at the velocimetry points, and then the spatio-temporal image is generated. Finally, the generated spatio-temporal image is subjected to the gradient tensor method for texture angle calculation. It is converted to actual surface flow velocity by equations.

Specific steps of the FD-DIS-G method: the images of the two frames before and after are processed for frame difference calculation. A threshold is set, and the regions with frame difference value greater than the threshold are processed by the method to get the motion saliency map. Determine the block region calculation centered on the velocimetry point. Perform the grid gray value difference squared and minimize the searched optical flow vectors. Finally, anomalous data are processed. The optical flow vectors are finally converted to actual surface flow velocities.

The flow measurement results of the LSPIV method, STIV method, FD-DIS-G method, and this method are shown in Table 2.

Table 2

Comparison of perpendicular average flow velocity results measured by different methods

Method comparisonCurrent meterLSPIV
STIV
FD-DIS-G
New-method
Measurement value (m/s)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)
Distance (m) d = 2 m 0.36 0.23 36.11 0.38 5.56 0.33 8.33 0.31 13.89 
d = 3 m 0.43 0.01 97.67 0.46 6.98 0.41 4.65 0.31 27.91 
d = 4 m 0.35 0.45 28.57 0.03 91.43 0.45 28.57 0.44 25.71 
d = 5 m 0.45 0.58 28.89 0.45 0.00 0.52 15.56 0.55 10.22 
d = 6 m 0.76 0.38 50.00 0.13 82.89 0.46 39.47 0.53 30.26 
d = 7 m 0.68 0.41 39.71 0.79 16.18 0.51 25.00 0.59 13.23 
d = 8 m 0.61 0.57 6.56 0.72 18.03 0.54 11.48 0.71 16.39 
d = 9 m 0.48 0.62 29.17 0.72 50.00 0.75 56.25 0.71 47.92 
d = 10 m 0.38 0.37 2.63 0.61 60.53 0.68 78.95 0.83 118.42 
d = 11 m 0.49 0.62 26.53 0.40 18.37 0.64 30.61 0.25 48.98 
Average speed(m/s) 0.47 0.39 17.02 0.43 12.77 0.49 4.26 0.49 4.26 
Average flow(m3/s) 4.56 3.77 17.32 4.21 7.68 4.75 4.17 4.71 3.29 
Method comparisonCurrent meterLSPIV
STIV
FD-DIS-G
New-method
Measurement value (m/s)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)
Distance (m) d = 2 m 0.36 0.23 36.11 0.38 5.56 0.33 8.33 0.31 13.89 
d = 3 m 0.43 0.01 97.67 0.46 6.98 0.41 4.65 0.31 27.91 
d = 4 m 0.35 0.45 28.57 0.03 91.43 0.45 28.57 0.44 25.71 
d = 5 m 0.45 0.58 28.89 0.45 0.00 0.52 15.56 0.55 10.22 
d = 6 m 0.76 0.38 50.00 0.13 82.89 0.46 39.47 0.53 30.26 
d = 7 m 0.68 0.41 39.71 0.79 16.18 0.51 25.00 0.59 13.23 
d = 8 m 0.61 0.57 6.56 0.72 18.03 0.54 11.48 0.71 16.39 
d = 9 m 0.48 0.62 29.17 0.72 50.00 0.75 56.25 0.71 47.92 
d = 10 m 0.38 0.37 2.63 0.61 60.53 0.68 78.95 0.83 118.42 
d = 11 m 0.49 0.62 26.53 0.40 18.37 0.64 30.61 0.25 48.98 
Average speed(m/s) 0.47 0.39 17.02 0.43 12.77 0.49 4.26 0.49 4.26 
Average flow(m3/s) 4.56 3.77 17.32 4.21 7.68 4.75 4.17 4.71 3.29 

From Table 3, we know that PCCs between the other methods and the current meter measurements are less than 0.2, while the PCC between the new-method and the current meter measurements is 0.213, which shows a stronger correlation than the other methods, and it is the most relevant to the real flow velocity distribution law compared with the other methods. For the RMSE, although the RMSE of this method is 0.205, it is larger than that of the FD-DIS-G method. But compared to the other two methods, the RMSE is reduced.

Table 3

Comparison of PCC and RMSE of different methods at the Dali station

MethodPearson coefficientRoot mean square error
LSPIV 0.193 0.218 
STIV 0.176 0.254 
FD-DIS-G 0.028 0.180 
New-method 0.213 0.205 
MethodPearson coefficientRoot mean square error
LSPIV 0.193 0.218 
STIV 0.176 0.254 
FD-DIS-G 0.028 0.180 
New-method 0.213 0.205 

From Figure 7, it can be seen that the measured velocities of this method at seven velocimetry points near the starting point are in good agreement with the true value of the current meter. However, in the three points near the endpoint, it can be seen from Table 2 that the relative error between the velocity values of the five methods and the true value of the current meter is larger. Considering that the three velocimetry points near the endpoint are far away from the lens, the influence of affine transformation leads to lower accuracy.
Figure 7

Vertical average flow velocity and open channel depth.

Figure 7

Vertical average flow velocity and open channel depth.

Close modal

As for the mean flow velocity and flow rate calculation in the flow field, it can be seen from Table 2 that the present method is more accurate relative to several other methods. The relative error is only 3.29% relative to the true value of the current measured by the flow meter. The accuracy is improved by 14.03 and 4.39% relative to the LSPIV and STIV methods, respectively. Although the plumb line means velocity measured by this method fluctuates more at the three velocimetry points near the endpoint, it has the advantage of better accuracy in terms of the overall flow field flow and velocity.

From Figure 8(a), it can be visualized that the present method, like several other methods, has positive and negative relative errors for each velocimetry point, and combined with Table 3, it can be known that its dispersion relative to the true flow velocity is within the acceptable range. From Figure 8(b), it can be seen that the time-consuming time of this method is 22.47 s, and the computational speed is greatly improved compared with the widely used LSPIV method and the STIV method, which requires image preprocessing.
Figure 8

Comparison of relative error and running time.

Figure 8

Comparison of relative error and running time.

Close modal

Natural river

In order to verify the universality of the method in this paper, a natural river at Meng provincial station in Yunnan province was selected for speed measurement comparison. According to the years of experience of this hydrological station, the bank coefficient is 0.70, and the surface velocity coefficient is 0.90. The camera model is Hikvision DS-2CD1225-I3/I5 with a focal length of 6 mm. The camera is 39.4 m from point A, 35.8 m from point B, 80.3 m from point C, and 85.6 m from point D. The experimental video was shot for 20 seconds, cut into 500 frames, and captured the image resolution of the video at 1,920 × 1,080 pixels.

The calibration points on both sides of the river are shown in Figure 9. Among them, the velocity measurement section line was laid according to equal distance, the starting point was 24 m away from the bank, and a velocity measurement point was laid every 4 m until the 60th m. There were 10 velocity measurement points, and the data of the station section and the results of the current meter measurement are shown in Table 4.
Table 4

Current meter measurement results

Starting point distance (b/m)Vertical average velocity/(m·s−1)Partial average flow velocity/(m·s−1)Partial area/(m2)Partial flow/(m3 ·s−1)
18.1 (shore) – – – 
21–24 – 0.32 7.13 2.28 
24 0.45 – – – 
24–28 – 0.70 7.72 5.40 
28 0.96 – – – 
28–32 – 1.12 7.84 8.78 
32 1.28 – – – 
32–36 – 1.34 8.04 10.80 
36 1.40 – – – 
36–40 – 1.39 7.60 10.60 
40 1.38 – – – 
40–44 – 1.38 7.36 10.20 
44 1.38 – – – 
44–48 – 1.36 7.24 9.85 
48 1.35 – – – 
48–52 – 1.38 7.36 10.20 
52 1.40 – – – 
52–56 – 1.30 7.76 10.10 
56 1.21 – – – 
56–60 – 0.92 7.68 7.07 
60 0.63 – – – 
60–63 – 0.44 6.63 2.92 
64.5 (shore) – – – 
Starting point distance (b/m)Vertical average velocity/(m·s−1)Partial average flow velocity/(m·s−1)Partial area/(m2)Partial flow/(m3 ·s−1)
18.1 (shore) – – – 
21–24 – 0.32 7.13 2.28 
24 0.45 – – – 
24–28 – 0.70 7.72 5.40 
28 0.96 – – – 
28–32 – 1.12 7.84 8.78 
32 1.28 – – – 
32–36 – 1.34 8.04 10.80 
36 1.40 – – – 
36–40 – 1.39 7.60 10.60 
40 1.38 – – – 
40–44 – 1.38 7.36 10.20 
44 1.38 – – – 
44–48 – 1.36 7.24 9.85 
48 1.35 – – – 
48–52 – 1.38 7.36 10.20 
52 1.40 – – – 
52–56 – 1.30 7.76 10.10 
56 1.21 – – – 
56–60 – 0.92 7.68 7.07 
60 0.63 – – – 
60–63 – 0.44 6.63 2.92 
64.5 (shore) – – – 
Figure 9

Schematic diagram of ground calibration and speed measurement line layout at the Mengxing Station.

Figure 9

Schematic diagram of ground calibration and speed measurement line layout at the Mengxing Station.

Close modal

When comparing the algorithms for the natural river, the measurements revealed that the flow accuracy measured by the LSPIV algorithm and the FD-DIS-G algorithm was not high in this river, so the MobileNet-STIV algorithm was re-selected for comparison. The MobileNet-STIV algorithm flow is shown below (Hu et al. 2023):

Specific steps of the MobileNet-STIV method: a hybrid dataset is generated from the synthetic image dataset and the video-synthesized image dataset. The dataset is generated using the Multi-Scale Retinex method for image enhancement.

Then the Gaussian high-pass filtering process is performed to improve the quality of the samples and train the network. Corresponding speed lines are set at the speed points, and subsequently, spatio-temporal images are generated. The generated spatio-temporal images are utilized for angle prediction using the trained prediction network. Finally, it is converted into actual surface flow velocity.

The comparison of the measurement results of this method and the measurement results of other methods is shown in Table 5.

Table 5

Comparison of perpendicular average flow velocity results measured by different methods

Method comparisonCurrent meterSTIV
MobileNet-STIV
New-method
Measurement value (m/s)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)
Distance (m) d = 24 m 0.45 0.21 54.41 0.42 6.02 0.85 88.89 
d = 28 m 0.96 1.20 24.72 0.79 17.60 1.22 27.08 
d = 32 m 1.28 0.88 31.28 0.93 27.60 1.31 2.34 
d = 36 m 1.40 0.85 39.62 1.04 25.70 1.22 12.86 
d = 40 m 1.38 0.78 43.50 1.10 19.99 1.32 4.35 
d = 44 m 1.38 1.46 6.03 1.09 20.76 1.41 2.17 
d = 48 m 1.35 2.04 51.28 1.20 11.06 1.19 11.85 
d = 52 m 1.40 1.05 26.97 1.53 9.28 1.31 6.43 
d = 56 m 1.21 1.23 1.55 1.07 11.16 0.89 26.45 
d= 60 m 0.63 0.42 33.98 0.95 50.79 0.93 47.62 
Average speed (m/s) 1.07 0.94 12.60 0.95 11.13 1.10 2.80 
Average flow (m3/s) 88.20 77.02 12.67 78.32 11.21 90.66 2.79 
Method comparisonCurrent meterSTIV
MobileNet-STIV
New-method
Measurement value (m/s)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)Measurement value (m/s)Relative error (%)
Distance (m) d = 24 m 0.45 0.21 54.41 0.42 6.02 0.85 88.89 
d = 28 m 0.96 1.20 24.72 0.79 17.60 1.22 27.08 
d = 32 m 1.28 0.88 31.28 0.93 27.60 1.31 2.34 
d = 36 m 1.40 0.85 39.62 1.04 25.70 1.22 12.86 
d = 40 m 1.38 0.78 43.50 1.10 19.99 1.32 4.35 
d = 44 m 1.38 1.46 6.03 1.09 20.76 1.41 2.17 
d = 48 m 1.35 2.04 51.28 1.20 11.06 1.19 11.85 
d = 52 m 1.40 1.05 26.97 1.53 9.28 1.31 6.43 
d = 56 m 1.21 1.23 1.55 1.07 11.16 0.89 26.45 
d= 60 m 0.63 0.42 33.98 0.95 50.79 0.93 47.62 
Average speed (m/s) 1.07 0.94 12.60 0.95 11.13 1.10 2.80 
Average flow (m3/s) 88.20 77.02 12.67 78.32 11.21 90.66 2.79 

Analyzing the three methods in Table 5, it can be seen that the method proposed in this paper has the smallest relative error of 2.80% among the three methods for the measured mean flow velocity. The relative error is 2.80%, which is 9.80 and 8.33% higher than that of the STIV and MobileNet-STIV methods, respectively. The flow rate value measured by the proposed method is the closest to that measured by the current meter among the three methods, with a relative error of only 2.79%, compared with the STIV and MobileNet-STIV methods. The accuracy was improved by 9.88 and 8.42%, respectively.

From Table 6, it can be learned that the flow velocity calculated by this method has a high correlation with the flow velocity measured by the current meter. The Pearson's coefficient is 0.767, while the correlation of the results calculated by the STIV method is only 0.648. Although the correlation of the results calculated by MobileNet-STIV is slightly higher than that of the present method in the RMSE analysis. The present method exhibits less errorability and has good stability.

Table 6

Comparison of PCC and RMSE of different methods at the Mengxing Station

MethodPearson coefficientRMSE
STIV 0.648 0.398 
MobileNet-STIV 0.778 0.246 
New-method 0.767 0.222 
MethodPearson coefficientRMSE
STIV 0.648 0.398 
MobileNet-STIV 0.778 0.246 
New-method 0.767 0.222 

From the measured value curve in Figure 10, it can be visualized that the method of this paper is in good agreement with the real values measured by the current meter. From Figure 11(a), it can be seen that the relative errors of the middle eight points of this method are all within 30%, and the other two points have larger errors, probably due to the influence of lens distortion. But overall, the total error of this method is the smallest among several methods. From Figure 11(b), it can be seen that the computational speed is greatly improved compared to the STIV method and MobileNet-STIV method, which require image preprocessing.
Figure 10

Vertical average flow velocity and open channel depth.

Figure 10

Vertical average flow velocity and open channel depth.

Close modal
Figure 11

Comparison of relative error and running time.

Figure 11

Comparison of relative error and running time.

Close modal

In this paper, we propose a river velocimetry method based on the scalar transport equation and assume that the 3 × 3 region around the velocimetry point has exactly the same motion trend between two frames to solve the aperture problem in the optical flow problem. Unlike the LSPIV and STIV methods, the above two methods aim to characterize the Lagrangian trajectories of objects in a river. In contrast, this paper is concerned with the distribution of the flow field velocity in a particular region at different times. It is more in line with the law that the velocity of the flow field is constantly changing with time.

After obtaining the surface flow velocity, the total flow rate was obtained by the surface flow velocity coefficient, the shore coefficient, and the section information, and the average flow rate was obtained by dividing the total flow rate by the total section area. Finally, the error of the total flow rate and the total average flow rate are compared. Through the first set of experiments, it was found that the measured values of the mean river flow velocity and river flow were closest to those of the current meter, with relative errors of 4.26 and 3.29%, respectively. Compared with the LSPIV method, which is widely used in hydrological stations, the accuracy of this method is improved by 12.76 and 14.03%. Through the second set of experimental results, it was found that the relative errors of the measured mean river flow and river flow values were 2.80 and 2.79%, respectively, and the measurement accuracies were higher than those of the STIV and MobileNet-STIV algorithms. During the process of projection transformation. The selection of the calibration points, the position of the camera can lead to different results in the calculation of the projection transformation matrix, which will have an impact on the experimental results. However, there can be multiple sources of data errors. For methods, such as LSPIV and FD-DIS-G, there are also reasons for the error such as unclear surface texture of the water flow. For methods such as STIV, the selection of the velocimetry line can also directly lead to different errors. The superimposed effect between the errors leads to the final data results.

Since the measurement method proposed in this paper only calculates the flow velocity for a specific region, the operation speed and accuracy are greatly improved. The accuracy and efficiency of the measurement are improved while reducing the cost, which can meet the monitoring needs of the river at hydrological stations.

However, the method has some limitations. Since the algorithm itself relies on clear and unobstructed images. The cases where the light intensity is not high at night and rainy and cloudy days make the image blurry are not resolved. The next step in the work will be to consider how to solve the problem of effectively restoring the flow field information in the image and solving for the velocity field in harsh environments. We will also consider how to put the algorithm into practical applications. To establish an efficient river flow monitoring system and make some contributions to the field of hydrology.

The authors would like to express sincere gratitude to the Yunnan Provincial Bureau of Hydrological and Water Resources for providing the necessary data to complete this research work.

This research was supported by the National Natural Science Foundation of China (No. 62363017) and the ‘Yunnan Xingdian Talents Support Plan’ Project (No. KKXY202203006).

All relevant data are included in the paper or its Supplementary Information.

The authors declare there is no conflict.

Adrian
R. J.
(
1991
)
Particle-imaging techniques for experimental fluid mechanics
,
Annual Review of Fluid Mechanics
,
23
(
1
),
261
304
.
Alakbar
T.
&
Burgan
H. I.
(
2024
)
Regional power duration curve model for ungauged intermittent river basins
,
Journal of Water and Climate Change
,
15
(
9
),
4596
4612
.
Batchelor
G. K.
(
1967
)
An Introduction to Fluid Dynamics
.
Cambridge University Press
.
New York, USA
.
Béréziat
D.
,
Herlin
I.
&
Younes
L.
(
2000
). '
A generalized optical flow constraint and its physical interpretation
',
Proceedings IEEE Conference on Computer Vision and Pattern Recognition
, Vol.
2
.
CVPR 2000 (Cat. No. PR00662)
.
IEEE
, pp.
487
492
.
Beyou
S.
,
Cuzol
A.
,
Subrahmanyam Gorthi
S.
&
Mémin
E.
(
2013
)
Weighted ensemble transform Kalman filter for image assimilation
,
Tellus A: Dynamic Meteorology and Oceanography
,
65
(
1
),
18803
.
Cai
S.
,
Mémin
E.
,
Dérian
P.
&
Xu
C.
(
2018
)
Motion estimation under location uncertainty for turbulent fluid flows
,
Experiments in Fluids
,
59
(
1
),
8
.
Cassisa
C.
,
Simoens
S.
,
Prinet
V.
&
Shao
L.
(
2011
)
Subgrid scale formulation of optical flow for the study of turbulent flow
,
Experiments in Fluids
,
51
,
1739
1754
.
Corpetti
T.
,
Mémin
E.
&
Pérez
P.
(
2000
) '
Estimating fluid optical flow
',
Proceedings 15th International Conference on Pattern Recognition
, Vol.
3
.
ICPR-2000
.
IEEE
, pp.
1033
1036
.
Corpetti
T.
,
Mémin
É.
&
Pérez
P.
(
2002
)
Dense estimation of fluid flows
,
IEEE Transactions on Pattern Analysis and Machine Intelligence
,
24
(
3
),
365
380
.
Corpetti
T.
,
Mémin
E.
,
Santa-Cruz
A.
&
Arroyo
G.
(
2003
) '
Optical flow estimation in experimental fluid mechanics
’,
Seventh International Symposium on Signal Processing and Its Applications
, Vol.
1
.
2003
.
Proceedings. IEEE
, pp.
633
636
.
Corpetti
T.
,
Heitz
D.
,
Arroyo
G.
,
Mémin
E.
&
Santa-Cruz
A.
(
2006
)
Fluid experimental flow estimation based on an optical-flow scheme
,
Experiments in Fluids
,
40
(
1
),
80
97
.
Dérian
P.
,
Héas
P.
,
Herzet
C.
&
Mémin
E.
(
2013
)
Wavelets and optical flow motion estimation
,
Numerical Mathematics: Theory, Methods and Applications
,
6
(
1
),
116
137
.
Fujita
I.
,
Muste
M.
&
Kruger
A.
(
1998
)
Large-scale particle image velocimetry for flow analysis in hydraulic engineering applications
,
Journal of Hydraulic Research
,
36
(
3
),
397
414
.
Fujita
I.
,
Watanabe
H.
&
Tsubaki
R.
(
2007
)
Development of a non-intrusive and efficient flow monitoring technique: the space-time image velocimetry (STIV)
,
International Journal of River Basin Management
,
5
(
2
),
105
114
.
Gonzalez
R. C.
(
2009
)
Digital Image Processing
.
Pearson Education
:
Knowledge Boulevard, Delhi, India
.
Horn
B. K. P.
&
Schunck
B. G.
(
1981
)
Determining optical flow
,
Artificial Intelligence
,
185
203
.
Hu
Q.
,
Wang
J.
,
Zhang
G.
&
Jin
J.
(
2023
)
Space-time image velocimetry based on improved MobileNetv2
,
Electronics
,
12
(
2
),
399
.
Jiang
S.
,
Bevacqua
E.
&
Zscheischler
J.
(
2022
)
River flooding mechanisms and their changes in Europe revealed by explainable machine learning
,
Hydrology and Earth System Sciences
,
26
(
24
),
6339
6359
.
Liu
T.
&
Shen
L.
(
2008
)
Fluid flow and optical flow
,
Journal of Fluid Mechanics
,
614
,
253
291
.
Mémin
E.
(
2014
)
Fluid flow dynamics under location uncertainty
,
Geophysical & Astrophysical Fluid Dynamics
,
108
(
2
),
119
146
.
Papadakis
N.
&
Mémin
É
. (
2008
)
Variational assimilation of fluid motion from image sequence
,
SIAM Journal on Imaging Sciences
,
1
(
4
),
343
363
.
River Flow Test Specification
(
2015
)
GB50179-2015
.
Beijing, China
:
China Planning Press
.
Wang
J.
,
Zhu
R.
,
Zhang
G.
,
He
X.
&
Cai
R.
(
2022
)
The image method flow measurement study of frame difference and fast dense optical flow
,
Engineering Science and Technology
,
54
(
4
),
195
207
.
Zach
C.
,
Pock
T.
&
Bischof
H.
(
2007
). '
A duality based approach for realtime tv-l 1 optical flow
',
Pattern Recognition: 29th DAGM Symposium
.
Heidelberg, Germany
,
September 12–14, 2007
.
Proceedings 29
.
Berlin Heidelberg
:
Springer
, pp.
214
223
.
Zille
P.
,
Corpetti
T.
,
Shao
L.
&
Chen
X.
(
2014
)
Observation model based on scale interactions for optical flow estimation
,
IEEE Transactions on Image Processing
,
23
(
8
),
3281
3293
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).