Non-contact flow measurement method based on frame difference and space-time image velocity measurement and computer device
Through the non-contact flow measurement method based on frame difference and space-time image speed measurement, combined with the local Fourier maximum angle and gradient tensor method, the problem of unclear texture detection of river surface flow velocity is solved, and the stability and accuracy of river flow measurement are improved sex.
Patent Information
- Application Number
- CN202411175700.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The existing spatiotemporal image speed measurement method is not clear when the flow velocity on the river channel surface is small and the traceability is not obvious, which affects the stability and accuracy of river flow measurement.
Using a non-contact flow measurement method based on frame difference and spatiotemporal image speed measurement, a spatiotemporal image is generated by calculating the significance map of the water flow motion, and the texture angle is calculated using the local Fourier maximum angle estimation method and gradient tensor method, combined with the corrected alpha mean filter and passivation masking enhancement technology to improve the clarity and robustness of image textures.
It significantly improves the stability and accuracy of river flow measurement, reduces the problem of unclear texture caused by insufficient traceability, and improves the robustness of texture angle calculation and the clarity of image texture.
Smart Images

Figure CN119048546A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of river flow measurement, and in particular to a non-contact flow measurement method and a computer device based on frame difference and spatiotemporal image velocity measurement. Background Art
[0002] STIV (Space-time Image Velocimetry) mainly synthesizes space-time images through water surface videos taken by a camera on one side of the river bank, and estimates the texture angle through different methods, thereby estimating the surface flow velocity of the river. The algorithm efficiency is more than 10 times that of cross-correlation, so it has been widely used in river flow velocity measurement in recent years.
[0003] Since the accuracy of the STIV method mainly depends on the clarity of the spatiotemporal image texture and the accuracy of angle detection, for rivers with relatively regular river sections and small flow rates in the non-flood season, the water surface is calm and the traces of ripples and foam are not obvious, resulting in the spatiotemporal image texture being less obvious than that of rivers with larger flow rates in the flood season, which greatly affects the detection of the main direction of the texture, thereby affecting the stability and accuracy of river flow measurement. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a non-contact flow measurement method and computer device based on frame difference and spatiotemporal image velocity measurement, which greatly improves the stability and accuracy of river flow measurement.
[0005] The present invention adopts the following technical solutions to achieve the above-mentioned purpose. In a first aspect, the present invention provides a non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement, comprising:
[0006] S1, using the original river surface images of consecutive frames in the video sequence to generate a water flow motion saliency map, and superimposing it with the original river surface image to obtain a water flow image;
[0007] S2, generating a spatiotemporal image based on the water flow image;
[0008] S3, calculating the local texture angle by the local Fourier maximum angle estimation method, and calculating the local correlation coefficient C by the gradient tensor method;
[0009] Calculate the local texture angle by using the local Fourier maximum angle estimation method:
[0010] The space-time image is transformed into a spectral image through two-dimensional Fourier transform, and the main direction θ of the Fourier spectrum is obtained m , the main direction θ m The main texture direction δ of the spatiotemporal image satisfies the following orthogonal relationship: δ = θ m +90°;
[0011] The two-dimensional Fourier transform is expressed as follows:
[0012]
[0013] Where h(x, t) is the spatiotemporal image; F(u, v) is the Fourier transform of the image; M and N are the height and width of the image;
[0014] The amplitudes on the horizontal and vertical lines in the center of the spectrum are set to 0, the filter is set to an ellipse and used as the integration area, the major axis and minor axis are N / 8 and 2 pixels respectively, and the main direction of the spectrum θ is obtained by integration in the range of 0°-180°. m , and then calculate the main direction of the texture δ through the orthogonal relationship;
[0015] The local correlation coefficient C is calculated by the gradient tensor method:
[0016] The calculation formula of the local correlation coefficient C is as follows:
[0017]
[0018] and They represent the gradient of the image along the x direction and the t direction respectively, and A represents the integration area;
[0019] Δx is a unit pixel of the grayscale image;
[0020] S4, calculating the average texture angle according to the local texture angle and the local correlation coefficient C;
[0021] The spatiotemporal image is divided into multiple rectangular regions, and the local texture angle and the local correlation coefficient C of each rectangular region are calculated by the method of step S3, then:
[0022] θ i Represents the local texture angle of each rectangular area, represents the average texture angle;
[0023] S5. Calculate the flow velocity and flow rate of the river surface based on the average texture angle.
[0024] Furthermore, after S2 generates the space-time image, it also includes preprocessing the generated space-time image, specifically including:
[0025] The generated spatiotemporal image is denoised using a modified alpha mean filter. The modified alpha mean filter removes d minimum values and d maximum values in the pixel neighborhood of the spatiotemporal image f(x,t) and calculates the remaining pixels g R The arithmetic mean of (r,c) is expressed as follows:
[0026] Where: m, n represents the size of the filter, S R Represents a rectangular neighborhood, and the value range of d is (0,mn / 2-1);
[0027] Use unsharp masking to enhance the denoised spatiotemporal image as follows:
[0028] f mask (x,t)=f(x,t)-f smooth (x,t),f smooth represents the smoothed image of the spatiotemporal image, f mask represents the unsharp mask image;
[0029] h(x,t)=f(x,t)+kf mask (x, t), k represents a preset weight, k>1; h(x, t) represents the spatiotemporal image after passivation masking enhancement.
[0030] Furthermore, S1 specifically includes:
[0031] The images of the nth frame and the n-1th frame in the video sequence are F n and F n-1 , the gray value of the corresponding pixel is recorded as f n x,y and f n-1 x,y , the motion saliency map at time n is D n , d n x,y D n The elements of are:
[0032]
[0033] Wherein: h is a preset threshold; k1 and k2 are preset coefficients, which are set to values greater than 1 and less than 1 respectively;
[0034] Generate motion saliency map D n After that, it is superimposed with the original image of the river surface to obtain the water flow image R n , r n x,y For R n The elements of are:
[0035]
[0036] Furthermore, S2 specifically includes:
[0037] A sequence of N frames of water flow images is acquired at a set time interval Δt, and then a speed measuring line is set parallel to the direction of water flow movement. The width of the speed measuring line is 1 pixel and the length is L pixels. The grayscale of each speed measuring line is extracted frame by frame and arranged in order from top to bottom to synthesize a spatiotemporal image of size L×N pixels.
[0038] Furthermore, S5 specifically includes:
[0039] If the distance of the river surface flow feature moving along the velocity measurement line is D and the time is T, corresponding to the movement of i pixels in the k-frame pixel movement, the average flow velocity of the velocity measurement line is:
[0040]
[0041] Where: represents the average texture angle, S X Indicates the actual distance represented by each pixel, and fps indicates the frame rate of the camera;
[0042] The vertical average velocity v is expressed by the following formula: v = η·v 表面 , η represents the surface velocity coefficient;
[0043] Finally, the flow rate is calculated according to the velocity area method, and the calculation method is as follows:
[0044] v i represents the average flow velocity of the vertical line in the interval, A i Represents the area of the interval.
[0045] In a second aspect, the present invention provides a computer device, including a memory, wherein the memory stores program instructions, and when the program instructions are executed, the above-mentioned non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement is executed.
[0046] The beneficial effects of the present invention are:
[0047] The present invention uses continuous frame original images to calculate the water flow movement saliency map and superimposes it with the original image to obtain an image with clear traces, thereby reducing the impact caused by unclear or missing spatiotemporal image texture due to insufficient traces on the river surface.
[0048] The present invention applies the local Fourier maximum angle estimation method to perform angle analysis on the spatiotemporal image, introduces a correlation parameter, and finally calculates the average direction angle according to the direction angle obtained locally in the entire spatiotemporal image and the correlation parameter, thereby improving the robustness of texture angle measurement.
[0049] The present invention preprocesses the generated spatiotemporal image, removes noise by modifying the alpha mean filter, and enhances the image by passivation masking, thereby improving the clarity of the image texture. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flow chart of a non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement provided by an embodiment of the present invention;
[0051] Figure 2 1 is a diagram of the spatiotemporal image preprocessing result provided by an embodiment of the present invention, (a) represents the original spatiotemporal image, (b) represents the spatiotemporal image after frame difference superposition, (c) represents the image after applying the modified alpha mean filter, and (d) represents the image after passivation masking enhancement;
[0052] Figure 3 Schematic diagram of texture angle direction determination provided by an embodiment of the present invention, (a) represents a preprocessed spatiotemporal image, (b) represents an amplitude spectrum image of (a), (c) represents an elliptical search area of (b), and (d) represents an energy-angle distribution diagram;
[0053] Figure 4 is a schematic diagram of a texture angle solving process provided by an embodiment of the present invention;
[0054] Figure 5 is an example diagram of standard images with different texture angles provided by an embodiment of the present invention;
[0055] Figure 6 1 and 2. The flow velocity and flow rate comparison diagrams provided in the embodiments of the present invention, wherein (a) represents a vertical average flow velocity comparison diagram, (b) represents an average flow velocity comparison diagram, and (c) represents a flow rate comparison diagram. DETAILED DESCRIPTION
[0056] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0057] The present invention provides a non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement, such as Figure 1 As shown, specifically including:
[0058] Calculate the motion saliency map and superimpose the motion saliency map with the original image:
[0059] In natural rivers, when there are no tracer particles and the time interval is short, it is difficult to detect subtle surface movement. In this case, due to insufficient tracers on the river surface, the spatiotemporal image texture is unclear or missing, and the measurement results cannot well reflect the speed of the river surface.
[0060] Therefore, the present invention uses continuous frame images to calculate the water flow motion saliency map and superimposes it with the original image to obtain an image with a clear trace, and then uses the STIV method to estimate the water surface flow velocity. The images of the nth frame and the n-1th frame in the video sequence are F n and F n-1 , the gray value of the corresponding pixel is recorded as f n x,y and f n-1 x,y , the motion saliency map at time n is D n , d n x,y D n The elements of are:
[0061]
[0062] Where: h is a preset threshold; k1 and k2 are preset coefficients, which are set to values greater than 1 and less than 1, respectively, to highlight the motion area;
[0063] Generate motion saliency map D n After that, it is superimposed with the original image of the river surface to obtain the water flow image R with clear traces. n , r n x,y For R n The elements of are:
[0064]
[0065] Generate a space-time image:
[0066] First, a sequence of N frames of water flow images is acquired at a certain time interval Δt. Then, a series of speed measurement line segments with a width of 1 pixel and a length of L pixels are set parallel to the direction of water flow. The grayscale of each speed measurement line is extracted frame by frame and arranged in order from top to bottom to synthesize a spatiotemporal image with a size of L×N pixels.
[0067] Preprocess the generated spatiotemporal images:
[0068] Although the spatiotemporal image generated by frame difference processing can produce more effective textures than the initial image, it will also produce salt and pepper noise, etc., so the image needs to be denoised and enhanced.
[0069] Modified alpha mean filter denoising:
[0070] The generated spatiotemporal image is denoised using a modified alpha mean filter. The modified alpha mean filter removes d minimum values and d maximum values in the pixel neighborhood of the spatiotemporal image f(x,t) and calculates the remaining pixels g R The arithmetic mean of (r,c) is expressed as follows:
[0071] Where: m, n represents the size of the filter, S R Represents a rectangular neighborhood, and the value range of d is (0,mn / 2-1);
[0072] Use unsharp masking to enhance spatiotemporal images as follows:
[0073] f mask (x,t)=f(x,t)-f smooth (x,t),f smooth represents the smoothed image of the spatiotemporal image, f mask represents the unsharp mask image;
[0074] h(x,t)=f(x,t)+kf mask (x, t), k represents a preset weight, k>1; h(x, t) represents the spatiotemporal image after passivation masking enhancement.
[0075] The results after preprocessing are as follows Figure 2 shown.
[0076] The preprocessed spatiotemporal image inevitably still has some noise or local texture loss, which interferes with the detection of the main texture direction. The present invention applies the local Fourier maximum angle estimation method to the spatiotemporal image for angle analysis, introduces the correlation parameter C, and finally calculates the average direction angle based on the direction angle obtained locally in the entire spatiotemporal image and the correlation parameter C, so as to improve the robustness of texture angle measurement.
[0077] The local angle is calculated by applying the local Fourier maximum angle estimation method:
[0078] The preprocessed spatiotemporal image, such as Figure 3 As shown in (a), a spectral image is generated through a two-dimensional Fourier transform, as shown in Figure 3 (b) and the main direction θ of the Fourier spectrum is obtained m , the main direction θ m The main texture direction δ of the spatiotemporal image satisfies the following orthogonal relationship: δ = θ m +90°;
[0079] The two-dimensional Fourier transform is expressed as follows:
[0080]
[0081] Where h(x, t) is the spatiotemporal image; F(u, v) is the Fourier transform of the image; M and N are the height and width of the image;
[0082] The amplitudes on the horizontal and vertical lines in the center of the spectrum are set to 0, and the filter is set to an ellipse as the integration area, with the major and minor axes being N / 8 and 2 pixels respectively, as shown in Figure 3 As shown in (c), by integrating in the range of 0°-180°, the main direction of the spectrum θ can be obtained. m ,like Figure 3 As shown in (d), the main texture direction δ is calculated through the orthogonal relationship.
[0083] Apply the gradient tensor method to calculate the local correlation coefficient C:
[0084] In order to evaluate the clarity of spatiotemporal image texture and improve the accuracy of texture angle detection, a correlation parameter C is introduced, and the calculation formula is as follows:
[0085]
[0086] and They represent the gradient of the image along the x direction and the t direction respectively, and A represents the integration area;
[0087] Δx is a unit pixel of the grayscale image.
[0088] Calculate spatiotemporal image texture angle:
[0089] The spatiotemporal image is divided into several rectangular areas. The angle and weight C (i.e., correlation coefficient C) of each part are calculated by the above method. The weight of the part with clear texture is larger, and the weight of the part with unclear texture is smaller. The process is as follows: Figure 4 The calculation formula is as follows:
[0090] θ i Represents the local texture angle of each rectangular area, Represents the average texture angle.
[0091] After determining the texture angle, the actual length of the speed measurement line can be obtained by using the relationship between the phase plane coordinates (x, y) and the actual space rectangular coordinates (X, Y, Z). The formula is as follows:
[0092]
[0093] Where: (X P ,Y P ,Z P ) represents the actual spatial rectangular coordinates of the camera, f represents the focal length, (Δx, Δy) represents the lens distortion correction number, r ij (i, j = 1-3) is the conversion coefficient of the two coordinates.
[0094] Calculate surface velocity and flow rate:
[0095] Assuming that the distance that the river surface flow feature moves along the velocity measurement line is D and the time is T, corresponding to the movement of i pixels in the k-frame pixel movement, the average flow velocity of the velocity measurement line is:
[0096]
[0097] Where: Indicates the texture angle size, S X It indicates the actual distance represented by each pixel (unit: m / pixel), and fps indicates the frame rate of the camera (unit: frames / s).
[0098] The vertical average flow velocity v can be expressed as follows:
[0099] v=η·v 表面 , where: η represents the surface velocity coefficient, for natural rivers (riverbed is sandy, pebbles or boulders), η = 0.8; for artificial concrete channels, η = 0.9.
[0100] Finally, the flow rate is obtained according to the velocity area method, as shown in the following formula:
[0101] Where: v i represents the average flow velocity of the vertical line in the interval, A i Represents the area of the interval.
[0102] The present invention is further described below in conjunction with specific embodiments.
[0103] The Nanchuan River originates from the Laji Mountains and is about 49.2 km long. The Nanchuan River Hydrological Station is located in Xining City, Qinghai Province, and is affiliated to the Qinghai Hydrological Resources Measurement and Reporting Center. According to the hydrological station's many years of measurement and calibration, the slope coefficient of the left bank is 0.8 and the slope coefficient of the right bank is 0.7. The velocity coefficient of the natural river channel is 0.8. The ground calibration layout of the flow measurement experiment is as follows: Figure 6 As shown in , the actual spatial rectangular coordinates of the ground calibration points are measured using a total station.
[0104] The camera for this experiment was set up at an elevation of 2272m on the second terrace on the left bank of the Nanchuan River. The video of the river was shot at a frame rate of 30 frames per second and a duration of 10s. During the acquisition process, the camera was fixed, there was no obvious shaking, the water flow was stable, and 6 velocity measurement lines were laid parallel to the river bank with a length of 300 pixels. At the same time, the velocity meter method was used for measurement, and the measurement vertical lines were set at 14.5m, 15.5m, 16m, 17m, 17.5m, and 18m from the starting point.
[0105] Comparison of angle detection results:
[0106] Before detecting the main direction of the texture, in order to verify the effectiveness of different detection methods, the pictures with specified texture directions generated by the two-dimensional sine function are detected, and texture images are randomly extracted such as Figure 5 As shown, the gradient tensor method, traditional FFT method and improved FFT method are used to calculate the standard texture image, and the results are shown in Table 1. The calculation results of the measured space-time image are shown in Table 2.
[0107] Table 1 Comparison of main direction detection results of standard texture images
[0108]
[0109] Table 2 Comparison of main direction detection results of measured spatiotemporal image texture
[0110]
[0111] As shown in Table 1, when calculating the angle of the standard texture image, the average relative errors of the gradient tensor method, the traditional FFT (Fast Fourier Transform) method and the improved FFT method are 1.44%, 3.64% and 2.61% respectively, indicating that the three methods are reliable in detecting the standard texture image, among which the gradient tensor method has the highest accuracy and the calculation result is closer to the standard value. The improved FFT method has an accuracy improvement of 1.03% compared with the traditional FFT method. Figure 4 A large error was generated during the detection, indicating that the traditional FFT method has low sensitivity when detecting smaller texture angles. The relative errors of the other calculation results are all around 5%, and the detection accuracy is good.
[0112] Table 2 shows that for the measured spatiotemporal images, whose texture is not clearer than the standard texture images, the gradient tensor method produces a larger error than the other two methods, with the maximum error reaching 70.72%, indicating that the gradient tensor method has poor noise resistance and stability when detecting the measured spatiotemporal images with noise and relatively unclear textures. The average relative errors of the main texture directions calculated by the gradient tensor method, the traditional FFT method, and the improved FFT method are 20.25%, 4.38%, and 0.94%, respectively, indicating that the angle calculated by the improved FFT method is the most accurate of the three methods, and the calculated angle result is closer to the manual visual value.
[0113] Comparison of average flow velocity and flow calculation results:
[0114] The comparison experiment selected the STIV algorithm, the traditional FFT-STIV algorithm, and the new method based on the combination of frame difference method and local Fourier maximum angle analysis to calculate the vertical average flow velocity results, as shown in Table 3, Figure 6(a). The vertical average velocity in Table 3 is calculated by the vertical average velocity formula of the embodiment of the present invention, and η is taken as 0.8; the vertical average velocity measured by the velocity meter method is the velocity at the relative water depth of 0.6. The average velocity and flow rate are calculated according to the river flow test specification. The flow rate and average velocity results calculated by the velocity meter method are shown in Table 4. The comparison of the average velocity and flow rate results of different algorithms is shown in Table 5, Figure 6 As shown in (b) and (c).
[0115] Table 3 Comparison of vertical average velocity results
[0116]
[0117] Table 4 Flow measurement results of propeller flowmeter
[0118]
[0119]
[0120] Table 5 Comparison of measurement results of different methods
[0121]
[0122] Analyze the vertical average velocity error, as shown in Table 3 and Figure 6 (a) It can be obtained that the average relative error of the vertical average velocity calculated by the new method is 9.83%. Compared with the STIV and traditional FFT-STIV methods, the accuracy is improved by 25.49% and 15.28%, respectively, indicating that the vertical average velocity calculated by the new method is closer to the true value measured by the velocity meter. At the same time, due to the influence of shore weeds, tree shadows and the distance from the camera on pixels, the relative errors of velocity measurement lines 1 and 5 are relatively high, and the measurement accuracy of the vertical average velocity of the remaining measurement points is relatively high.
[0123] Analyze the average flow rate and flow error, as shown in Table 4, Table 5 and Figure 6(b) and (c) show that compared with the results of the velocity meter measurement, the relative errors of the average velocity and flow calculated by the new method are 1.35% and 0.94% respectively, which meet the monitoring requirements of the hydrological station. Its accuracy is 31.08% and 31.04% higher than that of the STIV method, and 22.7% and 23.92% higher than that of the traditional FFT-STIV method without motion saliency map and local Fourier texture main direction calculation, respectively. This shows that in the case of low velocity, small flow, unclear spatiotemporal image texture caused by unclear tracer, the small motion captured by calculating motion saliency and the calculation of local Fourier texture main direction are crucial to the improvement of the accuracy of the new algorithm. It has good applicability and stability, and can provide support for the scientific management of water resources in the basin. The experimental results show that the relative error of the river section flow and average velocity calculated by the algorithm proposed in the present invention is less than 2% compared with the velocity meter results, which significantly improves the accuracy and stability of the algorithm and can meet the measurement requirements of actual projects.
[0124] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. Non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement, It is characterized in that include: S1, using the original river surface images of consecutive frames in the video sequence to generate a water flow motion saliency map, and superimposing it with the original river surface image to obtain a water flow image; S2, generating a spatiotemporal image based on the water flow image; S3, calculating the local texture angle by the local Fourier maximum angle estimation method, and calculating the local correlation coefficient C by the gradient tensor method; Calculate the local texture angle by using the local Fourier maximum angle estimation method: The space-time image is transformed into a spectral image through two-dimensional Fourier transform, and the main direction θ of the Fourier spectrum is obtained m , the main direction θ m The main texture direction δ of the spatiotemporal image satisfies the following orthogonal relationship: δ = θ m +90°; The two-dimensional Fourier transform is expressed as follows: Where h(x,t) is the spatiotemporal image; F(u,v) is the Fourier transform of the image; M, N are the height and width of the image; The amplitudes on the horizontal and vertical lines in the center of the spectrum are set to 0, the filter is set to an ellipse and used as the integration area, the major axis and minor axis are N / 8 and 2 pixels respectively, and the main direction of the spectrum θ is obtained by integration in the range of 0°-180°. m , and then calculate the main direction of the texture δ through the orthogonal relationship; The local correlation coefficient C is calculated by the gradient tensor method: The calculation formula of the local correlation coefficient C is as follows: and They represent the gradient of the image along the x direction and the t direction respectively, and A represents the integration area; Δx is a unit pixel of the grayscale image; S4, calculating the average texture angle according to the local texture angle and the local correlation coefficient C; The spatiotemporal image is divided into multiple rectangular regions, and the local texture angle and the local correlation coefficient C of each rectangular region are calculated by the method of step S3, then: θ i Represents the local texture angle of each rectangular area, represents the average texture angle; S5. Calculate the flow velocity and flow rate of the river surface based on the average texture angle.
2. The non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement according to claim 1, It is characterized in that After S2 generates the space-time image, it also includes preprocessing the generated space-time image, specifically including: The generated spatiotemporal image is denoised using a modified alpha mean filter. The modified alpha mean filter removes d minimum values and d maximum values in the pixel neighborhood of the spatiotemporal image f(x,t) and calculates the remaining pixels g R The arithmetic mean of (r,c) is expressed as follows: Where: m, n represents the size of the filter, S R Represents a rectangular neighborhood, and the value range of d is (0,mn / 2-1); Use unsharp masking to enhance the denoised spatiotemporal image as follows: f mask (x,t)=f(x,t)-f smooth (x,t),f smooth represents the smoothed image of the spatiotemporal image, f mask represents the unsharp mask image; h(x,t)=f(x,t)+kf mask (x, t), k represents a preset weight, k>1; h(x, t) represents the spatiotemporal image after passivation masking enhancement.
3. The non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement according to claim 1, It is characterized in that S1 specifically includes: The images of the nth frame and the n-1th frame in the video sequence are F n and F n-1 , the gray value of the corresponding pixel is recorded as f n x,y and f n-1 x,y , the motion saliency map at time n is D n , d n x,y D n The elements of are: Where: h is the preset threshold; k 1 , k 2 are preset coefficients, which are set to values greater than 1 and less than 1 respectively; Generate motion saliency map D n After that, it is superimposed with the original image of the river surface to obtain the water flow image R n , r n x,y For R n The elements of are:
4. The non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement according to claim 1, It is characterized in that S2 specifically includes: A sequence of N frames of water flow images is acquired at a set time interval Δt, and then a speed measuring line is set parallel to the direction of water flow movement. The width of the speed measuring line is 1 pixel and the length is L pixels. The grayscale of each speed measuring line is extracted frame by frame and arranged in order from top to bottom to synthesize a spatiotemporal image of size L×N pixels.
5. The non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement according to claim 1, It is characterized in that S5 specifically includes: If the distance of the river surface flow feature moving along the velocity measurement line is D and the time is T, corresponding to the movement of i pixels in the k-frame pixel movement, the average flow velocity of the velocity measurement line is: Where: represents the average texture angle, S X Indicates the actual distance represented by each pixel, and fps indicates the frame rate of the camera; The vertical average velocity v is expressed by the following formula: v = η·v 表面 , η represents the surface velocity coefficient; Finally, the flow rate is calculated according to the velocity area method, and the calculation method is as follows: v i represents the average flow velocity of the vertical line in the interval, A i Represents the area of the interval.
6. A computer device comprising a memory storing program instructions, It is characterized in that When the program instructions are executed, the non-contact flow measurement method based on frame difference and spatiotemporal image velocity measurement as described in any one of claims 1 to 5 is executed.
Citation Information
Patent Citations
River channel flow velocity measurement method based on edge recognition and maximum sequence density estimation
CN111798386A
Video flow measurement method and device based on LK tracking and gray statistical feature method
CN116466104A
Space-time image flow measurement method, device and system and storage medium
CN117036434A
Two-dimensional space-time image velocity measurement method and device for field river surface and storage medium
CN117452021A
River surface flow velocity measurement method and device based on space-time image
CN117890625A
Cited By
Online calibration method and system for hydrological flow data
CN121346947A
River flow measurement method and device based on river constraint feature matching
CN121475340A
