Target tracking method and device

Through the video data processing method, the object detection model and matching algorithm are used to solve the problem of reduced positioning accuracy in complex environments by contact target tracking technology, and high-precision real-time target tracking is achieved.

CN120451205APending Publication Date: 2025-08-08HEBEI SHUJUN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510451495.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing contact target tracking technology has reduced positioning accuracy in complex environments, especially in metal facilities and signal occlusion, which makes it difficult to meet the real-time tracking needs.

Method used

The video data processing method is adopted, and the preset object detection model and matching algorithm are used to determine the tracking results of the target object through video frame detection, appearance feature extraction and trajectory prediction, avoiding dependence on contact devices.

Benefits of technology

It improves the positioning accuracy of target tracking, meets the real-time tracking needs, and reduces the impact of signal instability on positioning accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451205A_ABST
    Figure CN120451205A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision and deep learning, and particularly provides a target tracking method and device. The method comprises the following steps: acquiring video data of a preset tracking area; adopting a preset target detection model to detect a target in each frame of video data; extracting appearance features of each current target object detected from the current video frame; predicting the track of each historical target object in the previous video frame in a preset time period; and matching the appearance characteristics of the historical target object in the previous video frame, the predicted trajectory, the appearance characteristics of the current target object and the detection frame, and determining the historical target object and the current target object belonging to the same target to obtain a target object tracking result. According to the invention, when the target is tracked in real time, the problem that the positioning precision is reduced due to a contact type target tracking technology is solved, so that the positioning accuracy when the target is tracked in real time is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision and deep learning technologies, and in particular to a target tracking method and device. Background Art

[0002] Multi-target tracking technology is a technique that can simultaneously and continuously monitor the positions of multiple targets. It has widespread application across various fields and industries, including logistics and warehousing, industrial manufacturing, and animal husbandry. For example, in animal husbandry, accurate and real-time tracking of each animal in a group is essential for animal management.

[0003] In these industries and fields, contact devices are often used to track individual targets. Examples include contact devices based on RFID (Radio Frequency Identification) sensors and GPS (Global Positioning System) positioning systems. Specifically, in the livestock industry, each target animal needs to be provided with a contact device such as an ear tag or collar. Combining RFID and GPS technology allows tracking of each target animal's location.

[0004] However, this target tracking technology, which relies on contact devices, has the following problems: Metal structures or other interfering objects in the target's environment can affect the stability of the RFID signal, resulting in data loss or increased errors. In indoor scenarios, GPS sensors suffer from signal obstruction and multipath effects, which can reduce positioning accuracy. Therefore, this target tracking technology, which relies on contact devices, cannot meet real-time tracking requirements and reduces positioning accuracy. Summary of the Invention

[0005] In view of this, the present invention aims to propose a target tracking method to solve the problem of reduced positioning accuracy caused by contact target tracking technology when tracking the target in real time, so as to improve the positioning accuracy when tracking the target in real time.

[0006] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0007] A target tracking method, comprising:

[0008] Get the video data of the preset tracking area;

[0009] Using a preset target detection model, the target in each frame of the video data is detected to extract a detection frame of the target object in each video frame;

[0010] Extracting appearance features of each current target object detected from the current video frame, and extracting appearance features of each historical target object detected from the previous video frame;

[0011] Predicting the trajectory of each of the historical target objects in the previous video frame within a preset time period, where the preset time period is a time period between the moment of the previous video frame and the moment of the current video frame;

[0012] The appearance features and predicted trajectory of the historical target object in the previous video frame are matched with the appearance features and detection frame of the current target object to determine that the historical target object and the current target object belong to the same target, so as to obtain the target object tracking result.

[0013] Furthermore, the loss function of the preset target detection model is a SloU loss function; the architecture of the preset target detection model is obtained through the following process:

[0014] Based on the preset YOLOv11n model, the preset convolution layer in the preset YOLOv11n model is replaced with the LDConv linear variable convolution layer;

[0015] A pyramid fast pooling module SimSPPF is added to the preset YOLOv11n model to obtain the architecture of the preset target detection model.

[0016] Furthermore, the process of extracting appearance features of the target object in the video frame includes:

[0017] The MobileNetV4Small feature extraction network is used as a feature extractor to extract the appearance features of the target objects detected from the video frames.

[0018] Furthermore, predicting the trajectory of each of the historical target objects in the previous video frame within a preset time period includes:

[0019] The trajectory of each historical target object in the previous video frame within a preset time period is predicted by Kalman filtering to obtain a predicted trajectory of each historical target object in the preset time period.

[0020] Furthermore, matching the appearance features and predicted trajectory of the historical target object in the previous video frame with the appearance features and detection frame of the current target object includes:

[0021] Based on the appearance features and predicted trajectory of each of the historical target objects in the previous video frame and the appearance features and detection frame of each of the current target objects in the current video frame, the historical target objects are matched with the current target object by cascade matching and intersection-over-union matching;

[0022] If a match is successful between the historical target object and the current target object, the current target object and the historical target object are determined to be the same target, and a target object tracking result of the target is determined based on the detection frame and the predicted trajectory of the same target.

[0023] In the case where there is a historical target object and / or a current target object that fails to match, the target tracking result of the failed target is determined based on the predicted trajectory of the failed historical target object and / or the detection frame of the failed current target object.

[0024] Further, determining the target tracking result of the target that failed to match based on the predicted trajectory of the historical target object that failed to match and the detection frame of the current target object that failed to match includes:

[0025] For the current target object that fails to match, determine whether the current target object is a new target based on the detection frame of the current target object. If the current target object is a new target, set the initial trajectory of the new target to determine the target tracking result of the new target;

[0026] For a historical target object that fails to match, if the predicted trajectory of the historical target object that fails to match does not belong to the entry state trajectory, deleting the predicted trajectory of the historical target object that fails to match;

[0027] When there is a historical target object whose predicted trajectory belongs to the entry trajectory and a current target object that does not belong to the new entry target, the predicted trajectory of the historical target object that belongs to the entry trajectory is matched with the detection frame of the current target object that does not belong to the new entry target according to a preset matching method to determine the target tracking result.

[0028] Furthermore, judging whether the current target object is a new target based on the detection frame of the current target object includes:

[0029] Determining whether a detection frame of the current target object is located in a preset entrance area, and if the detection frame is located in the preset entrance area, determining that the current target object is a new target;

[0030] The preset entrance area is an area centered at the entrance position in the preset tracking area.

[0031] Furthermore, a method for determining whether the predicted trajectory of the historical target object that failed to match belongs to an entry trajectory includes:

[0032] determining, based on the predicted trajectory of the historical target object, whether the historical target object passes through a first preset position line and a second preset position line within a preset entrance area in the predicted trajectory;

[0033] If the time when the historical target object passes through the first preset position line is earlier than the time when the historical target object passes through the second preset position line, it is determined that the predicted trajectory of the historical target object belongs to the entry state trajectory.

[0034] If the time when the historical target object passes through the first preset position line is later than the time when the historical target object passes through the second preset position line, or if the historical target object does not pass through the first preset position line and / or the second preset position line, determine that the predicted trajectory of the historical target object does not belong to the entry state trajectory;

[0035] The first preset position line is closer to the entrance of the preset tracking area than the second preset position line.

[0036] Furthermore, the preset matching method includes:

[0037] Calculating the intersection-over-union ratio and the Euclidean distance between the predicted trajectory belonging to the entry state trajectory and the detection box that does not belong to the new target;

[0038] A cost matrix is constructed according to the intersection-over-union ratio and the Euclidean distance value, so as to perform matching using the cost matrix.

[0039] Compared with the prior art, the present invention has the following advantages:

[0040] The target tracking method of the present invention performs target detection on each frame of video data in a preset tracking area, extracts the detection frame of each target object, and uses the detection frame of the current video frame to match the predicted trajectory of the previous video frame within a preset time period, thereby determining the historical target objects and the current target object belonging to the same target, and then completing the tracking of the target object. In the present invention, video data is processed in combination with a preset target detection model and a matching algorithm to complete the tracking of the target, without the need to set up a contact device. The contact device is used for target tracking, which is conducive to improving the problem of reduced positioning accuracy caused by the signal instability of the contact device, thereby improving the positioning accuracy of target tracking and meeting real-time tracking requirements.

[0041] Another object of the present invention is to provide a target tracking device, comprising:

[0042] A video data acquisition module is used to acquire video data of a preset tracking area;

[0043] The target detection module is used to detect the target in each frame of the video data using a preset target detection model to extract the detection frame of the target object in each video frame;

[0044] A feature extraction module is used to extract the appearance features of each current target object detected from the current video frame and to extract the appearance features of each historical target object detected from the previous video frame;

[0045] A trajectory prediction module predicts the trajectory of each of the historical target objects in the previous video frame within a preset time period, where the preset time period is the time period between the moment of the previous video frame and the moment of the current video frame;

[0046] The target matching and tracking module is used to match the appearance features and predicted trajectory of the historical target object in the previous video frame with the appearance features and detection frame of the current target object to determine whether the historical target object and the current target object belong to the same target, so as to obtain the target object tracking result.

[0047] The target tracking device of the present invention can perform target detection on each frame of video data through a target detection module, extract the detection frame of each target object, and use the detection frame of the current video frame and the predicted trajectory by the target matching tracking module to match, thereby determining the historical target object and the current target object belonging to the same target, and then completing the tracking of the target object. In the present invention, video data is used and combined with a preset target detection model and a matching algorithm to process the video data to complete the tracking of the target, without the need to set up a contact device or use a contact device for target tracking, which is conducive to improving the problem of reduced positioning accuracy caused by the signal instability of the contact device, so as to improve the positioning accuracy of target tracking and meet the real-time tracking requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0049] Figure 1 A schematic diagram of a target tracking method according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram of a preset tracking area in an embodiment of the present invention;

[0051] Figure 3Schematic diagram of the model architecture of the preset target detection model according to an embodiment of the present invention;

[0052] Figure 4 This is an example diagram of the output results of the preset target detection model according to an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of a matching process for matching a historical target object with a current target object according to an embodiment of the present invention;

[0054] Figure 6 Schematic diagram of a target tracking process for a target object that fails to match according to an embodiment of the present invention;

[0055] Figure 7 This is an example diagram of a preset entrance area in an embodiment of the present invention;

[0056] Figure 8 Schematic diagram of a process for determining whether a predicted trajectory belongs to an entry state trajectory in an embodiment of the present invention;

[0057] Figure 9 Schematic diagram of the overall process of the target tracking method according to an embodiment of the present invention;

[0058] Figure 10 This is a schematic structural diagram of a target tracking device according to an embodiment of the present invention;

[0059] Description of reference numerals:

[0060] 1001. Video data acquisition module; 1002. Target detection module; 1003. Feature extraction module; 1004. Trajectory prediction module; 1005. Target matching and tracking module. DETAILED DESCRIPTION

[0061] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0062] In the description of the present invention, it should be noted that if terms such as "upper," "lower," "inner," and "outer" appear to indicate orientation or positional relationships, these are based on the orientation or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, if terms such as "first" and "second" appear, they are used solely for descriptive purposes and should not be construed as indicating or implying relative importance.

[0063] Furthermore, in the description of the present invention, unless otherwise expressly defined, the terms "mounted," "connected," "connect," and "connector" should be interpreted broadly. For example, they may refer to fixed, removable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. Those skilled in the art will appreciate the specific meanings of these terms in the present invention based on the specific circumstances.

[0064] In addition, in the present invention, although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, it should be understood that these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can also be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed and completed at the same time, but can be executed at different times. At the same time, the order of their execution is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of other sub-steps or stages.

[0065] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0066] Example 1

[0067] This embodiment relates to a target tracking method, which specifically utilizes a preset target detection model to identify targets in video data within a preset tracking area, and processes the identified targets to achieve target tracking, so as to solve the problem of poor positioning accuracy of target tracking methods that rely on contact devices.

[0068] The target tracking technology of this embodiment is applicable to a variety of target tracking applications. For example, the target tracking technology of this embodiment can be used to track individual logistics packages in real time in the logistics and warehousing industry, to track the real-time positioning of individual products in the industrial manufacturing industry, and to track the positioning of individual animals in a herd in the livestock industry.

[0069] For ease of explanation, this embodiment uses the tracking of each cow in a dairy farm as an example. The target is each cow in the dairy farm, and the target tracking method of this embodiment can achieve positioning and tracking of each cow in the dairy farm.

[0070] In conventional cow tracking methods, each cow is fitted with an ear tag or collar, or a contact device is attached to the cow. An RFID sensor then reads the cow's electronic tag to record its location, or a GPS sensor attached to the ear tag or collar locates the cow's location.

[0071] However, the distribution range and signal coverage of RFID readers in related technologies are limited, making it difficult to achieve full coverage in complex cattle barn environments. Furthermore, metal structures or other interfering objects in the environment can affect the stability of RFID signals, resulting in data loss or increased errors. Furthermore, while GPS sensors are suitable for outdoor environments and can provide relatively accurate positioning information, their positioning accuracy in indoor cattle barns is significantly reduced due to signal obstruction and multipath effects, making them unable to meet real-time tracking requirements.

[0072] In addition, ear tags and collars may cause discomfort to cows. For example, ear tags may cause ear inflammation in cows, and collars may restrict cows' daily activities, thereby affecting their health and production efficiency, and even reducing the accuracy and reliability of data.

[0073] In view of this, in order to overcome the shortcomings of the existing multi-target tracking method, combined with Figure 1 As shown, the target tracking method of this embodiment mainly includes the following steps.

[0074] Step S101: Obtain video data of a preset tracking area.

[0075] In step S101, the preset tracking area is the area where the target position needs to be tracked. For example, in the scenario of cow tracking, the position of each cow in the cowshed needs to be tracked. The preset tracking area can be the area covered by the entire cowshed.

[0076] Specifically, the video data can be obtained by a pre-installed camera, and the shooting area of the camera can cover the entire preset tracking area. Figure 2 , assuming the target is a cow, Figure 2 This is the distribution map of the entire cowshed. Taking the eastern half of the cowshed as the preset tracking area as an example, the length of the eastern half of the cowshed (hereinafter referred to as the cowshed) is 50 meters and the width is 15 meters. That is, the camera installation position can be as follows: Figure 2 As shown, the camera's shooting area is Figure 2 The red area in the picture can almost cover the entire cowshed.

[0077] In step S102 , a preset target detection model is used to detect the target in each frame of video data to extract a detection frame of the target object in each video frame.

[0078] In step S102, the video data is composed of a plurality of video frame images. For each video frame in the video data, target detection is performed using the preset target detection model, so as to identify the target object and the detection frame of the target object in each video frame.

[0079] Specifically, the target object is a specific object within the video frame. For example, the target is a cow. In step S102, the cows in the video frame are detected, and cow a1, cow a2, cow a3, ..., and cow an are detected. Cow a1, cow a2, cow a3, etc. are the target objects within the video frame.

[0080] In some embodiments, the preset target detection model can specifically be a YOLOv11n-LD target detection model improved based on the YOLOv11n model. The preset YOLOv11n model is an improved model of the YOLO algorithm, mainly including three parts: Backbone, Neck, and Head. The Backbone part is responsible for feature extraction, using a series of convolution and deconvolution layers, while using residual connections and bottleneck structures to reduce the size of the network and improve performance. The Neck part is located between the backbone network and the head network, responsible for feature fusion and enhancement. The Head part is responsible for generating the final detection result.

[0081] The architecture of the preset target detection model may specifically include: replacing the preset convolution layer in the preset YOLOv11n model with the LDConv linear variable convolution layer, and adding a pyramid fast pooling module SimSPPF to the preset YOLOv11n model to obtain the architecture of the preset target detection model.

[0082] Reference Figure 3 , Figure 3 The architecture of the preset target detection model is shown. The preset convolutional layer is the CBS module in the YOLOv11n model. Figure 3 In this example, all CBS modules in the YOLOv11n model are replaced with LDConv linearly variable convolutional layers. In other implementations, one or more CBS modules in the YOLOv11n model can also be replaced with LDConv linearly variable convolutional layers, which will not be described here.

[0083] At the same time, the original SPPF module at the end of the YOLOv11n model is replaced with a more computationally efficient simplified spatial pyramid fast pooling module SimSPPF module to enhance the multi-scale feature extraction capability of the preset target detection model, thereby completing the improvement of the preset YOLOv11n model to obtain the preset target detection model.

[0084] The LDConv linearly variable convolutional layer uses an algorithm to generate initial sampling coordinates for convolution kernels of any size and adjusts the sampling shape using an offset to adapt it to changes in the target shape. Furthermore, the LDConv linearly variable convolutional layer allows convolution kernels to have any number of parameters, providing greater flexibility in network design and shifting the parameter growth trend from quadratic to linear, reducing hardware requirements.

[0085] In addition, the loss function used in this preset object detection model is the SloU loss function. The SloU loss function is a loss function used for bounding box regression. By incorporating perspective and scale sensitivity, it provides improved training speed and prediction accuracy. Using the SloU loss function optimizes bounding box regression, making the model more accurate in bounding box positioning.

[0086] Specifically, in step S102, the preset target detection model is used to detect the target in each video frame, which may include: inputting the video frame into the preset target detection model, and the preset target detection model can detect each target object in the video frame, and obtain the detection frame and confidence of each target object. For example, referring to Figure 4 , Figure 4 The output result is the target detection result of the video frame image using the preset target detection model.

[0087] Step S103 : extracting the appearance features of each current target object detected from the current video frame, and extracting the appearance features of each historical target object detected from the previous video frame.

[0088] For example, in step S103, the current video frame may be a video frame at the current moment in the video data, such as the t-th frame image in the video data. For ease of description, the current video frame is taken as the t-th frame video frame as an example.

[0089] The previous video frame is the video frame at the previous moment based on the current moment, for example, the t-1th frame image. In this embodiment, for ease of description, the t-1th frame video frame is used as an example to represent the previous video frame.

[0090] Exemplarily, in step S102, target detection is performed on the target in the t-th video frame, and the target object in the t-th video frame, i.e., the current target object, such as current target object a1, current target object a2, current target object a3, and current target object a4, is identified from the t-th video frame. Simultaneously, the target in the t-1-th video frame is identified, and the target object in the t-1-th video frame, i.e., the historical target object, such as historical target object b1, historical target object b2, historical target object b3, historical target object b4, and historical target object b5, is identified.

[0091] In step S103, the appearance features of each current target object are extracted, and the appearance features of each historical target object are also extracted. Because the target objects appearing in the same image are different individuals, the target objects appearing in the previous image and the current image may be the same individual or different individuals. Therefore, in step S103, the appearance features of each current target object and each historical target object are extracted. This allows the current target object and the historical target objects to be identified as belonging to the same individual based on the appearance features of each target object.

[0092] In some embodiments, in step S103, the process of extracting appearance features of the target object in the video frame includes: using the MobileNetV4Small feature extraction network as a feature extractor to extract the appearance features of the target object detected from the video frame.

[0093] Specifically, the MobileNetV4Small network is a lightweight convolutional neural network that efficiently extracts target appearance features through techniques such as depthwise separable convolutions, a Universal Inverted Bottleneck (UIB) search block, Mobile MQA attention blocks, and an optimized Neural Architecture Search (NAS) formulation. These techniques not only reduce computational complexity and improve network efficiency, but also enhance the network's ability to capture target appearance features, making the extracted appearance features more accurate and comprehensive.

[0094] For example, in step S103, appearance feature a1 of current target object a1, appearance feature a2 of current target object a2, appearance feature a3 of current target object a3, and appearance feature a4 of current target object a4 in the t-th video frame are extracted. Simultaneously, appearance feature b1 of historical target object b1, appearance feature b2 of historical target object b2, appearance feature b3 of historical target object b3, appearance feature b4 of historical target object b4, and appearance feature b5 of historical target object b5 in the t-1th video frame are extracted.

[0095] Step S104 : predicting the trajectory of each historical target object in the previous video frame within a preset time period.

[0096] The preset time period is the time period between the moment of the previous video frame and the moment of the current video frame.

[0097] For example, trajectory prediction is performed for the historical target objects b1 to b5 in the t-1th frame of the video to obtain the predicted trajectories corresponding to the historical target objects b1 to the target historical object b5, and then the predicted position of the historical target object b1 at the current moment, the predicted position of the historical target object b2 at the current moment, etc. can be obtained.

[0098] In some embodiments, in step S104, the trajectory of each historical target object in the previous video frame within a preset time period is predicted, including: predicting the trajectory of each historical target object in the previous video frame within the preset time period through Kalman filtering to obtain the predicted trajectory of each historical target object in the preset time period.

[0099] Specifically, Kalman filtering is a commonly used state estimation method that can estimate and predict the state of a dynamic system. In target tracking, Kalman filtering can be used to predict the position and state of the target and update the target trajectory based on the current target detection results.

[0100] Specifically, the Kalman filter is a linear Gaussian state estimation method. Its basic principle is to estimate and predict the system state through the system's dynamic equations and observation equations. In target tracking, the Kalman filter can be used to predict the target's position and velocity.

[0101] The Kalman filter can be divided into two steps: prediction and update. In the prediction step, the Kalman filter uses the system's dynamic equations and observation equations to calculate a predicted value for the target's state. In the update step, the Kalman filter compares the predicted value with the observation results to calculate an estimated value, and adjusts the system state based on the estimated value and the observation results. In step S104, the Kalman filter uses the prediction step to predict the trajectory of each historical target object within a preset time period.

[0102] Exemplarily, in step S104, the trajectories of historical target objects b1 to b5 in the t-1th frame of video are predicted to obtain the predicted trajectory b1 of historical target object b1, the predicted trajectory b2 of historical target object b2, the predicted trajectory b3 of historical target object b3, the predicted trajectory b4 of historical target object b4, and the predicted trajectory b5 of historical target object b5.

[0103] Step S105 , matching the appearance features and predicted trajectory of the historical target object in the previous video frame with the appearance features and detection frame of the current target object, determining whether the historical target object and the current target object belong to the same target, and obtaining the target object tracking result.

[0104] In step S105, target matching is performed. Specifically, the detection result in the current video frame is matched with the predicted trajectory in the previous video frame in combination with the appearance features to determine which target objects are the same target, thereby achieving target tracking.

[0105] In some embodiments, reference Figure 5 In step S105, the appearance features and predicted trajectory of the historical target object in the previous video frame are matched with the appearance features and detection frame of the current target object, which may specifically include the following steps S151 to S153.

[0106] Step S151 , based on the appearance features and predicted trajectory of each historical target object in the previous video frame, and the detection frame and appearance features of each current target object in the current video frame, cascade matching and intersection-over-union matching are performed on the historical target objects and the current target object.

[0107] Specifically, in step S151, each cow in the current video frame is matched with the appearance features of the cow and the predicted trajectory of each cow in the previous video frame by cascade matching and IOU (Intersection over Union) matching to perform target tracking.

[0108] Specifically, in step S151, cascade matching includes two stages. The first stage is the feature matching stage. In step S103, the MobileNetV4Small network is used to extract the appearance features (such as texture and color) of the cows in the current video frame, and a 128-dimensional feature vector is generated. In step S104, the trajectory of the cows in the previous video frame is predicted by Kalman filtering. According to the predicted trajectory, the position and speed of each cow in the upper video frame in the current video frame can be obtained, that is, the predicted box of each historical cow in the current video frame is obtained.

[0109] In the first stage of cascade matching (step S151), the Mahalanobis distance and cosine distance are calculated between the predicted bounding box of the historical cow and the detection bounding box of each current cow. The Mahalanobis distance measures the degree of motion matching between the historical cow and the current cow. The cosine distance measures the appearance similarity between the two. In the first stage, a first preset threshold for the Mahalanobis distance and a second preset threshold for the cosine distance are set. If the Mahalanobis distance between the historical cow and the current cow is not less than the first preset threshold, and the cosine distance between the historical cow and the current cow is not less than the second preset threshold, the first stage of cascade matching is considered a successful match.

[0110] In the second stage of cascade matching, the predicted and detected bounding boxes are matched again using IOU (Intersection over Union) matching. IOU (Intersection over Union) matching measures the degree of overlap between two bounding boxes (detection box and prediction box). The ratio of the intersection area of the detection box and the predicted box to the union area (i.e., the IOU value) is used to determine the degree of association between the two.

[0111] When the Mahalanobis distance between a prediction box and a detection box is not less than a first preset threshold, the cosine distance between the two is not less than a second preset threshold, and the intersection-over-union ratio of the two reaches a preset intersection-over-union ratio threshold, it indicates that the two are matched successfully.

[0112] On the contrary, if there is no detection box that meets the preset matching success conditions for a prediction box, the prediction box is considered to be a matching failure prediction box, and the corresponding historical target object is a matching failure historical target object.

[0113] Similarly, if a detection box does not have a prediction box that meets the preset matching conditions, the detection box is considered to be a detection box that failed to match, and the corresponding current target object is the current target object that failed to match.

[0114] Among them, the preset matching success condition is that the Mahalanobis distance between the above-mentioned prediction box and the detection box is not less than a first preset threshold, and the cosine distance between the two is not less than a second preset threshold, and the intersection-over-union ratio of the two reaches a preset intersection-over-union ratio threshold.

[0115] For example, for the current cow a1, the current cow a2, the current cow a3, the current cow a4, the historical cow b1, the historical cow b2, the historical cow b3, the historical cow b4, and the historical cow b5, the current cow a1 is cascade matched with the historical cows b1 to b5 respectively. If the current cow a1 and the historical cow b1 meet the preset matching success conditions, then the current cow a1 and the historical cow b1 are matched successfully, that is, the historical cow b1 and the current cow a1 are the same cow (for example, cow 1), but are at different times. The historical cow b1 is the image of cow 1 at time t-1, and the current cow a1 is the image of cow 1 at time t.

[0116] Similarly, current cows a2 through a4 are cascade matched with historical cows b1 through b5, respectively. If the final matching results include current cow a1 and historical cow b1, and current cow a2 and historical cow b2, then current cows a3 and a4 do not have matching historical cows, and thus are considered current target objects for which the matching failed. Historical cows b3, b4, and b5 do not have matching current cows, and thus are considered historical target objects for which the matching failed.

[0117] Step S152: If there is a successful match between the historical target object and the current target object, determine that the successfully matched current target object and the historical target object belong to the same target, and determine the target object tracking result of the target based on the detection box and predicted trajectory of the same target.

[0118] For example, using the example in step S151 as an example, if the current cow a1 and the historical cow a1 are successfully matched, the current cow a1 and the historical cow a1 belong to the same cow, for example, cow 1. Thus, based on the detection frame of cow 1 (the detection frame of the current cow a1) and the prediction frame (the prediction frame of the historical cow a1), the tracking result of cow 1 can be determined.

[0119] Specifically, in step S152, the position and confidence information of the detection frame can be used to update the state estimate of the Kalman filter. Then, the updated Kalman filter is used to update the predicted trajectory to complete target tracking. More specifically, after a successful match, the position information of the detection frame in the current video frame is used to correct the predicted trajectory of the Kalman filter: first, the deviation between the detection frame and the predicted frame is calculated, and then the correction amplitude is dynamically adjusted using the Kalman gain. Finally, the fused target position is output as the tracking result.

[0120] Step S153 , when there is a historical target object and / or a current target object that fails to match, the target tracking result of the failed target is determined based on the predicted trajectory of the failed historical target object and / or the detection frame of the failed current target object.

[0121] In some embodiments, reference Figure 6 In the case where there are historical target objects that failed to match and current target objects that failed to match, in step S153, the target tracking result of the target that failed to match is determined based on the predicted trajectory of the historical target objects that failed to match and the detection frame of the current target object that failed to match. This can be achieved by the following steps S1531-S1533.

[0122] Step S1531: For the current target object that fails to match, determine whether the current target object is a new target based on the detection frame of the current target object. If the current target object is a new target, set the initial trajectory of the new target to determine the target tracking result of the new target.

[0123] For example, the current cow a3 and the current cow a4 in step S151 are the current target objects that failed to match. In step S1531, it is determined whether the current cow a3 is a new target and whether the current cow a4 is a new target.

[0124] The newly entered target is a target that has just entered the preset tracking area at the current moment. The newly entered target was not in the preset tracking area at the previous moment, that is, the newly entered target does not exist in the historical target object.

[0125] In some embodiments, determining whether the current target object is a new target may specifically include: determining whether the detection frame of the current target object is located in a preset entrance area, and if the detection frame is located in the preset entrance area, determining that the current target object is a new target.

[0126] The preset entry area is the area in the video frame centered at the entry position of the preset tracking area. Figure 7 The image of the barn shows the "entrance area".

[0127] If the detection frame of the detected cow is not located in the preset entrance area, it indicates that the cow (i.e., the corresponding current target object) is not a new target. If the detection frame of the detected cow is located in the entrance area, it indicates that the current target object is a new target. For example, if the detection frame of the current cow a3 is located in the preset entrance area, and the detection frame of the current cow a4 is not located in the preset entrance area, the current cow a3 is a new target, and the current cow a4 is not a new target.

[0128] Specifically, in step S1531, if the current target object is a new target, an initial track for the new target is set. Specifically, if the cow is a new target, a new track is initialized to set the initial track for the new target. Initializing a new track means creating a tracking track for the newly identified cow target, which is used to record the cow's track information and predict its position in the next frame.

[0129] Step S1532 : For the historical target object that fails to match, if the predicted trajectory of the historical target object that fails to match does not belong to the entry state trajectory, the predicted trajectory of the historical target object that fails to match is deleted.

[0130] For example, historical cows b3, b4, and b5 in step S151 are historical target objects that failed to be matched.

[0131] The entry trajectory refers to the trajectory of the target entering the preset tracking area. For example, there is an entrance and exit in the cowshed, and the cows enter and exit through this entrance and exit. The trajectory of the target entering the preset tracking area from this entrance and exit is the entry trajectory. Figure 2 as well as Figure 7 In the example shown, the entrance and exit are set to the same entrance and exit, and the cow can only enter and exit through this entrance and exit. If the predicted trajectory of the cow is from outside the cowshed through this entrance and exit into the cowshed, the predicted trajectory of the cow is considered to be an entry trajectory.

[0132] In some embodiments, reference Figure 8 In step S1532, the method of determining whether the predicted trajectory of the historical target object that failed to match belongs to the entry state trajectory may specifically include the following steps S810 to S830.

[0133] Step S810 : determining, based on the predicted trajectory of the historical target object, whether the historical target object passes through a first preset position line and a second preset position line in a preset entrance area in the predicted trajectory.

[0134] The first preset position line is closer to the entrance of the preset tracking area than the second preset position line.

[0135] Figure 7 The first preset position line and the second preset position line are shown in FIG. Figure 7 , Figure 7 Line 1 is the first preset position line, and line 2 is the second preset position line.

[0136] Step S820 : When the time when the historical target object passes through the first preset position line is earlier than the time when the historical target object passes through the second preset position line, it is determined that the predicted trajectory of the historical target object belongs to the entry state trajectory.

[0137] Step S830: When the time when the historical target object passes through the first preset position line is later than the time when the historical target object passes through the second preset position line, or when the historical target object does not pass through the first preset position line and / or the second preset position line, it is determined that the predicted trajectory of the historical target object does not belong to the entry state trajectory.

[0138] For example, in step S820 and step S830, the historical cow b3 is taken as an example. In the predicted trajectory of the historical cow b3, if the predicted trajectory of the historical cow b3 first passes through the first preset position line and then passes through the second preset position line, then the predicted trajectory of the historical cow b3 is considered to be an entry trajectory.

[0139] For another example, assuming that the historical cow b4 first passes through the second preset position line and then passes through the first preset position line in the corresponding predicted trajectory, it is considered that the predicted trajectory of the historical cow b4 does not belong to the entry state trajectory.

[0140] For another example, assuming that historical cow b5 only passes through the first preset position line but not the second preset position line in the corresponding predicted trajectory, or historical cow b5 only passes through the second preset position line but not the first preset position line in the corresponding predicted trajectory, or historical cow b5 passes neither the second preset position line nor the first preset position line, then it is considered that the historical cow b5 does not belong to the entry state trajectory.

[0141] In step S1532, after determining whether the predicted trajectory of each historical target object belongs to the entry state trajectory, for historical target objects that do not belong to the entry state trajectory (such as the historical cows b4 and b5 mentioned above), if the historical target object is mismatched, it indicates that the historical target object may have left the field of view at the current moment, and therefore the predicted trajectory corresponding to the historical target object is deleted. For example, for cows that have not completely passed through the first preset position line and the second preset position line (for example, cows that have only passed through the first preset position line, or only passed through the second preset position line, or neither the first preset position line nor the second preset position line), they are basically cows close to the entrance. These cows are likely to leave the field of view. Therefore, when their trajectories are continuously mismatched, they may have left the field of view, and therefore their trajectory information is deleted.

[0142] For historical target objects belonging to the entry trajectory, it indicates that the historical target object has most likely passed through the entrance area and entered the entire cowshed at the current moment. Such historical target objects are less likely to leave the field of view. Therefore, for historical target objects belonging to the entry trajectory, step S1533 is entered for the next step of processing.

[0143] In step S1533, if there is a historical target object whose predicted trajectory belongs to the entry trajectory and there is a current target object that is not a new target, the predicted trajectory of the historical target object that belongs to the entry trajectory is matched with the predicted trajectory of the current target object that is not a new target according to a preset matching method to determine the target tracking result.

[0144] Exemplarily, continuing with the above example, the current cow a4 is a current target object that is not a new target, and the historical cow b3 is a historical target object whose predicted trajectory belongs to the entry state trajectory.

[0145] In this case, in step S1533, the prediction frame of the historical cow b3 at the current moment is determined from the predicted trajectory of the historical cow b3, and the detection frame of the current cow a4 is matched with the prediction frame of the historical cow b3 at the current moment according to a preset matching method to perform target tracking.

[0146] In some embodiments, in step S1533, matching according to a preset matching method may specifically include performing IOU-Euclidean-Hungarian (IEH) matching on the detection frame of the current target object and the prediction frame of the historical target object, and finally outputting the tracking results of multiple targets.

[0147] Specifically, according to the IOU-Euclidean-Hungarian matching strategy, the intersection over union (IOU) and the Euclidean distance value of the predicted trajectory belonging to the entry state trajectory and the detection box that does not belong to the new target are first calculated, and a cost matrix is constructed based on the IOU and the Euclidean distance value to perform matching using the cost matrix.

[0148] Specifically, using the intersection-over-union ratio and Euclidean distance as matching costs, a cost matrix is constructed between the predicted trajectory and the detection frame. The Hungarian algorithm and the cost matrix are then used to find the optimal match between the predicted trajectory and the detection frame, thereby finding the predicted trajectory that best matches the detection frame from the predicted trajectory. If a match is successful, it indicates that the two current target objects and the historical target objects that have successfully matched belong to the same target. In this case, the Kalman filter is used to update the trajectory information of the target, thereby obtaining all the trajectories of the target before (including) the tth frame of the video, and finally obtaining the trajectory information of the tth frame of the video, thus completing the tracking of the target.

[0149] It is worth noting that in step S1533, if there are still historical target objects that failed to match or current target objects that failed to match, mismatch information can be output based on the historical target objects that failed to match or the current target objects that failed to match so that target tracking can be performed manually.

[0150] In this embodiment, target detection is performed on each frame of video data in a preset tracking area, a detection frame for each target object is extracted, and the detection frame of the current video frame is matched with the predicted trajectory of the previous video frame within a preset time period to determine the historical target objects and the current target object belonging to the same target, thereby completing the tracking of the target object. In this embodiment, video data is processed using a preset target detection model and matching algorithm to complete target tracking without the need for setting up a contact device or using a contact device for target tracking. This can improve the problem of reduced positioning accuracy caused by signal instability of contact devices, thereby improving the positioning accuracy of target tracking and meeting real-time tracking requirements.

[0151] In addition, this embodiment does not require ear tags and collars to be placed on the cows, which reduces restrictions on the cows' daily activities and is conducive to improving production efficiency.

[0152] Furthermore, with the significant advancements in computer vision technology for multi-target tracking, a growing number of target tracking methods have emerged. One target tracking method that incorporates computer vision technology also uses cameras to capture video data and, combined with deep learning algorithms, enables non-contact, real-time tracking of cows.

[0153] However, in practical applications, computer vision algorithms still face a number of challenges. First, the varying scale of the cows, depending on their distance from the camera, reduces detection and tracking accuracy. Second, in crowded barns, frequent occlusions between cows or between cows and facilities can easily lead to target loss and affect tracking continuity.

[0154] The target tracking method of this embodiment is implemented by improving the DeepSORT algorithm in the related art. In this embodiment, the DeepSORT-S algorithm is used for target tracking. During the target tracking process, the YOLOv11n-LD model, an improved version of the YOLOv11n model, is used for target detection, thereby improving the accuracy of target detection. Furthermore, a lightweight MobileNetV4Small feature extraction network is used to replace the feature extraction network in the original DeepSORT algorithm to extract the appearance features of the cow (i.e., the target object). Secondly, during the target matching process in the DeepSORT algorithm, a position-based matching mechanism is added (for example, if cascade matching fails, the cow's detection box, i.e., position, is used to determine whether it is a new target and whether the cow's predicted trajectory is an entry trajectory, adding position-based new target determination and entry trajectory determination and matching) and an IOU-Euclidean-Hungarian (IEH) matching strategy. A cost matrix is constructed by combining IOU and Euclidean distance for target matching, ultimately outputting the tracking results of multiple target cows.

[0155] The target tracking method of this embodiment can improve the problem of target scale variation and target easy loss in traditional tracking methods, thereby improving the accuracy of detection and tracking.

[0156] In addition, the multi-target tracking algorithms in related technologies often require high computing resources and are difficult to run in real time on embedded devices or in resource-constrained environments, which limits their application in actual production.

[0157] In this embodiment, the improved YOLOv11n-LD object detection model and DeepSORT-S algorithm can also be deployed on embedded devices. The specific method is to convert the weights of the YOLOv11n-LD object detection model from PyTorch format to ONNX format, and then further convert them to Rockchip Neural Network (RKNN) format to adapt to the hardware environment of the embedded device and achieve real-time multi-target cow tracking.

[0158] To facilitate understanding of the above method, an example is provided in this embodiment to illustrate the target tracking method of this embodiment. Figure 9 The overall process of the target tracking method is shown. Figure 9 For example, let's take a cowshed as the living place, the target cows as the target, the current video frame as frame t, and the previous video frame as frame t-1. Assume that frame t includes cows a1, a2, a3, and a4, while frame t-1 includes cows b1, b2, b3, and b4.

[0159] The MobileNetV4Small feature extraction network is used to extract the appearance features of cow a1, cow a2, cow a3 and cow a4 respectively.

[0160] Using Kalman filtering, the predicted trajectories of cows b1, b2, b3, and b4 are predicted (in the time period from time t-1 to time t).

[0161] Combine the appearance features of cows a1-a4 and the predicted trajectories of cows b1-b4 to perform cascade matching and IoU matching. Assume that cows a1 and b1 are successfully matched, and cows a2 and b2 are successfully matched, but cows a3, a4, b3, and b4 all fail to match. This means that cows a1 and b1 are the same cow, and cows a2 and b2 are the same cow. Therefore, the predicted trajectory of cow b1 can be updated based on the detection box and confidence score of cow a1, and the predicted trajectory of cow b2 can be updated based on the detection box and confidence score of cow a2. This results in the t-th frame trajectory information for cows 1 and 2.

[0162] The detection frames of cows a3 and a4, which failed to match, are considered mismatched. We then determine whether the detection frames of cows a3 and a4 are within the entrance area. Assuming that the detection frame of cow a3 is within the entrance area, while the detection frame of cow a4 is not, cow a3 is identified as newly arrived cow 3. A trajectory is then created for cow 3, resulting in the t-th frame trajectory of cow 3.

[0163] For cows b3 and b4, which failed to match, the predicted trajectory of cow b3 and cow b4 is used as the mismatched trajectory to determine whether cow b3 and cow b4 are in the entry state. Assuming that cow b3 is in the entry state, it is assumed that cow b3 is unlikely to leave the barn at the current moment. If cow b4 is not in the entry state, it is assumed that cow b4 is likely to leave the barn at the current moment, so the trajectory information of cow b4 is deleted.

[0164] For cow b3, which is in the entry state, and cow a4, which is not in the entrance area, the matching failure may be due to the fact that their appearance features have changed significantly in the current image. Therefore, cow b3 and cow a4 are matched by IEH. If the match is successful, it means that cows b3 and cow a4 belong to the same cow, for example, cow 4. The predicted trajectory of cow b3 is updated based on the detection box and confidence score of cow a4 to obtain the trajectory information of cow 4 in the tth frame.

[0165] In addition, if cow b3 and cow a4 fail to match in the IEH matching, the predicted trajectory of cow b3 is determined to be a mismatched trajectory.

[0166] Furthermore, after determining the mismatched trajectory, the predicted trajectory information of the cow can be saved in the background database. When a cow with an actual frame that has not been successfully matched is detected in the future, it can be matched with the occluded cow in the background database first. If the match is successful, it is determined that the occluded cow is the same cow as the unmatched cow in the actual frame, so that the trajectory of the occluded cow can be made continuous, solving the current problem of poor trajectory continuity.

[0167] The multi-target tracking method of this embodiment adopts the above design to track multiple targets through an improved preset target detection model and a preset algorithm, thereby solving the problems of target size change and occlusion, and integrating the preset target detection model and the preset algorithm into an overall model, and then formatting the model weights of the overall model, and further converting it into a format suitable for embedded devices. Since the preset target detection model adopts technologies such as a simplified spatial pyramid fast module, the multi-target tracking method of this embodiment can be integrated into embedded devices, which solves the problem that the current tracking algorithm is difficult to run in real time in embedded devices or resource-constrained environments due to high computing resources, and limits its application in actual production.

[0168] Example 2

[0169] This embodiment relates to a target tracking device, combined with Figure 10 As shown in , the target tracking device comprises a video data acquisition module 1001 , a target detection module 1002 , a feature extraction module 1003 , a trajectory prediction module 1004 and a target matching and tracking module 1005 .

[0170] Among them, the video data acquisition module 1001 is used to acquire video data of a preset tracking area; the target detection module 1002 is used to detect the target in each frame of video data using a preset target detection model to extract the detection frame of the target object existing in each video frame; the feature extraction module 1003 is used to extract the appearance features of each current target object detected from the current video frame, and extract the appearance features of each historical target object detected from the previous video frame; the trajectory prediction module 1004 predicts the trajectory of each historical target object in the previous video frame within a preset time period, and the preset time period is the time period between the moment of the previous video frame and the moment of the current video frame; the target matching tracking module 1005 is used to match the appearance features and predicted trajectory of the historical target objects in the previous video frame, the appearance features and detection frame of the current target object, to determine the historical target objects and the current target objects belonging to the same target, so as to obtain the target object tracking result.

[0171] Specifically, referring to the description in Example 1, similarly, the preset target detection model of this embodiment is the YOLOv11n-LD target detection model improved based on the YOLOv11n model, and the preset algorithm of this embodiment is the DeepSORT-S algorithm improved based on the DeepSORT algorithm.

[0172] In addition, when the target tracking device of this embodiment is specifically implemented, the above-mentioned modules can adopt existing module products with data transmission, storage or calculation processing functions. At the same time, the above-mentioned modules in this embodiment can be set separately, or preferably, they can be integrated into the control device of the fuel cell vehicle.

[0173] In specific applications, when the target tracking device of this embodiment tracks multiple targets, reference may still be made to the relevant description in the first embodiment, which will not be repeated here.

[0174] The target tracking device of this embodiment, through the above modules and by executing the method in Example 1, can detect the target on each frame of the video data, extract the detection frame of each target object, and use the detection frame of the current video frame and the predicted trajectory for matching, thereby determining the historical target object and the current target object belonging to the same target, and then completing the tracking of the target object. In the present invention, video data is used and combined with a preset target detection model and a matching algorithm to process the video data to complete the tracking of the target, without the need to set up a contact device or use a contact device for target tracking, thereby reducing the problem of reduced positioning accuracy due to the signal instability of the contact device, thereby improving the positioning accuracy of target tracking and meeting real-time tracking requirements.

[0175] By adopting the YOLOv11n-LD target detection model and the DeepSORT-S algorithm, real-time tracking of multiple targets in complex environments is achieved. Since the DeepSORT-S algorithm incorporates a position-based matching mechanism, it can still find the trajectory information of the corresponding target when facing problems such as target scale changes and occlusion, thus solving the problem of poor tracking continuity caused by target scale changes and occlusion in existing technologies.

[0176] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A target tracking method, characterized in that: include: Get the video data of the preset tracking area; Using a preset target detection model, the target in each frame of the video data is detected to extract a detection frame of the target object in each video frame; Extracting appearance features of each current target object detected from the current video frame, and extracting appearance features of each historical target object detected from the previous video frame; Predicting the trajectory of each of the historical target objects in the previous video frame within a preset time period, where the preset time period is a time period between the moment of the previous video frame and the moment of the current video frame; The appearance features and predicted trajectory of the historical target object in the previous video frame are matched with the appearance features and detection frame of the current target object to determine that the historical target object and the current target object belong to the same target, so as to obtain the target object tracking result.

2. The target tracking method according to claim 1, characterized in that The loss function of the preset target detection model is the SloU loss function; the architecture of the preset target detection model is obtained through the following process: Based on the preset YOLOv11n model, the preset convolution layer in the preset YOLOv11n model is replaced with the LDConv linear variable convolution layer; A pyramid fast pooling module SimSPPF is added to the preset YOLOv11n model to obtain the architecture of the preset target detection model.

3. The target tracking method according to claim 1, wherein: The process of extracting appearance features of target objects in video frames includes: The MobileNetV4Small feature extraction network is used as the feature extractor to extract the appearance features of the target objects detected from the video frames.

4. The target tracking method according to claim 1, wherein: The predicting of the trajectory of each of the historical target objects in the previous video frame within a preset time period includes: The trajectory of each historical target object in the previous video frame within a preset time period is predicted by Kalman filtering to obtain a predicted trajectory of each historical target object in the preset time period.

5. The target tracking method according to claim 1, wherein: The matching of the appearance features and the predicted trajectory of the historical target object in the previous video frame with the appearance features and the detection frame of the current target object includes: Based on the appearance features and predicted trajectory of each of the historical target objects in the previous video frame and the appearance features and detection frame of each of the current target objects in the current video frame, the historical target objects are matched with the current target object by cascade matching and intersection-over-union matching; If a match is successful between the historical target object and the current target object, the current target object and the historical target object are determined to be the same target, and a target object tracking result of the target is determined based on the detection frame and the predicted trajectory of the same target. In the case where there is a historical target object and / or a current target object that fails to match, the target tracking result of the failed target is determined based on the predicted trajectory of the failed historical target object and / or the detection frame of the failed current target object.

6. The target tracking method according to claim 5, characterized in that: Determining a target tracking result of the target that failed to match based on the predicted trajectory of the historical target object that failed to match and the detection frame of the current target object that failed to match, including: For the current target object that fails to match, determine whether the current target object is a new target based on the detection frame of the current target object. If the current target object is a new target, set the initial trajectory of the new target to determine the target tracking result of the new target; For a historical target object that fails to match, if the predicted trajectory of the historical target object that fails to match does not belong to the entry state trajectory, deleting the predicted trajectory of the historical target object that fails to match; When there is a historical target object whose predicted trajectory belongs to the entry trajectory and a current target object that does not belong to the new entry target, the predicted trajectory of the historical target object that belongs to the entry trajectory is matched with the detection frame of the current target object that does not belong to the new entry target according to a preset matching method to determine the target tracking result.

7. The target tracking method according to claim 6, characterized in that: The determining, based on the detection frame of the current target object, whether the current target object is a new target includes: Determining whether a detection frame of the current target object is located in a preset entrance area, and if the detection frame is located in the preset entrance area, determining that the current target object is a new target; The preset entrance area is an area centered at the entrance position in the preset tracking area.

8. The target tracking method according to claim 6, characterized in that: Methods for determining whether the predicted trajectory of the historical target object that failed to match belongs to the entry state trajectory include: determining, based on the predicted trajectory of the historical target object, whether the historical target object passes through a first preset position line and a second preset position line within a preset entrance area in the predicted trajectory; If the time when the historical target object passes through the first preset position line is earlier than the time when the historical target object passes through the second preset position line, determining that the predicted trajectory of the historical target object belongs to the entry state trajectory; If the time when the historical target object passes through the first preset position line is later than the time when the historical target object passes through the second preset position line, or if the historical target object does not pass through the first preset position line and / or the second preset position line, determine that the predicted trajectory of the historical target object does not belong to the entry state trajectory; The first preset position line is closer to the entrance of the preset tracking area than the second preset position line.

9. The target tracking method according to claim 6, characterized in that: The preset matching method includes: Calculating the intersection-over-union ratio and the Euclidean distance between the predicted trajectory belonging to the entry state trajectory and the detection box that does not belong to the new target; A cost matrix is constructed according to the intersection-over-union ratio and the Euclidean distance value, so as to perform matching using the cost matrix.

10. A target tracking device, characterized in that: include: A video data acquisition module (1001) is used to acquire video data of a preset tracking area; A target detection module (1002) is used to detect targets in each frame of the video data using a preset target detection model to extract a detection frame of the target object in each video frame; A feature extraction module (1003) is used to extract the appearance features of each current target object detected from the current video frame, and to extract the appearance features of each historical target object detected from the previous video frame; A trajectory prediction module (1004) predicts the trajectory of each of the historical target objects in the previous video frame within a preset time period, wherein the preset time period is a time period between the moment of the previous video frame and the moment of the current video frame; The target matching and tracking module (1005) is used to match the appearance features and predicted trajectory of the historical target object in the previous video frame with the appearance features and detection frame of the current target object to determine whether the historical target object and the current target object belong to the same target, so as to obtain the target object tracking result.

Citation Information

Cited By

  • Face recognition method based on multi-modal feature fusion

    CN122176809A