Dynamic target tracking and ranging method and system based on fusion matching
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG BOCHENG ROBOT TECH CO LTD
- Filing Date
- 2025-08-22
- Publication Date
- 2026-06-26
AI Technical Summary
In dynamic environments, robot target ranging faces increased challenges, sensor data becomes unstable due to motion, target motion characteristics are complex, and occlusion and loss severely affect the accuracy and continuity of ranging.
A YOLOv8 target detection model with self-attention enhancement, combined with Kalman filtering and Hungarian algorithm, is used to collect video image data from a camera, detect and track targets in real time, predict the target position using Kalman filtering, and match the target estimated box using Hungarian algorithm. Finally, the model is converted into robot world coordinate system for distance measurement by combining camera intrinsic and extrinsic parameters.
It improves the accuracy of target detection and continuous tracking capability in complex environments, reduces the probability of false matching, and realizes high-precision target positioning and ranging in dynamic environments.
Smart Images

Figure CN121147249B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target tracking and recognition technology, and specifically to a dynamic target tracking and ranging method and system based on fusion matching. Background Technology
[0002] In robot target ranging technology, traditional ranging methods have made significant progress in ranging static targets. Advances in image processing and LiDAR technology have greatly improved the accuracy and precision of ranging in static scenes. Path planning, obstacle avoidance, and navigation are achieved by acquiring distance information between the target and the robot. However, most real-world applications are not static; robots often operate in dynamic environments, facing complex ranging challenges.
[0003] Existing technologies have the following shortcomings: In real-world applications, robots are typically in motion, and the dynamic changes in both the target and the background significantly increase the difficulty of ranging. During robot movement, sensors are easily affected by their own motion, resulting in jitter and noise, leading to instability and interference in the collected data. Furthermore, the target's motion characteristics make data changes more complex, making it difficult not only to capture the target's true spatial position but also causing occlusion and partial loss, severely impacting the accuracy and continuity of ranging.
[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a dynamic target tracking and ranging method and system based on fusion matching to solve the problems in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a dynamic target tracking and ranging method based on fusion matching, specifically including:
[0007] The video image data of the target under test is acquired in real time by a camera and preprocessed.
[0008] A self-attention-enhanced YOLOv8 object detection model is constructed to extract the category, location, and depth information of the target object and then detect the target object.
[0009] Kalman filtering is used to predict the target bounding box of the next frame of video image data, update the target detection box, and locate the position of the target to be detected;
[0010] At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested;
[0011] Based on the coordinates of the target within the tracking box sequence and the camera's intrinsic and extrinsic parameters, the coordinates of the target are converted to coordinates in the robot world coordinate system.
[0012] Calculate the distance to the target based on the coordinates in the robot's world coordinate system;
[0013] Preferably, as a preferred embodiment of the dynamic target tracking and ranging method based on fusion matching described in this invention, wherein:
[0014] The preprocessing specifically includes real-time acquisition of video image data of the target to be tested, conversion to RGB format, and enhancement of video image data quality through image mean filtering algorithm and histogram equalization algorithm, thereby achieving noise reduction of video image data and improvement of target clarity.
[0015] Preferably, as a preferred embodiment of the dynamic target tracking and ranging method based on fusion matching described in this invention, wherein:
[0016] CSPDarkNet was selected as the backbone feature extraction network. After the intermediate layer extracted the features of the target to be tested, a self-attention module was inserted at the C3 intermediate layer position.
[0017] The target feature map output from this layer is reshaped into a two-dimensional matrix;
[0018] Generate query vector, key vector, and value vector through linear transformation;
[0019] The attention score matrix is obtained by calculating the dot product of the query vector and the key vector, and then normalized by dividing by the scaling factor and using the softmax function.
[0020] The normalized attention weights are multiplied by the value vector to obtain the weighted features of each target location, forming a multi-head attention output;
[0021] The multi-head attention outputs are concatenated and matched with the original feature channel number through linear mapping to restore the original feature dimension.
[0022] The multi-head attention output is added to the original input feature map to form the fused feature of the target to be tested;
[0023] The fused features of the target to be tested are uploaded to the PANet structure step by step for multi-scale feature fusion, thereby improving the ability to express targets of different sizes.
[0024] After the detection head is decoupled, the fused features of the target to be tested are input into the classification branch and the regression branch;
[0025] The classification branch outputs the target category probability, and the regression branch outputs the target location parameters;
[0026] The regression branch is used to predict the offset and size of the target position;
[0027] Optimization was performed using DFL and CIOU loss functions;
[0028] The classification branch is used to optimize the category prediction of the target object through cross-entropy loss;
[0029] Based on the category, location, and depth information of the target, the detection bounding box of the target is calculated by combining the location offset and scale.
[0030] Preferably, as a preferred embodiment of the dynamic target tracking and ranging method based on fusion matching described in this invention, wherein:
[0031] The state vector of the target object is initialized based on the YOLOv8 object detection model, and the center coordinates, aspect ratio, height, and velocity components of the target detection box are used to construct an 8-dimensional state vector, specifically represented as follows: ;
[0032] Initialize the covariance matrix corresponding to the state vector of the target to be measured as a diagonal matrix;
[0033] For each target to be measured, the state estimate of the next frame is predicted by the state transition matrix based on the state vector and covariance matrix of the previous frame.
[0034] Extract the center coordinates, aspect ratio, and height of the detection box of the current target to be measured, and define them as the detection box observation values;
[0035] The state space is mapped to the observation space through the mapping relationship between the corresponding state vector and the observation;
[0036] Calculate the Kalman gain, and update the target state and covariance matrix;
[0037] The calculation of the Kalman gain involves calculating the velocity amplitude of the target in each frame based on the velocity components of the target detection box. Using the standard Kalman gain as a benchmark, the gain is adjusted based on the motion state of different targets. The specific formula is as follows:
[0038] ;
[0039] in, Indicates Kalman gain, Indicates the standard Kalman gain. This indicates gain adjustment based on velocity amplitude;
[0040] When the target to be tested moves rapidly As the gain approaches zero, the Kalman filter response becomes faster, allowing it to capture changes in the target's motion quickly. When the target moves slowly or remains stationary... The gain tends to be low as it approaches 1, reducing the Kalman filter's excessive response to detection noise or micro-motions and maintaining filter stability.
[0041] By combining the center, aspect ratio, and height of the corrected state vector, the bounding box position of the detection box of the target to be measured is calculated, and the target estimation box at the current time is obtained.
[0042] Repeat the prediction-update-calculation process described above, continuously track each target to be tested, and use the latest target estimation box as the input for the next prediction to complete the continuous localization of the target to be tested.
[0043] Preferably, as a preferred embodiment of the dynamic target tracking and ranging method based on fusion matching described in this invention, wherein:
[0044] For each target to be tested and the predicted target estimation box mentioned above, calculate the matching cost and construct an N×M cost matrix;
[0045] N represents the number of targets to be measured, and M represents the number of target estimation boxes;
[0046] Subtract the minimum value of each row and column from the elements of each row and column of the cost matrix;
[0047] Cover all zeros in the matrix with the fewest possible horizontal and vertical lines;
[0048] When all lines equal the matrix dimension, it means that the optimal match has been found;
[0049] If all lines are not equal to the matrix dimension, find and subtract the minimum value among the uncovered elements, and add it to the element covered by two lines to create a new zero. Iterate the above steps until the optimal match is found.
[0050] Each target to be tested corresponds to only one detection box, minimizing the total matching cost;
[0051] For all successfully matched targets, obtain the actual observation value from the current target detection box and update the position of the target.
[0052] If the target being tested does not match any detection box, it means that the target being tested is occluded, the detection failed, or it has left the screen, and it is marked as "not tracked" or "inactive".
[0053] Based on the markers of the target object, output a sequence of tracking boxes.
[0054] Preferably, as a preferred embodiment of the dynamic target tracking and ranging system based on fusion matching described in this invention, it specifically includes: an acquisition and processing module, a target detection module, a target tracking module, a target matching module, a coordinate transformation module, and a coordinate ranging module;
[0055] Acquisition and processing module: Acquires video image data of the target in real time through the camera and performs preprocessing;
[0056] Object detection module: Constructs a self-attention-enhanced YOLOv8 object detection model, extracts the category, location, and depth information of the target object, and performs the detection of the target object;
[0057] The target tracking module uses Kalman filtering to predict the target bounding box for the next frame of the video image data, updates the target detection box, and locates the position of the target to be detected.
[0058] Target matching module: At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested;
[0059] Coordinate transformation module: Based on the coordinates of the target within the tracking box sequence and the camera's intrinsic and extrinsic parameters, the coordinates of the target are transformed into coordinates in the robot world coordinate system.
[0060] Coordinate ranging module: Calculates the distance to the target based on the coordinates in the robot's world coordinate system.
[0061] On the other hand, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements the steps of the dynamic target tracking and ranging method based on fusion matching as described above.
[0062] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements the steps of the dynamic target tracking and ranging method based on fusion matching as described above in the present invention.
[0063] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0064] By employing the YOLOv8 model and introducing a self-attention mechanism, more accurate features can be extracted and fused at different scales, solving the accuracy problem of traditional methods when detecting small targets or targets with complex backgrounds. Adaptive adjustment of the state vector and covariance matrix using a Kalman filter effectively handles both fast and slow target motion, overcoming the bottleneck of traditional target tracking methods' inability to stably handle fast or slow dynamic targets. The Hungarian algorithm, combining precise matching of target prediction boxes and detection boxes, reduces the probability of false matches and ensures higher tracking accuracy in complex environments. Based on the camera's intrinsic and extrinsic parameters, the target is transformed from the pixel coordinate system to the world coordinate system, enabling accurate target localization and ranging, solving the problem of inaccurate target distance calculation in real-time dynamic environments using traditional methods. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0066] Figure 1 This is a flowchart of the dynamic target tracking and ranging method based on fusion matching according to the present invention.
[0067] Figure 2 This is a system structure block diagram of the dynamic target tracking and ranging system based on fusion matching according to the present invention.
[0068] Table 1 is the construction cost matrix of the dynamic target tracking and ranging method based on fusion matching of the present invention. Detailed Implementation
[0069] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of this disclosure will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art.
[0070] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a dynamic target tracking and ranging method based on fusion matching, specifically including:
[0071] S1. Real-time acquisition and preprocessing of video image data of the target under test via camera;
[0072] The preprocessing specifically includes real-time acquisition of video image data of the target to be tested, conversion to RGB format, and enhancement of video image data quality through image mean filtering algorithm and histogram equalization algorithm, thereby achieving noise reduction of video image data and improvement of target clarity.
[0073] It should also be noted that, based on the purpose of this invention, the preprocessing flow of the image mean filtering algorithm and histogram equalization algorithm is used to improve the video image data of the robot in complex and severe weather, which is beneficial for the YOLOv8 detection model to extract target features, such as the problem of reflection and whitening in images captured by the camera under strong sunlight and heavy snow conditions.
[0074] It should also be noted that the image mean filtering algorithm reduces local extreme value fluctuations, smooths reflective areas, and reduces local overexposure areas caused by strong light. The histogram equalization algorithm enhances the contrast of video image data, improves details in dark areas, and suppresses whitening in overexposed areas.
[0075] S2. Construct a self-attention-enhanced YOLOv8 object detection model, extract the category, location, and depth information of the target to be tested, and perform the detection of the target to be tested;
[0076] CSPDarkNet was selected as the backbone feature extraction network. After the intermediate layer extracted the features of the target to be tested, a self-attention module was inserted at the C3 intermediate layer position.
[0077] The target feature map output from this layer is reshaped into a two-dimensional matrix;
[0078] Generate query vector, key vector, and value vector through linear transformation;
[0079] The attention score matrix is obtained by calculating the dot product of the query vector and the key vector, and then normalized by dividing by the scaling factor and using the softmax function.
[0080] The normalized attention weights are multiplied by the value vector to obtain the weighted features of each target location, forming a multi-head attention output;
[0081] The multi-head attention outputs are concatenated and matched with the original feature channel number through linear mapping to restore the original feature dimension.
[0082] The multi-head attention output is added to the original input feature map to form the fused feature of the target to be tested;
[0083] The fused features of the target to be tested are uploaded to the PANet structure step by step for multi-scale feature fusion, thereby improving the ability to express targets of different sizes.
[0084] After the detection head is decoupled, the fused features of the target to be tested are input into the classification branch and the regression branch;
[0085] The classification branch outputs the target category probability, and the regression branch outputs the target location parameters;
[0086] The regression branch is used to predict the offset and size of the target position;
[0087] Optimization was performed using DFL and CIOU loss functions;
[0088] The classification branch is used to optimize the category prediction of the target object through cross-entropy loss;
[0089] Based on the category, location, and depth information of the target, the detection bounding box of the target is calculated by combining the location offset and scale.
[0090] It should also be noted that the features output by the C3 intermediate layer have high semantic richness and spatial detail, and the insertion of the self-attention mechanism can improve the detection performance of small targets or targets with large scale changes.
[0091] It should also be noted that the spatial dimension of the feature map is reshaped into a two-dimensional matrix, a multi-head mechanism is implemented to capture feature relationships at different scales or angles in parallel, and positional encoding is added to enhance the expression of spatial information.
[0092] It should also be noted that PANet is responsible for multi-scale feature fusion, adding features enhanced by self-attention to alleviate the differences in feature representation of targets at different scales and improve the detection capability of multi-scale targets;
[0093] It should also be noted that the multi-head attention output uses 8 heads, each with a feature dimension of 64; furthermore, the classification and regression tasks are implemented using a two-branch structure to avoid interference between different target tasks.
[0094] S3. Use Kalman filtering to predict the target estimation box for the next frame of the video image data, update the target detection box, and locate the position of the target to be tested;
[0095] The state vector of the target object is initialized based on the YOLOv8 object detection model, and the center coordinates, aspect ratio, height, and velocity components of the target detection box are used to construct an 8-dimensional state vector, specifically represented as follows: ;
[0096] Initialize the covariance matrix corresponding to the state vector of the target to be measured as a diagonal matrix;
[0097] For each target to be measured, the state estimate of the next frame is predicted by the state transition matrix based on the state vector and covariance matrix of the previous frame.
[0098] Extract the center coordinates, aspect ratio, and height of the detection box of the current target to be measured, and define them as the detection box observation values;
[0099] The state space is mapped to the observation space through the mapping relationship between the corresponding state vector and the observation;
[0100] Calculate the Kalman gain, and update the target state and covariance matrix;
[0101] The calculation of the Kalman gain involves calculating the velocity amplitude of the target in each frame based on the velocity components of the target detection box. Using the standard Kalman gain as a benchmark, the gain is adjusted based on the motion state of different targets. The specific formula is as follows:
[0102] ;
[0103] in, Indicates Kalman gain, Indicates the standard Kalman gain. This indicates gain adjustment based on velocity amplitude;
[0104] It should also be noted that when the target being tested moves rapidly, As the gain approaches zero, the Kalman filter response becomes faster, allowing it to capture changes in the target's motion quickly. When the target moves slowly or remains stationary... The gain tends to be low as it approaches 1, reducing the Kalman filter's excessive response to detection noise or micro-motions and maintaining filter stability.
[0105] By combining the center, aspect ratio, and height of the corrected state vector, the bounding box position of the detection box of the target to be measured is calculated, and the target estimation box at the current time is obtained.
[0106] Repeat the prediction-update-calculation process described above, continuously track each target to be tested, and use the latest target estimation box as the input for the next prediction to complete the continuous localization of the target to be tested.
[0107] S4. At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested.
[0108] For each target to be tested and the predicted target estimation box mentioned above, calculate the matching cost and construct an N×M cost matrix;
[0109] N represents the number of targets to be measured, and M represents the number of target estimation boxes;
[0110] Subtract the minimum value of each row and column from the elements of each row and column of the cost matrix;
[0111] Cover all zeros in the matrix with the fewest possible horizontal and vertical lines;
[0112] When all lines equal the matrix dimension, it means that the optimal match has been found;
[0113] If all lines are not equal to the matrix dimension, find and subtract the minimum value among the uncovered elements, and add it to the element covered by two lines to create a new zero. Iterate the above steps until the optimal match is found.
[0114] Each target to be tested corresponds to only one detection box, minimizing the total matching cost;
[0115] For all successfully matched targets, obtain the actual observation value from the current target detection box and update the position of the target.
[0116] If the target being tested does not match any detection box, it means that the target being tested is occluded, the detection failed, or it has left the screen, and it is marked as "not tracked" or "inactive".
[0117] Output a sequence of tracking boxes based on the markings of the target object;
[0118] S5. Based on the coordinates of the target within the tracking box sequence and the intrinsic and extrinsic parameters of the camera, convert the coordinates of the target into coordinates in the robot world coordinate system.
[0119] S6. Calculate the distance to the target based on the coordinates in the robot's world coordinate system;
[0120] Reference Figure 2 This embodiment also provides a dynamic target tracking and ranging system based on fusion matching, which specifically includes: an acquisition and processing module, a target detection module, a target tracking module, a target matching module, a coordinate transformation module, and a coordinate ranging module;
[0121] Acquisition and processing module: Acquires video image data of the target in real time through the camera and performs preprocessing;
[0122] Object detection module: Constructs a self-attention-enhanced YOLOv8 object detection model, extracts the category, location, and depth information of the target object, and performs the detection of the target object;
[0123] The target tracking module uses Kalman filtering to predict the target bounding box for the next frame of the video image data, updates the target detection box, and locates the position of the target to be detected.
[0124] Target matching module: At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested;
[0125] Coordinate transformation module: Based on the coordinates of the target within the tracking box sequence and the camera's intrinsic and extrinsic parameters, the coordinates of the target are transformed into coordinates in the robot world coordinate system.
[0126] Coordinate ranging module: Calculates the distance to the target based on the coordinates in the robot's world coordinate system.
[0127] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0128] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the steps of implementing the dynamic target tracking and ranging method based on fusion matching as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0129] Example 2
[0130] The following is another embodiment of the present invention, which provides a dynamic target tracking and ranging method based on fusion matching. In order to verify the beneficial effects of the present invention, a simulation experiment is conducted for scientific demonstration.
[0131] I. Experimental Environment
[0132] Location: A monitoring area in an industrial park, approximately 200 meters by 150 meters, with a complex background containing various moving targets, including personnel, vehicles, and machinery.
[0133] Time period: June 12, 2025, continuous monitoring for 24 hours.
[0134] The equipment parameters are: 3 high-definition RGB cameras, resolution 1920×1080, frame rate 30FPS.
[0135] The experimental procedure and specific data include:
[0136] Total number of video image data frames: 2,592,000 frames (3 cameras × 30 FPS × 24 hours × 3600 seconds);
[0137] After preprocessing, the clarity of the target outline is improved by about 40%, and the detection accuracy is improved by 15% in strong light environments.
[0138] Total number of detected targets: an average of 105 targets were detected per frame across the cross-section; the average accuracy for the target category "personnel" reached 96.8%; and the average accuracy for the target category "vehicles" reached 94.5%.
[0139] The accuracy rate for detecting targets smaller than medium size improved by 20%, with a false positive rate of 0.8% and a false negative rate of 1.2%.
[0140] A truck was detected in the first second, and the bounding box parameters were as follows:
[0141] Location: Top left corner (540, 300);
[0142] Width and height: (120, 60);
[0143] Depth information: 4.5 meters;
[0144] The temporary state vector is constructed as: X=[540,300,120,60,0.0,0.0,0.0,0.0].
[0145] Over 10 consecutive frames, the target's position changes as follows: [(540,300, 4.5), (545,305, 5), (550,310, 5.5), (555,315, 6), (560,320, 6.5)], with the velocity classified as follows: , , ;
[0146] The gain adjustment based on the speed amplitude is reduced from 0.5 to 0.05 when the truck is accelerating. Under rapid movement, the filter response is improved to a 95% correct tracking rate.
[0147] When stationary or in slow motion (speed < 1 pixel / frame), the filtering response is smooth, and the error is reduced to 0.02 pixels;
[0148] The repeated prediction-update-calculation process continuously tracks each target and uses the latest target estimation box as input for the next prediction, thus completing the continuous localization of the target.
[0149] For each target to be tested, the cost matrix is constructed as follows:
[0150] Target estimation box 1 Target estimation box 2 Target estimation box 3 Detection target A 10.2 25.4 50.3 Detection target B 12.1 22.6 49.5 Detection target C 40.0 35.2 15.4
[0151] Table 1
[0152] After minimizing the total matching cost, the optimal matching result is:
[0153] Target A matches and detects Target 1;
[0154] Target B matches and detects Target 2;
[0155] Target C matches and detects target 3;
[0156] The false match rate is less than 2%, and the probability of target loss is reduced to 3% under occlusion.
[0157] The equipment's internal parameter is focal length. Its principal point is (960, 540), and its depth information is 4.5 meters;
[0158] According to the transformation formula, the position of the target in the camera coordinate system is (−1.935m, −0.63m, 4.5m);
[0159] The distance to the target was calculated to be 4.84m based on the coordinates in the robot's world coordinate system, with an actual distance measurement error of <0.2m.
[0160] Through this verification experiment, the system achieved high-precision target detection (accuracy of over 96%), continuous tracking (success rate of 97%), and real-time ranging (average error <0.2 meters) in complex environments.
[0161] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A dynamic target tracking and ranging method based on fusion matching, characterized in that, Specifically, it includes: The video image data of the target under test is acquired in real time by a camera and preprocessed. A self-attention-enhanced YOLOv8 object detection model is constructed to extract the category, location, and depth information of the target and to detect the target. Kalman filtering is used to predict the target bounding box of the next frame of video image data, update the target detection box, and locate the position of the target to be detected; The method of predicting the target estimation box for the next frame of video image data using Kalman filtering specifically includes: initializing the state vector of the target to be detected based on the YOLOv8 target detection model, and constructing an 8-dimensional state vector from the center coordinates, aspect ratio, height, and velocity components of the target detection box, specifically represented as follows: ; Initialize the covariance matrix corresponding to the state vector of the target to be measured as a diagonal matrix; For each target to be measured, the state estimate of the next frame is predicted by the state transition matrix based on the state vector and covariance matrix of the previous frame. Extract the center coordinates, aspect ratio, and height of the detection box of the current target to be measured, and define them as the detection box observation values; The state space is mapped to the observation space through the mapping relationship between the corresponding state vector and the observation; Calculate the Kalman gain, and update the target state and covariance matrix; By combining the center, aspect ratio, and height of the corrected state vector, the bounding box position of the detection box of the target to be measured is calculated, and the target estimation box at the current time is obtained. Repeat the above prediction-update-calculation process to continuously track each target and use the latest target estimation box as the input for the next prediction, thus completing the continuous localization of the target. The calculation of the Kalman gain involves calculating the velocity amplitude of the target in each frame based on the velocity components of the target detection box. Using the standard Kalman gain as a benchmark, the gain is adjusted based on the motion state of different targets. The specific formula is as follows: ; in, Indicates Kalman gain, Indicates the standard Kalman gain. This indicates gain adjustment based on velocity amplitude; At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested; Based on the coordinates of the target within the tracking box sequence and the camera's intrinsic and extrinsic parameters, the target's coordinates are converted to coordinates in the robot world coordinate system. Calculate the distance to the target based on its coordinates in the robot's world coordinate system.
2. The dynamic target tracking and ranging method based on fusion matching according to claim 1, characterized in that: The construction of the self-attention enhanced YOLOv8 object detection model specifically includes, CSPDarkNet was selected as the backbone feature extraction network. After the intermediate layer extracted the features of the target to be tested, a self-attention module was inserted at the C3 intermediate layer position. The target feature map output from this layer is reshaped into a two-dimensional matrix; Generate query vector, key vector, and value vector through linear transformation; The attention score matrix is obtained by calculating the dot product of the query vector and the key vector, and then normalized by dividing by the scaling factor and using the softmax function. The normalized attention weights are multiplied by the value vector to obtain the weighted features of each target location, forming a multi-head attention output; The multi-head attention outputs are concatenated and matched with the original feature channel number through linear mapping to restore the original feature dimension. The multi-head attention output is added to the original input feature map to form the fused feature of the target to be tested; The fused features of the target to be tested are uploaded to the PANet structure step by step for multi-scale feature fusion, thereby improving the ability to express targets of different sizes. After the detection head is decoupled, the fused features of the target to be tested are input into the classification branch and the regression branch; Based on the category, location, and depth information of the target, the detection bounding box of the target is calculated by combining the location offset and scale.
3. The dynamic target tracking and ranging method based on fusion matching according to claim 2, characterized in that: The step of inputting the fused features of the target to be tested into the classification branch and the regression branch specifically includes, The classification branch outputs the target category probability, and the regression branch outputs the target location parameters; The regression branch is used to predict the offset and size of the target position; The classification branch is used to optimize the category prediction of the target object through cross-entropy loss.
4. The dynamic target tracking and ranging method based on fusion matching according to claim 1, characterized in that: The step of matching the predicted target bounding box with the current target detection box using the Hungarian algorithm specifically includes: For each target to be tested and the predicted target estimation box mentioned above, calculate the matching cost and construct an N×M cost matrix; Subtract the minimum value of each row and column from the elements of each row and column of the cost matrix; Cover all zeros in the matrix with the fewest possible horizontal and vertical lines; When all lines equal the matrix dimension, it means that the optimal match has been found; If all lines are not equal to the matrix dimension, find and subtract the minimum value among the uncovered elements, and add it to the element covered by two lines to create a new zero. Iterate the above steps until the optimal match is found. Each target to be tested corresponds to only one detection box, minimizing the total matching cost; For all successfully matched targets, obtain the actual observation value from the current target detection box and update the position of the target. Based on the markers of the target object, output a sequence of tracking boxes.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the dynamic target tracking and ranging method based on fusion matching as described in any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the dynamic target tracking and ranging method based on fusion matching as described in any one of claims 1 to 4.
7. A dynamic target tracking and ranging system based on fusion matching is applied to the dynamic target tracking and ranging method based on fusion matching as described in any one of claims 1-4, characterized in that: Specifically, it includes: Acquisition and processing module: Acquires video image data of the target in real time through the camera and performs preprocessing; Object detection module: Constructs a self-attention-enhanced YOLOv8 object detection model, extracts the category, location, and depth information of the target object, and performs the detection of the target object; The target tracking module uses Kalman filtering to predict the target bounding box for the next frame of the video image data, updates the target detection box, and locates the position of the target to be detected. Target matching module: At each time point, the predicted target bounding box is matched with the current target detection box using the Hungarian algorithm to establish the motion trajectory of the target to be tested; Coordinate transformation module: Based on the coordinates of the target within the tracking box sequence and the camera's intrinsic and extrinsic parameters, the coordinates of the target are transformed into coordinates in the robot world coordinate system. Coordinate ranging module: Calculates the distance to the target based on the coordinates in the robot's world coordinate system.