A visual flow rate measurement method for unevenly illuminated sites
By combining local Gaussian threshold segmentation and ORB feature point detection with Lucas-Kanade sparse optical flow, the problem of water flow velocity measurement accuracy in uneven illumination scenarios is solved, and high-precision water flow velocity measurement is achieved under complex illumination conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HUAJU SCI INSTR CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-29
AI Technical Summary
Existing image processing-based water flow velocity measurement methods suffer from inconsistent accuracy in outdoor scenes with uneven lighting, where changes in illumination alter the imaging characteristics of the target object, affecting the measurement accuracy.
By employing local Gaussian threshold segmentation technology, combined with ORB feature point detection and the Lucas-Kanade sparse optical flow method, the local Gaussian threshold segmentation parameters are dynamically adjusted to adaptively handle the problem of uneven illumination. Background interference is removed through mask operation and Gaussian filtering, thereby achieving accurate measurement of water flow velocity.
It effectively counteracts uneven lighting and background noise interference, improves speed measurement accuracy and environmental adaptability, and ensures accurate calculation of water flow velocity under complex lighting conditions.
Smart Images

Figure CN122115508A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to water flow velocity measurement technology, specifically to a visual water flow velocity measurement method in situations with uneven lighting. Background Technology
[0002] With the development of computer and artificial intelligence technologies, it has become possible to measure the velocity of water flow in outdoor scenarios using image processing technology. Compared with traditional contact-based flow measurement methods and non-contact methods such as ultrasonic flow measurement, video-based flow measurement methods have advantages such as ease of installation, lower cost, safety, high efficiency, and ease of large-scale deployment, thus showing broad development prospects.
[0003] However, in practical applications, the complex outdoor lighting conditions for water flow velocity measurement, such as changes in ambient light due to weather variations and shadows cast by man-made structures or natural objects, can interfere with imaging results. Most existing image processing-based velocity measurement methods require the detection and tracking of targets on the water surface. When lighting changes, the imaging characteristics of the target object also change, causing the tracking algorithm to fail and thus affecting the accuracy of the velocity measurement. This application addresses the aforementioned problem of uneven lighting by providing an adaptive water flow velocity measurement processing method. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] The purpose of this invention is to provide a visual water flow velocity measurement method in situations with uneven lighting in order to solve the above-mentioned problems.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a visual water flow velocity measurement method in situations with uneven lighting, comprising the following steps: S1. Acquire video frames and convert the acquired video frames into single-channel images; S2. Perform masking operations based on a single-channel image to filter out irrelevant background interference and extract the ROI; S3. Perform smoothing filtering on the masked image to remove abnormal noise; S4. Perform local Gaussian thresholding using initial values to obtain a binarized image, where the initial parameters include neighborhood size and threshold bias. S5. Use the ORB feature point detection algorithm to detect feature points in the binarized image; S6. Based on the detected feature points, the sparse optical flow is established using the Lucas-Kanade method; S7. Obtain the pixel displacement of the feature points based on the sparse optical flow, calculate the water flow velocity by combining the pixel-to-actual length conversion coefficient and time interval, and filter out the optical flow corresponding to the feature points with large deviations in the direction of motion. S8. Based on the feature point detection results of step S5, the sparse optical flow establishment results of step S6, and the water velocity calculation results of step S7, dynamically adjust the local Gaussian threshold segmentation parameters in step S4.
[0008] In some embodiments of the present invention, in step S1, video frames are continuously acquired from a camera through a video flow measurement device. The acquired video frames have a resolution of 1920x1080 and a frame rate of 30fps. The camera uses a MIPI CSI interface or a USB interface. The camera uses a MIPI CSI interface and captures video frames in NV12 format. The camera has a USB interface and captures video frames in MJPEG compression format.
[0009] In some embodiments of the present invention, in step S1, the single-channel image is a grayscale image, which is obtained by weighted fusion of the R, G, and B channel information of the acquired video frame.
[0010] In some embodiments of the present invention, in step S2, the mask image is the same size as the video frame acquired in step S1, wherein the white area with a value of 255 corresponds to the ROI area, and the black area with a value of 0 corresponds to the background area.
[0011] In some embodiments of the present invention, in step S3, the smoothing filter employs Gaussian blur filtering, and the image is convolved using discrete odd-sized Gaussian kernels. The size of the Gaussian kernel includes 3x3, 5x5, or 7x7, and the Gaussian function is defined as G(x,y)=(1 / (2πσ²)). exp(-(x²+y²) / (2σ²)), where (x,y) are the coordinates relative to the center of the kernel, and σ is the standard deviation.
[0012] In some embodiments of the present invention, in step S4, the local Gaussian thresholding is performed using adaptive Gaussian thresholding with constant offset, the neighborhood window size is blockSize×blockSize, and the neighborhood pixels are calculated by Gaussian weighting.
[0013] In some embodiments of the present invention, in step S5, the ORB feature point detection algorithm includes: using the FAST algorithm to detect key points and combining it with an image pyramid to achieve scale invariance; using an improved rotation-invariant rBRIEF descriptor to describe key points; the descriptor generates a binary feature vector by calculating the main direction of the feature points and rotating the pixel sampling template, and has rotation invariance.
[0014] In some embodiments of the present invention, in step S6, the Lucas-Kanade method, combined with the image pyramid, overcomes the limitations of its native small motion assumption, achieving accurate tracking of large displacements of feature points across consecutive frames. Large motions are processed at the top layer of the low-resolution pyramid, and the result is then used as the initial estimate for the next high-resolution layer. This process is iterated until the bottom layer of the original image is reached, where the fundamental optical flow equation Ix is solved using the least squares method. u+Iy v + It = 0, where Ix = I / x, Iy = I / y, It= I / t, u=dx / dt, v=dy / dt.
[0015] In some embodiments of the present invention, in step S7, the mathematical formula for calculating water velocity is: velocity = (pixel displacement × pixel to actual length conversion coefficient) / time interval, where the time interval is the shooting time difference between two consecutive video frames.
[0016] In some embodiments of the present invention, in step S8, the dynamically adjusted local Gaussian threshold segmentation parameters include the neighborhood window Size and a constant C, and the parameter size is adaptively adjusted according to the accuracy of water flow velocity measurement.
[0017] (III) Beneficial Effects
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By using local Gaussian threshold segmentation technology, the threshold is dynamically calculated based on the local neighborhood grayscale characteristics of pixels, rather than relying on a globally fixed threshold. This effectively offsets the spatial and temporal unevenness of illumination caused by water reflections, building shadows, weather changes, etc., satisfies the core assumption of "constant brightness" of the optical flow method and avoids tracking failure caused by distortion of target imaging features.
[0019] 2. Based on the feature point detection quality, sparse optical flow tracking stability and final velocity measurement accuracy, the neighborhood window size (blockSize) and threshold bias (constant C) of local Gaussian threshold segmentation are dynamically optimized. This allows the method to adapt to changes in different outdoor lighting scenarios without manual intervention, significantly improving its environmental adaptability.
[0020] 2. Masking operations extract the Region of Interest (ROI), shielding irrelevant backgrounds such as grass and rocks on the bank, and eliminating false optical flow caused by background texture noise. Gaussian filtering effectively suppresses sensor thermal noise and readout noise, optimizing the stability of image gradient calculation and providing high-quality input for feature point detection and optical flow tracing. The ORB feature point detection algorithm is employed, possessing both scale invariance and rotation invariance, and is computationally efficient and patent-free, adapting to real-time velocity measurement requirements. The Lucas-Kanade method of image pyramids overcomes the limitations of the assumption of small motions, achieving accurate tracking of large displacements of feature points and ensuring the accuracy of water flow motion vector calculation. Based on the relatively fixed nature of water flow direction, optical flow corresponding to feature points with large deviations in motion direction is filtered out, eliminating non-water flow-dominated motion interference such as wind-blown debris and water surface bubbles, ensuring that the velocity measurement results reflect the true water flow state.
[0021] 3. Converting color video frames into single-channel grayscale images reduces data volume by two-thirds. Simultaneously, it aligns with the mathematical framework of classic optical flow algorithms, significantly improving computational efficiency without losing critical information, thus adapting to the real-time operation requirements of embedded devices and mobile platforms. Continuing the advantages of video-based non-contact flow measurement, it eliminates the need for water-based equipment installation, avoiding the safety hazards and complex maintenance of traditional contact-based flow measurement. Furthermore, it is lower in cost and easier to deploy on a large scale compared to non-contact methods such as ultrasonic measurements.
[0022] 4. By normalizing the influence of light source color temperature changes through grayscale conversion, Gaussian weighted threshold segmentation reduces the interference of noise on threshold calculation. The collaborative design of preprocessing and core algorithm enables the method to work stably in scenarios with fluctuating lighting, complex backgrounds, and changing target motion states. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of the speed measurement method of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0026] The technical concept of this invention is as follows: Current optical flow velocimetry relies on the fundamental assumption of "constant brightness," meaning that the brightness or color intensity of a point on the same object remains constant across two consecutive frames. Under this assumption, the movement of pixels in the image (i.e., optical flow) is entirely caused by the motion of the object. "Constant brightness" means that the light is uniformly distributed in space, i.e., there are no drastic, localized changes in light intensity throughout the observed scene. It also means that the light source intensity remains stable in time, i.e., the intensity does not change within the short time interval (Δt) between consecutive frames. This principle introduces its inherent limitation: "constant brightness."
[0027] To address the limitations of existing methods, the present invention aims to provide a water flow velocity measurement method that adaptively adjusts to uneven outdoor lighting conditions. This method first performs local Gaussian threshold segmentation to reduce the impact of uneven lighting, then establishes a dense optical flow at key points for velocity measurement, and finally uses the velocity measurement results to adaptively correct the local threshold segmentation parameters, achieving final automatic velocity measurement.
[0028] See Figure 1 As shown, this invention provides a visual water flow velocity measurement method in situations with uneven lighting, the specific steps of which are as follows: Step 1: Capture video frames and convert them into single-channel images Video frames are continuously captured from the camera via a video flow meter. The captured video frames have a resolution of 1920x1080 and a frame rate of 30fps. The camera uses either a MIPI CSI interface or a USB interface. If the camera uses a MIPI CSI interface, the captured video frame format is NV12. If the camera uses a USB interface, the captured video frame format is MJPEG compression.
[0029] The captured video frames are converted into single-channel images in grayscale format. This conversion is achieved by weighted fusion of the R, G, and B channel information of the video frames. This conversion has clear technical significance: Improve computational efficiency: Reduce data volume by 2 / 3, simplify 3-channel color images to 1-channel grayscale images, and reduce the computational load of subsequent processing; Enhancing algorithm robustness: Under real lighting conditions, changes in the color temperature of the light source will cause an overall proportional change in RGB values. This change is not caused by motion and will interfere with the "constant brightness" assumption of the optical flow algorithm. The weighted fusion grayscale conversion can "normalize" the influence of color temperature changes. As long as the overall light intensity remains unchanged, the grayscale values can remain relatively stable, allowing the algorithm to focus on the geometric motion itself. It fits the classic algorithm framework: The mathematical model derivation of most classic optical flow algorithms is based on the assumption of grayscale images and defined on a one-dimensional brightness field. Directly using color images requires expanding the theoretical framework, which increases complexity and has limited benefits.
[0030] Step 2: Extract ROI (Region of Interest) using mask operations
[0031] Masking is performed on a single-channel image to filter out irrelevant background interference and extract the Region of Interest (ROI). The mask is a binary image of the same size as the original video frame, where white areas with a value of 255 correspond to ROI areas, and black areas with a value of 0 correspond to background areas.
[0032] The core function of this step is: Focusing on the target area: The optical flow method is essentially to calculate the motion vector of pixels in the whole image, but the velocity measurement only focuses on water flow-related targets. The mask forcing algorithm only "focuses" on the brightness changes within the ROI and ignores the background area. Eliminating erroneous signal sources: Static but textured backgrounds such as grass and rocks on the shore may generate random noise optical flow due to image noise, slight changes in illumination, and quantization errors. This noise can contaminate motion statistics results and reduce velocity measurement accuracy. Masks can effectively filter out such interference.
[0033] Step 3: Smoothing filter to remove abnormal noise
[0034] The masked image is smoothed by filtering to remove abnormal noise. The smoothing filter uses Gaussian blur filtering and convolves the image with discrete odd-sized Gaussian kernels. The size of the Gaussian kernel can be 3x3, 5x5 or 7x7. The Gaussian function is defined as G(x,y)=(1 / (2πσ²)). exp(-(x²+y²) / (2σ²)), where (x,y) are the coordinates relative to the kernel center, and σ is the standard deviation (the larger σ is, the blurrier the image).
[0035] The technical value of Gaussian blur filtering is reflected in: Combating image sensor noise: CMOS / CCD sensors introduce random noise such as thermal noise and readout noise, which manifests as high-frequency fluctuations in pixel brightness. If left untreated, this can lead to false brightness changes in gradient calculations, which can be misjudged as chaotic motion by optical flow algorithms. Filtering can effectively suppress this type of noise. To satisfy the "local smoothness" premise of optical flow algorithm: The constant brightness assumption of optical flow method usually holds in a small neighborhood and implicitly assumes that "pixel motion is similar in neighborhood". High-frequency textures and noise in the original image will destroy the consistency of neighborhood brightness pattern. Gaussian blur, as a low-pass filter, can filter out high-frequency components and retain the gradually changing brightness structure, making neighborhood pixels more in line with the "smooth motion" model.
[0036] Step 4: Obtain the binarized image through local Gaussian thresholding (core step)
[0037] Local Gaussian thresholding is performed using initial values to obtain a binarized image. The initial parameters include the neighborhood size (blockSize) and the threshold bias (constant C). The local Gaussian thresholding uses adaptive Gaussian thresholding with constant offset. The neighborhood window size is blockSize×blockSize, and the sum of neighborhood pixels is calculated by Gaussian weighting.
[0038] Technical principles and advantages: Threshold calculation logic: The threshold T(x,y) for each pixel is equal to the Gaussian weighted neighborhood sum (x,y) - C. The gray value I(x,y) of the current pixel is compared with T(x,y). If I(x,y) > T(x,y), then the pixel in the binary image is 255 (white); otherwise, it is 0 (black). Gaussian weighting means that the closer the pixel is to the center in the neighborhood, the greater its contribution to the threshold. The core mechanism for solving uneven lighting: Local adaptability: Even if the overall lighting of the image is uneven (such as the difference in brightness in the local area caused by the reflection of the water surface), the threshold of each pixel is calculated based on the gray-scale characteristics of its local neighborhood. The brightness change in the local area is relatively smooth, which can accurately distinguish the foreground (velocity-related targets such as floating objects) from the background. Suppressing slowly changing backgrounds: The slow changes in background brightness caused by water reflections and ripples will result in a calculated threshold that is close to the background gray value because the gray values of pixels in the local neighborhood are similar. This will unify the background into a single color (such as black), while the edges of floating objects will form a clear contrast with the background and be highlighted as the opposite color (white outline). Noise resistance: Compared with simple mean weighting, Gaussian weighting can better preserve local features and reduce the impact of noise on threshold calculation; Final result: The image is transformed into a binary image with a uniform background (water surface) color and a clear foreground (target) outline, so that the "constant brightness" assumption of the optical flow algorithm is satisfied and the interference of water surface reflection fluctuations on speed measurement is avoided.
[0039] Step 5: ORB Feature Point Detection Algorithm detects feature points.
[0040] The ORB feature point detection algorithm is used to detect feature points in the binarized image. The ORB feature point detection algorithm includes: using the FAST algorithm to detect key points and combining it with the image pyramid to achieve scale invariance; using the improved rotation-invariant rBRIEF descriptor to describe key points; the descriptor generates a binary feature vector by calculating the main direction of the feature points and rotating the pixel sampling template, which has rotation invariance.
[0041] Advantages of choosing this algorithm: The ORB algorithm is designed to achieve extreme computational efficiency while maintaining high performance, making it suitable for real-time operation on embedded devices and mobile platforms. Its advantages compared to traditional algorithms are as follows:
[0042] Step Six: Establishing Sparse Optical Flow Using the Lucas-Kanade Method
[0043] Based on the detected feature points, the Lucas-Kanade method is used to establish sparse optical flow (the optical flow is calculated only for the feature points, not for the entire image pixels). The Lucas-Kanade method, combined with the image pyramid, breaks through the limitation of its original small motion assumption, and achieves accurate tracking of large displacements of feature points between consecutive frames. Large motions are processed at the top layer of the low-resolution pyramid, and then the result is used as the initial estimate of the next high-resolution layer. This process is iterated until it becomes the bottom layer of the original image.
[0044] Core principle: Algorithm assumptions: constant brightness, the brightness of the same feature point remains unchanged between consecutive frames; minimal motion: the motion of feature points between two frames is small (image pyramids can overcome this limitation). The fundamental equation of optical flow is derived through Taylor expansion: Ixu + Iyv + It = 0, where Ix = I / x (spatial gradient in the x-direction), Iy = I / y (spatial gradient in the y-direction), It = I / t (time gradient), u = dx / dt (velocity in the x-direction), v = dy / dt (velocity in the y-direction); Solution method: Since a single equation cannot solve for the two unknowns u and v, it is assumed that all pixels in a small neighborhood move in the same way. Multiple equations are obtained by taking the neighborhood of the feature point (such as a 5x5 window), and then expressed in matrix form A. [u,v]^T=b (A is composed of (Ix,Iy) of neighboring pixels, and b is composed of -It of neighboring pixels), which can be solved by the least squares method: [u,v]^T=(A^TA)^{-1}A^Tb; Engineering Implementation: The pyramid Lucas-Kanade optical flow algorithm is implemented using the calcOpticalFlowPyrLK function. The tracked feature points are mainly located on the outline of the floating object (the gradient at the outline is obvious and conforms to the corner feature), and its motion can represent the motion of the floating object.
[0045] Step 7: Calculate water flow velocity and filter out abnormal optical flow
[0046] The pixel displacement of feature points is obtained based on sparse optical flow. The water flow velocity is calculated by combining the pixel-to-actual length conversion coefficient and time interval. At the same time, based on the relatively fixed characteristic of water flow direction, the optical flow corresponding to feature points with large deviations in the direction of motion is filtered out to eliminate abnormal data interference.
[0047] Speed calculation logic: pixel displacement → actual displacement → speed. The mathematical formula is: velocity = (pixel displacement × pixel to actual length conversion coefficient) / time interval, where the time interval is the shooting time difference between two consecutive video frames (a fixed time interval can be derived from a 30fps frame rate). The purpose of abnormal filtering is to prevent moving targets such as wind-blown debris and water surface bubbles from affecting the accuracy of velocity measurement and to ensure that the calculation results reflect the true water flow velocity.
[0048] Step 8: Dynamically adjust the local Gaussian threshold segmentation parameters
[0049] Based on the feature point detection results of step S5 (such as the number of feature points and the rationality of their distribution), the sparse optical flow establishment results of step S6 (such as the stability of optical flow tracking and the accuracy of matching), and the water velocity calculation results of step S7 (such as the dispersion of velocity data and whether it conforms to the laws of water flow), the local Gaussian threshold segmentation parameters in step S4 are dynamically adjusted.
[0050] The parameters for dynamic adjustment include the neighborhood window size (blockSize) and a constant C. The adjustment logic is as follows: Neighborhood window size: If the size is too small, it cannot cover enough background area, and the threshold is easily affected by noise; if the size is too large, it may mix large areas of background and foreground, causing the threshold to fail. It needs to be adaptively adjusted according to the feature point detection quality and optical flow stability. Constant C: Used to adjust the threshold offset and control the sensitivity of binarization. It needs to be dynamically optimized according to the accuracy of water velocity calculation to ensure that the foreground and background can be accurately distinguished under different uneven lighting conditions and to maintain the stability of velocity measurement.
[0051] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for visual water flow velocity measurement in situations with uneven lighting, characterized in that: Includes the following steps: S1. Acquire video frames and convert the acquired video frames into single-channel images; S2. Perform masking operations based on a single-channel image to filter out irrelevant background interference and extract the ROI; S3. Perform smoothing filtering on the masked image to remove abnormal noise; S4. Perform local Gaussian thresholding using initial values to obtain a binarized image, where the initial parameters include neighborhood size and threshold bias. S5. Use the ORB feature point detection algorithm to detect feature points in the binarized image; S6. Based on the detected feature points, the sparse optical flow is established using the Lucas-Kanade method; S7. Obtain the pixel displacement of the feature points based on the sparse optical flow, calculate the water flow velocity by combining the pixel-to-actual length conversion coefficient and time interval, and filter out the optical flow corresponding to the feature points with large deviations in the direction of motion. S8. Based on the feature point detection results of step S5, the sparse optical flow establishment results of step S6, and the water velocity calculation results of step S7, dynamically adjust the local Gaussian threshold segmentation parameters in step S4.
2. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S1, video frames are continuously captured from the camera through a video flow measurement device. The captured video frames have a resolution of 1920x1080 and a frame rate of 30fps. The camera uses a MIPI CSI interface or a USB interface. The camera uses a MIPI CSI interface and captures video frames in NV12 format. The camera has a USB interface and captures video frames in MJPEG compression format.
3. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S1, the single-channel image is a grayscale image, which is obtained by weighted fusion of the R, G, and B channel information of the acquired video frame.
4. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S2, the mask image is the same size as the video frame acquired in step S1, wherein the white area with a value of 255 corresponds to the ROI area, and the black area with a value of 0 corresponds to the background area.
5. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S3, the smoothing filter employs Gaussian blur filtering, using discrete odd-sized Gaussian kernels to convolve the image. The size of the Gaussian kernel includes 3x3, 5x5, or 7x7, and the Gaussian function is defined as G(x,y)=(1 / (2πσ²)). exp(-(x²+y²) / (2σ²)), where (x,y) are the coordinates relative to the center of the kernel, and σ is the standard deviation.
6. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S4, the local Gaussian thresholding uses adaptive Gaussian thresholding with constant offset, and the neighborhood window size is blockSize×blockSize. The neighborhood pixels are calculated by Gaussian weighting.
7. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S5, the ORB feature point detection algorithm includes: using the FAST algorithm to detect key points and combining it with an image pyramid to achieve scale invariance; using an improved rotation-invariant rBRIEF descriptor to describe key points; and generating a binary feature vector by calculating the main direction of the feature points and rotating the pixel sampling template, which has rotation invariance.
8. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S6, the Lucas-Kanade method, combined with the image pyramid, overcomes the limitations of its native assumption of small motion, achieving accurate tracking of large displacements of feature points across consecutive frames. Large motions are processed at the top layer of the low-resolution pyramid, and the result is then used as the initial estimate for the next high-resolution layer. This process is iterated until the bottom layer of the original image is reached, where the fundamental optical flow equation Ix is solved using the least squares method. u+Iy v + It = 0, where Ix = I / x, Iy = I / y, It= I / t, u=dx / dt, v=dy / dt.
9. The visual water flow velocity measurement method in an uneven lighting environment according to claim 1, characterized in that: In step S7, the mathematical formula for calculating water velocity is: velocity = (pixel displacement × pixel to actual length conversion coefficient) / time interval, where the time interval is the shooting time difference between two consecutive video frames.
10. The method for visual water flow velocity measurement in uneven lighting conditions according to claim 1, characterized in that: In step S8, the dynamically adjusted local Gaussian threshold segmentation parameters include the neighborhood window Size and the constant C, and the parameter values are adaptively adjusted according to the accuracy of water flow velocity measurement.