Flow velocity measurement method and system based on dynamically updated KCF
By combining a dynamically updated KCF tracker with a YOLOv5 detector, the accuracy and stability issues of floating object detection and tracking in complex hydrological environments were resolved, achieving high-precision flow velocity measurement.
Patent Information
- Application Number
- CN202511534683.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2025-11-25
AI Technical Summary
Existing image processing technologies struggle to guarantee the accuracy of floating object detection and the stability of floating object tracking in complex hydrological environments. In particular, the target detection and tracking process is easily interfered with in situations with rapid currents and obstruction by debris, and the lack of a model update mechanism leads to a decrease in tracking accuracy.
A dynamically updated KCF tracker is adopted, which obtains difference images through video data preprocessing, combines YOLOv5 target detector for floating object detection, optimizes target tracking by using response value threshold and overlap evaluation mechanism, and introduces a weighted fusion update mechanism to dynamically update the KCF tracker, thereby improving tracking accuracy and robustness.
It significantly improves the accuracy of floating object identification and tracking robustness in complex hydrological environments, reduces error accumulation, and ensures the reliability and accuracy of flow velocity measurement.
Smart Images

Figure CN121010628A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of hydrological monitoring, and particularly relates to a flow velocity measurement method and system based on dynamic updating KCF. BACKGROUND
[0002] At present, the measurement of water surface flow velocity mainly relies on traditional mechanical flow meters or acoustic Doppler flow meters and other equipment. However, these devices are often difficult to guarantee the accuracy and stability of the measurement in the case of complex and changeable hydrological environment. With the development of computer vision technology, it is possible to use image processing technology for flow velocity measurement, but the existing image processing technology still cannot guarantee the accuracy of floating object detection and the stability of floating object tracking when applied to the measurement of water surface flow velocity in a complex hydrological environment.
[0003] Jianfang Liu and Chengjian Li proposed in their paper "Research on Target Tracking Algorithm Based on YOLO and KCF" (Computer Science and Application, 2020, 10(6), 1113-1121) that YOLO and KCF are combined for target tracking algorithm to solve the tracking deviation and target loss problems caused by the deviation of the recording device in the target tracking process, but this technology only stays at the level of target tracking in a fixed scene, and it is difficult to effectively suppress the interference of the environment when facing a complex hydrological environment background. For example, in the scene where the water flow is turbulent, the target motion state changes dramatically, and the target is partially missing due to the obstruction of debris, the interference of the complex environment on the detection and tracking process of the target is significantly enhanced. In addition, this technology lacks a model updating mechanism, so when the target is obscured or changes in appearance, it cannot update the feature template of the target in real time, but only relies on the information of the early frames for matching, which leads to a significant decline in tracking accuracy and has significant technical limitations. SUMMARY
[0004] To solve the problems of poor measurement accuracy, low robustness and low generalization in measuring flow velocity in a complex and changeable hydrological environment, the present application provides a flow velocity measurement method and system based on dynamic updating KCF.
[0005] To achieve the above purpose, the technical solution adopted by the present application is as follows:
[0006] The flow velocity measurement method based on dynamic updating KCF comprises the following steps:
[0007] S1, collect video data, pre-process the video data, and obtain a difference image;
[0008] S2. Target detection is performed on the difference image using a target detector to obtain the position information of the target in all frames of the difference image. The location information in the frame initializes the KCF tracker;
[0009] S3. Use the initialized KCF tracker to obtain the target at the... The predicted location information in the frame is evaluated by a preset response value threshold. If the response value is higher than the response value threshold, then proceed to S4.
[0010] Conversely, proceed to the next frame and use the first... The location information in the frame initializes the KCF tracker, and returns to S2;
[0011] S4, the first of the targets The overlap between the location information in the frame and the predicted location information is calculated, and the overlap is evaluated in conjunction with the overlap threshold, while counting is performed synchronously.
[0012] If the overlap degree is greater than the overlap degree threshold, the count is reset to zero, and the first record is made. The predicted location information of the target is framed, the KCF tracker is updated, and the process proceeds to S5;
[0013] Conversely, it determines whether the count has reached the specified value. If it has, the count is cleared and the process returns to S2; otherwise, it proceeds to S5.
[0014] S5. If the current frame number is equal to the total number of frames of the difference image, calculate the river surface velocity based on all the recorded predicted location information and output the result; otherwise, return to S3 to calculate the next frame.
[0015] Preferably, step S1 further includes: preprocessing the video data, including:
[0016] The average pixel value of all frames of the video data is calculated to obtain an average frame image; the difference between the video data and the average frame image is calculated pixel by pixel to obtain the difference image.
[0017] Preferably, step S2 further includes: initializing the KCF tracker including: based on the target's first... Based on the location information provided in the frame, establish the objective function:
[0018]
[0019] in, Let the objective function be... For the target in the first In the frame Pixel coordinates in direction Let be the weight vector to be learned. For the The conjugate transpose of ;
[0020] The objective function is calculated using the least squares method:
[0021]
[0022] in, For the target in the first In the frame Pixel coordinates in direction For regularization terms, For regularization parameters, For the first frame;
[0023] Solve for the weight vector in the frequency domain:
[0024]
[0025] in, , The target is respectively in the first Frequency domain value of frame position information for Complex conjugate;
[0026] Introducing the Gaussian kernel function ,make Then we have:
[0027]
[0028] in, The kernel matrix represents the kernel space. For the The conjugate transpose of the matrix. It is the identity matrix. For high-dimensional weights;
[0029] The KCF tracker is initialized by solving for the frequency domain values of the high-dimensional weights, as shown in the following formula:
[0030]
[0031] in, The frequency domain value of the high-dimensional weight. This is the Fourier transform of the first row of the kernel matrix.
[0032] Preferably, step S3 further includes: using the initialized KCF tracker to obtain the target at the... The predicted location information in the frame is evaluated by assessing the response value of the predicted location information using a preset response value threshold, including:
[0033] Through the target The location information in the frame and the KCF tracker in the first... The frame tracking results are used to construct a similarity kernel matrix. The frequency domain value of the response value is then obtained using the frequency domain expression formula of the response value, as follows:
[0034]
[0035] in, The frequency domain value of the response value. This is the first row of the similarity kernel matrix;
[0036] Perform a Fourier transform on the frequency domain value of the response value to obtain the peak value of the response value, and define the tracking result corresponding to the peak value of the response value as the target's [number]. Frame prediction location information.
[0037] Preferably, step S4 further includes: the overlap calculation includes: obtaining the first overlap using the following formula The degree of overlap between the frame's location information and the predicted location information:
[0038]
[0039] in, The degree of overlap, For the target of The location information described in the frame, For the target of The frame contains the predicted location information.
[0040] Preferably, step S4 further includes: if the overlap degree is greater than the overlap degree threshold, then the count is reset to zero, the predicted location information of the target is recorded, and the KCF tracker is updated. Updating the KCF tracker includes using a weighted fusion update mechanism, wherein the weighted fusion update mechanism includes:
[0041] Use the following formula to calculate the first... The frequency domain values of the high-dimensional weights of the KCF tracker in the frame and the frequency domain values of the predicted position information are calculated to obtain the first... The frequency domain values of the high-dimensional weights of the KCF tracker and the frequency domain values of the predicted location information are shown in the frame.
[0042]
[0043]
[0044] in, , The first Frame and the The frequency domain value of the high-dimensional weights mentioned in the frame. , The first Frame and the The frequency domain value of the predicted location information in the frame; , The first The frequency domain values of the high-dimensional weights and the predicted location information; To update the weighting factors.
[0045] Preferably, step S4 further includes: using a counter to count, wherein the specified value is set to 5.
[0046] Preferably, step S5 further includes: calculating the river surface velocity includes:
[0047] Through the aforementioned objective in the Frame and the The predicted position information of the frame is used to obtain the target displacement distance. Its expression is:
[0048]
[0049] in, , The target is respectively in the first Frame and the In the frame Pixel coordinates in direction , The target is respectively in the first Frame and the In the frame Pixel coordinates in the direction;
[0050] Using the target displacement distance The target is obtained by performing the following calculation using the formula at the [number]th [time]. frame Instantaneous velocity magnitude and direction within:
[0051]
[0052] in, Indicates that the target is in the first Inter-frame motion speed, Indicates the first Inter-frame time interval, This indicates the direction and angle of the target's movement.
[0053] Preferably, step S5 further includes: calculating the instantaneous velocity magnitude and direction of the target over multiple time periods, averaging the results to obtain the average flow velocity of the target, as shown in the following formula:
[0054]
[0055] in, The average flow velocity, To effectively track the number of frames.
[0056] The present invention also provides a flow velocity measurement system based on dynamically updated KCF, for implementing the flow velocity measurement method based on dynamically updated KCF as described in claim 1, comprising the following modules:
[0057] The video processing module is used to acquire video data and perform preprocessing to obtain difference images;
[0058] The target detection module is used to perform target detection on the difference image using a target detector to obtain the target's location information;
[0059] A training module for initializing the KCF tracker;
[0060] The target tracking module is used to track the target using the KCF tracker and obtain the predicted location information of the target.
[0061] The calculation and evaluation module is used to evaluate the accuracy of the predicted location information of the target and record the predicted location information of the target that has passed the evaluation.
[0062] The calculation output module is used to calculate the flow velocity from all the recorded predicted location information and output the result.
[0063] The advantages of this invention compared to existing methods are:
[0064] (1) This invention separates the static background from the moving target or changing area in the video data by performing pixel difference calculation on the video data, which solves the problem that the detection of floating objects is easily affected by background interference in complex hydrological environments, and improves the recognition accuracy and tracking robustness of floating objects.
[0065] (2) The present invention achieves this by targeting the first Frame and the The high-dimensional weights of the frame in the frequency domain and the predicted position information in the frequency domain are combined to form a weighted fusion update mechanism to dynamically update the high-dimensional weights of the KCF tracker. This combines the historical information of the target with the current observation information, which solves the problem of poor tracking generalization caused by factors such as changes in the appearance of floating objects and environmental interference in complex hydrological environments, and effectively improves tracking accuracy and generalization.
[0066] (3) This invention uses a target detector and a KCF tracker to jointly detect and track the target. It introduces an overlap evaluation mechanism to calculate the overlap between the target's position information and the predicted position information to determine whether the target tracking is successful. This solves the problem of error accumulation caused by a single algorithm, realizes accurate calibration of the target's position information during the tracking process, improves the robustness of target tracking, and ensures the reliability of flow velocity data calculation. Attached Figure Description
[0067] 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.
[0068] figure 1 This is a flowchart of a flow velocity measurement method based on dynamically updated KCF according to an embodiment of the present invention;
[0069] figure 2 This is a schematic diagram of the flow velocity measurement system based on dynamically updated KCF according to an embodiment of the present invention. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this invention more apparent and understandable, the technical solutions of this invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0071] Please see figure 1 As shown, the flow velocity measurement method based on dynamically updated KCF provided by the present invention includes the following steps:
[0072] S1. Acquire video data, preprocess the video data, and obtain a difference image.
[0073] Step S1 in this embodiment of the invention further includes:
[0074] Using cameras and other imaging devices, video data of the water surface in different aquatic environments is collected, and the video data covers detectable floating objects.
[0075] The average pixel value of all frames in the video data is calculated to obtain an average frame image representing the background information of the video data. A pixel-by-pixel difference is then calculated between the video data and the average frame image to obtain a difference image. This pixel-by-pixel difference calculation separates the static background from moving targets or changing regions in the video data, effectively suppressing interference from the static background and significantly enhancing the representation of dynamic region features, thereby improving the accuracy of subsequent target detection and tracking based on the difference image.
[0076] S2. Target detection is performed on the difference image using a target detector to obtain the position information of the target in all frames of the difference image. The location information in the frame initializes the KCF tracker.
[0077] Step S2 in this embodiment of the invention further includes:
[0078] The YOLOv5 model is used as a target detector to detect targets in the difference image. The targets include, but are not limited to, common pollutants such as plastic bottles, paper, and tree branches.
[0079] The target detector can use models such as YOLOv5, SSD, and RetinaNet. This embodiment selects the YOLOv5 model because the YOLOv5 model has good scale adaptability and robustness to complex backgrounds, which can meet the detection needs of different aquatic environments and has good generalization ability.
[0080] Specifically, in object detection of each frame, the YOLOv5 model will independently perform the following steps for the current frame, such as... Frame 1 performs target detection and outputs the first frame representing the target. Target bounding box of frame location information .in, , , , These represent the x-coordinate of the center point pixel, the y-coordinate of the center point pixel, the pixel width of the target bounding box, and the pixel height of the target bounding box, respectively.
[0081] The first of the objectives The location information in the frame initializes the KCF tracker, and the process is as follows:
[0082] The objective function is established using ridge regression:
[0083]
[0084] in, Let the objective function be... For the target in the first In the frame Pixel coordinates in direction Let be the weight vector to be learned. For the The conjugate transpose of .
[0085] The objective function is calculated using the least squares method:
[0086]
[0087] in, For the target in the first In the frame Pixel coordinates in direction For regularization terms, For regularization parameters, For the first frame.
[0088] Differentiating the weight vector, setting the derivative to 0, and using the diagonalization property of the circulant matrix, the weight vector is obtained in the frequency domain:
[0089]
[0090] in, , The target is respectively in the first Frequency domain value of frame position information for Complex conjugate, This indicates the element-by-element method.
[0091] Introducing the Gaussian kernel function ,make Then we have:
[0092]
[0093] in, The kernel matrix represents the kernel space. For the The conjugate transpose of the matrix. It is the identity matrix. The high-dimensional weights are defined as follows. By transforming the solution of the weight vector into the solution of the high-dimensional weights, the original space is mapped to the high-dimensional feature space, thus solving the nonlinearity problem in the solution of the weight vector in practical scenarios.
[0094] The frequency domain values of the high-dimensional weights are solved to initialize the KCF tracker, as shown in the following formula:
[0095]
[0096] in, The frequency domain value of the high-dimensional weight. This is the Fourier transform of the first row of the kernel matrix.
[0097] The YOLOv5 model is used to perform target detection on the difference image, accurately obtaining the target's location information, and using its first... The KCF tracker is initialized with frame position information, which solves the initialization deviation problem of the KCF tracker in complex scenes and ensures the accuracy of subsequent target tracking and flow velocity calculation.
[0098] S3. Use the initialized KCF tracker to obtain the target at the... The predicted location information in the frame is evaluated by using a preset response value threshold.
[0099] Step S3 in this embodiment of the invention further includes:
[0100] Through the target The location information in the frame and the KCF tracker in the first... The similarity kernel matrix is constructed from the frame tracking results. The frequency domain value of the response is calculated using the following formula:
[0101]
[0102] in, The frequency domain value of the response value. The similarity kernel matrix The first line, The frequency domain values of the high-dimensional weights of the KCF tracker. This indicates the element-by-element method.
[0103] The response value is then transformed from the frequency domain to the time domain using an inverse Fourier transform. The position corresponding to the maximum value of the response value in the time domain is the peak value of the response value. The tracking result corresponding to the peak value of the response value is defined as the target's [number missing]. Frame prediction location information. The response value represents the degree of matching between the target predicted in the current frame and the target in the previous frame, and the peak value corresponds to the position with the highest degree of matching.
[0104] The response value corresponding to the predicted location information is evaluated by a preset response value threshold. If the response value is greater than the response value threshold, the tracking is considered successful, and the process proceeds to S4; otherwise, the tracking is considered unsuccessful, and the target's [missing information] is used in the next frame. The location information in the frame initializes the KCF tracker, and returns to S3.
[0105] By comparing the response value with the response value threshold in real time, the target tracking status is determined, and the tracking strategy is dynamically adjusted. When tracking is successful, the prediction accuracy is optimized, and when tracking fails, the tracking is reset in time. This solves the tracking drift problem caused by changes in the appearance of the target or partial occlusion, and improves the accuracy and stability of target tracking in complex environments.
[0106] S4, the first of the targets The overlap between the location information in the frame and the predicted location information is calculated, and the overlap is evaluated in conjunction with the overlap threshold, while counting is performed synchronously.
[0107] Step S4 in this embodiment of the invention further includes:
[0108] The first of the targets The overlap between the location information in the frame and the predicted location information is calculated, and the formula for calculating the overlap is as follows:
[0109]
[0110] in, The degree of overlap, For the target of Frame position information, For the target of Frame prediction location information.
[0111] The overlap is compared with a preset overlap threshold (e.g., 0.8), and a counter is used to count synchronously. If the overlap is greater than the overlap threshold, the count is reset to zero, the predicted position information of the target is recorded, and the KCF tracker is updated, proceeding to S5; otherwise, it is determined whether the count has reached 5. If it has, the count is reset to zero, and the process returns to S2; if it has not, the process proceeds to S5.
[0112] Specifically, the KCF tracker is updated dynamically using a weighted fusion update mechanism. This weighted fusion update mechanism is applied to the first... The frequency domain values of the high-dimensional weights of the KCF tracker in the frame and the frequency domain values of the predicted position information are calculated to obtain the first... The frequency domain values of the high-dimensional weights and the frequency domain values of the predicted location information of the KCF tracker are expressed as follows:
[0113]
[0114]
[0115] in, , The first Frame and the The frequency domain value of the high-dimensional weights mentioned in the frame. , The first Frame and the The frequency domain value of the predicted location information in the frame; , The first The frequency domain values of the high-dimensional weights and the predicted location information; To update the weighting factors.
[0116] The overlap evaluation mechanism calculates the target tracking status by combining the target's location information and predicted location information, thus solving the error accumulation problem caused by a single algorithm. At the same time, the weighted fusion update mechanism effectively enhances the adaptability to changes in the target's appearance and the resistance to environmental interference, thereby improving the robustness of target tracking.
[0117] S5. If the current frame number is equal to the total number of frames of the difference image, calculate the river surface velocity based on all the recorded predicted location information and output the result; otherwise, return to S3 to calculate the next frame.
[0118] Step S5 in this embodiment of the invention further includes:
[0119] The current frame is detected. If the current frame is the last frame of the video data, the river surface flow velocity is calculated based on all the recorded predicted location information. Otherwise, the process returns to S3 to calculate the next frame.
[0120] Specifically, the calculation of the river surface velocity includes: through the target at the first Frame and the The predicted position information of the frame is used to obtain the target displacement distance. Its expression is:
[0121]
[0122] in, , The target is respectively in the first Frame and the In the frame Pixel coordinates in direction , The target is respectively in the first Frame and the In the frame Pixel coordinates in the direction.
[0123] Using the target displacement distance The target is obtained by performing the following calculation using the formula at the [number]th [time]. frame Instantaneous velocity magnitude and direction within:
[0124]
[0125] in, Indicates that the target is in the first Inter-frame motion speed, Indicates the first Inter-frame time interval, Indicates the direction and angle of the target's movement;
[0126] The instantaneous velocity magnitude and direction of the target over multiple time periods are calculated, and the average velocity of the target is obtained by averaging, as shown in the following formula:
[0127]
[0128] in, The average flow velocity, To effectively track the number of frames;
[0129] By converting the predicted location information to the displacement distance and calculating the statistical average, a precise mapping from image location sequence to water flow velocity is achieved, providing accurate and reliable flow velocity measurement results for water area monitoring.
[0130] This invention acquires video data of the water surface, performs frame averaging and difference calculation to obtain a difference image, uses YOLOv5 to detect the location information of targets in the difference image, initializes a KCF tracker, and then uses the KCF tracker to track the targets, obtaining the predicted location information of the targets in multiple frames, and calculating the flow velocity. This method is applicable to various hydrological environments, has high generalization and robustness, and can maintain accurate detection and stable tracking of floating objects even in complex hydrological environments, achieving high-accuracy water surface flow velocity measurement.
[0131] The flow velocity measurement system based on dynamically updated KCF provided by the present invention will be described below. The flow velocity measurement system based on dynamically updated KCF described below and the flow velocity measurement method based on dynamically updated KCF described above can be compared and referenced with each other.
[0132] Please seefigure 2 As shown, it includes: a video processing module 21, an object detection module 22, a tracking training module 23, an object tracking module 24, a calculation and evaluation module 25, and a calculation and output module 26, wherein:
[0133] The video processing module is used to acquire video data and perform preprocessing to obtain difference images;
[0134] The target detection module is used to perform target detection on the difference image using a target detector to obtain the target's location information;
[0135] A training module for initializing the KCF tracker;
[0136] The target tracking module is used to track the target using the KCF tracker and obtain the predicted location information of the target.
[0137] The calculation and evaluation module is used to evaluate the accuracy of the predicted location information of the target and record the predicted location information of the target that has passed the evaluation.
[0138] The calculation output module is used to calculate the flow velocity from all the recorded predicted location information and output the result.
[0139] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the present invention.
Claims
1. A flow velocity measurement method based on dynamically updated KCF, characterized in that, Includes the following steps: S1. Acquire video data, preprocess the video data, and obtain a difference image; S2. Target detection is performed on the difference image using a target detector to obtain the position information of the target in all frames of the difference image. The location information in the frame initializes the KCF tracker; S3. Use the initialized KCF tracker to obtain the target at the... The predicted location information in the frame is evaluated by a preset response value threshold. If the response value is higher than the response value threshold, then proceed to S4. Conversely, proceed to the next frame and use the first... The location information in the frame initializes the KCF tracker, and returns to S2; S4, the first of the targets The overlap between the location information in the frame and the predicted location information is calculated, and the overlap is evaluated in conjunction with the overlap threshold, while counting is performed synchronously. If the overlap degree is greater than the overlap degree threshold, the count is reset to zero, and the first record is made. The predicted location information of the target is framed, the KCF tracker is updated, and the process proceeds to S5; Conversely, it determines whether the count has reached the specified value. If it has, the count is cleared and the process returns to S2; otherwise, it proceeds to S5. S5. If the current frame number is equal to the total number of frames of the difference image, calculate the river surface velocity based on all the recorded predicted location information and output the result; otherwise, return to S3 to calculate the next frame.
2. The flow velocity measurement method based on dynamically updated KCF according to claim 1, characterized in that, Step S1 further includes: preprocessing the video data, including: The average pixel value of all frames of the video data is calculated to obtain an average frame image; the difference between the video data and the average frame image is calculated pixel by pixel to obtain the difference image.
3. The flow velocity measurement method based on dynamically updated KCF according to claim 1, characterized in that, Step S2 further includes: initializing the KCF tracker, including: based on the target's first... Based on the location information provided in the frame, establish the objective function: ; in, Let the objective function be... For the target in the first In the frame Pixel coordinates in direction Let be the weight vector to be learned. For the The conjugate transpose of ; The objective function is calculated using the least squares method: ; in, For the target in the first In the frame Pixel coordinates in direction For regularization terms, For regularization parameters, For the first frame; Solve for the weight vector in the frequency domain: ; in, , The target is respectively in the first Frequency domain value of frame position information for Complex conjugate; Introducing the Gaussian kernel function ,make Then we have: ; in, The kernel matrix represents the kernel space. For the The conjugate transpose of the matrix. It is the identity matrix. For high-dimensional weights; The KCF tracker is initialized by solving for the frequency domain values of the high-dimensional weights, as shown in the following formula: ; in, The frequency domain value of the high-dimensional weight. This is the Fourier transform of the first row of the kernel matrix.
4. The flow velocity measurement method based on dynamically updated KCF according to claim 3, characterized in that, Step S3 further includes: using the initialized KCF tracker to obtain the target at the... The predicted location information in the frame is evaluated by assessing the response value of the predicted location information using a preset response value threshold, including: Through the target The location information in the frame and the KCF tracker in the first... The frame tracking results are used to construct a similarity kernel matrix. The frequency domain value of the response value is then obtained using the frequency domain expression formula of the response value, as follows: ; in, The frequency domain value of the response value. This is the first row of the similarity kernel matrix; Perform a Fourier transform on the frequency domain value of the response value to obtain the peak value of the response value, and define the tracking result corresponding to the peak value of the response value as the target's [number]. Frame prediction location information.
5. The flow velocity measurement method based on dynamically updated KCF according to claim 1, characterized in that, Step S4 further includes: the overlap calculation includes: obtaining the first overlap using the following formula The degree of overlap between the frame's location information and the predicted location information: ; in, The degree of overlap, For the target of The location information described in the frame, For the target of The frame contains the predicted location information.
6. The flow velocity measurement method based on dynamically updated KCF according to claim 3, characterized in that, Step S4 further includes: if the overlap degree is greater than the overlap degree threshold, then the count is reset to zero, the predicted location information of the target is recorded, and updating the KCF tracker includes updating the KCF tracker using a weighted fusion update mechanism, wherein the weighted fusion update mechanism includes: Use the following formula to calculate the first... The frequency domain values of the high-dimensional weights of the KCF tracker in the frame and the frequency domain values of the predicted position information are calculated to obtain the first... The frequency domain values of the high-dimensional weights of the KCF tracker and the frequency domain values of the predicted location information are shown in the frame. ; ; in, , The first Frame and the The frequency domain value of the high-dimensional weights mentioned in the frame. , The first Frame and the The frequency domain value of the predicted location information in the frame; , The first The frequency domain values of the high-dimensional weights and the predicted location information; To update the weighting factors.
7. The flow velocity measurement method based on dynamically updated KCF according to claim 1, characterized in that, Step S4 further includes: using a counter to count, wherein the specified value is set to 5.
8. The flow velocity measurement method based on dynamically updated KCF according to claim 1, characterized in that, Step S5 further includes: the calculation of the river surface velocity includes: Through the aforementioned objective in the frame and the The predicted position information of the frame is used to obtain the target displacement distance. Its expression is: ; in, , The target is respectively in the first Frame and the In the frame Pixel coordinates in direction , The target is respectively in the first Frame and the In the frame Pixel coordinates in the direction; Using the target displacement distance The target is obtained by performing the following calculation using the formula at the [number]th [time]. frame Instantaneous velocity magnitude and direction within: ; in, Indicates that the target is in the first Inter-frame motion speed, Indicates the first Inter-frame time interval, This indicates the direction and angle of the target's movement.
9. The flow velocity measurement method based on dynamically updated KCF according to claim 8, characterized in that, Step S5 further includes: calculating the instantaneous velocity magnitude and direction of the target over multiple time periods, averaging the results to obtain the average flow velocity of the target, as shown in the following formula: ; in, The average flow velocity, To effectively track the number of frames.
10. A flow velocity measurement system based on dynamically updated KCF as described in claim 1, characterized in that, Includes the following modules: The video processing module is used to acquire video data and perform preprocessing to obtain difference images; The target detection module is used to perform target detection on the difference image using a target detector to obtain the target's location information; A training module for initializing the KCF tracker; The target tracking module is used to track the target using the KCF tracker and obtain the predicted location information of the target. The calculation and evaluation module is used to evaluate the accuracy of the predicted location information of the target and record the predicted location information of the target that has passed the evaluation. The calculation output module is used to calculate the flow velocity from all the recorded predicted location information and output the result.
Citation Information
Patent Citations
Electric power business hall passenger flow statistics method and system based on target dynamic tracking
CN111062967A
Target tracking method based on YOLOv3 and improved KCF
CN112184770A
Pan-tilt target tracking system and method based on multi-feature filter fusion
CN115631216A
Target tracking method and system based on artificial intelligence
CN116385498A