Vehicle tracking method, device, intelligent terminal and storage medium
By acquiring continuous video frames for short-term tracking and trajectory prediction, combined with the appearance feature matching of the vehicle re-identification scheme, the problem of tracking failure caused by poor real-time performance and occlusion of vehicle tracking in the existing technology is solved, and continuous tracking of vehicles is achieved.
Patent Information
- Application Number
- CN202011272439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-11-13
AI Technical Summary
Existing vehicle tracking technology has poor real-time performance in complex traffic environments, cannot track for long periods of time, and fails to detect and track vehicles when they are blocked.
By acquiring continuous video frames for short-term tracking, vehicle trajectories are predicted, and appearance feature matching is performed based on the vehicle re-identification scheme to achieve continuous tracking of vehicles.
It improves the real-time performance of vehicle tracking and long-term tracking capabilities, and can continuously track the vehicle before and after it is blocked.
Smart Images

Figure CN112435276B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a vehicle tracking method, device, intelligent terminal and storage medium. Background Art
[0002] With the improvement of social and economic level, vehicles have become a common means of transportation in people's daily life. The number and density of vehicles on the road have also increased rapidly, resulting in an increasingly complex traffic environment. How to track vehicles through images and videos on the corresponding roads has gradually attracted attention.
[0003] The existing multi-target tracking methods all separate detection and tracking, and process them into multiple subtasks. The basic process is to first detect the vehicle, then extract features, and then use a single target tracking method (such as Kalman filtering, Hungarian matching or linear assignment) to associate the detection frame. The problem with the existing technology is that the real-time tracking is poor and can only track vehicles within a short time range. If the vehicle is blocked for a period of time during driving, the vehicle detection and tracking will fail.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention
[0005] Aiming at the technical problem that detection and tracking are separated in the prior art, vehicle detection is first performed, then feature extraction is performed, and then vehicle tracking is performed by using a single target tracking method to associate a detection frame, which has poor real-time performance and can only track vehicles within a short time range. If the vehicle is blocked for a period of time during driving, vehicle detection and tracking will fail, the present invention provides a vehicle tracking method, device, intelligent terminal and storage medium, which can obtain continuous video frames containing vehicles; perform short-term tracking on the vehicles based on the continuous video frames to obtain short-term tracking results; perform trajectory prediction on the vehicles based on the short-term tracking results to obtain vehicle trajectory information; obtain suspicious trajectories based on the vehicle trajectory information; obtain suspicious vehicles corresponding to the suspicious trajectories, use a vehicle re-identification scheme to perform appearance feature matching on the suspicious vehicles to obtain appearance matching results; and track the vehicle based on the suspicious trajectories and the appearance matching results. The scheme of the present invention obtains the short-term tracking result of the vehicle, performs trajectory prediction on the vehicle to obtain the vehicle trajectory information, judges the suspicious vehicle based on the vehicle trajectory information, performs appearance feature matching on the suspicious vehicle, and realizes the tracking of the vehicle by combining short-term tracking, trajectory prediction and appearance feature matching, thereby realizing the technical effects of improving the real-time tracking, tracking the vehicle within a long time range, and continuous tracking before and after the vehicle is blocked.
[0006] In order to achieve the above technical effects, the first aspect of the present invention provides a vehicle tracking method, wherein the method comprises:
[0007] Obtaining continuous video frames containing the vehicle;
[0008] Perform short-term tracking on the vehicle based on the continuous video frames to obtain a short-term tracking result;
[0009] Based on the short-term tracking results, the vehicle trajectory is predicted to obtain vehicle trajectory information;
[0010] Obtaining a suspicious trajectory based on the above vehicle trajectory information;
[0011] Obtaining a suspicious vehicle corresponding to the suspicious trajectory, and using a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result;
[0012] The vehicle is tracked based on the suspicious trajectory and the appearance matching result.
[0013] Optionally, the short-term tracking of the vehicle based on the continuous video frames to obtain a short-term tracking result includes:
[0014] Obtain two consecutive frames from the above consecutive video frames;
[0015] Get the offset vector between the two consecutive frames mentioned above;
[0016] The short-term tracking result is obtained based on the offset vector.
[0017] Optionally, the obtaining of a suspicious trajectory based on the vehicle trajectory information includes:
[0018] Acquire structural information of the road based on the above vehicle trajectory information;
[0019] The suspicious trajectory is obtained based on the vehicle trajectory information and the structured information of the road.
[0020] Optionally, the obtaining of a suspicious trajectory based on the vehicle trajectory information and the structured information of the road includes:
[0021] Acquire the vehicle whose track is lost based on the above vehicle track information;
[0022] Determine whether the vehicle with lost track is associated with the road based on the structured information of the road;
[0023] When the vehicle that has lost its track is associated with the road, the corresponding suspicious track is obtained.
[0024] Optionally, obtaining the suspicious vehicle corresponding to the suspicious track, and using a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result, includes:
[0025] Model the appearance features of the suspicious vehicles through the vehicle re-identification model;
[0026] Determine whether the suspicious vehicles corresponding to the suspicious tracks are the same vehicle;
[0027] The judgment result is used as the above appearance matching result.
[0028] Optionally, the tracking of the vehicle based on the suspicious trajectory and the appearance matching result includes:
[0029] When the suspicious vehicles corresponding to the suspicious tracks are the same vehicle, the vehicle ID of the suspicious vehicle is re-matched.
[0030] A second aspect of the present invention provides a vehicle tracking device, wherein the device comprises:
[0031] A video acquisition module, used to acquire continuous video frames containing vehicles;
[0032] A short-term tracking module, used to perform short-term tracking on the vehicle based on the continuous video frames to obtain short-term tracking results;
[0033] A trajectory prediction module is used to predict the trajectory of the vehicle based on the short-term tracking result to obtain vehicle trajectory information;
[0034] A suspicious trajectory acquisition module, used to acquire suspicious trajectories based on the above vehicle trajectory information;
[0035] An appearance matching module is used to obtain a suspicious vehicle corresponding to the suspicious track, and use a vehicle re-identification solution to match the appearance features of the suspicious vehicle to obtain an appearance matching result;
[0036] A tracking module is used to track the vehicle based on the suspicious trajectory and the appearance matching result.
[0037] Optionally, the short-term tracking module includes:
[0038] A continuous frame acquisition unit, used to acquire two continuous frames of the continuous video frames;
[0039] An offset vector obtaining unit, used to obtain an offset vector between the two consecutive frames;
[0040] The short-term tracking result obtaining unit is used to obtain the short-term tracking result based on the offset vector.
[0041] A third aspect of the present invention provides an intelligent terminal, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program implements the steps of any one of the above-mentioned vehicle tracking methods when executed by the processor.
[0042] A fourth aspect of the present invention provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned vehicle tracking methods are implemented.
[0043] As can be seen from the above, the scheme of the present invention obtains continuous video frames containing vehicles; based on the above continuous video frames, the above vehicle is short-term tracked to obtain short-term tracking results; based on the above short-term tracking results, the above vehicle is tracked and the vehicle track information is obtained; based on the above vehicle track information, a suspicious track is obtained; the suspicious vehicle corresponding to the above suspicious track is obtained, and the appearance feature matching of the above suspicious vehicle is performed using a vehicle re-identification scheme to obtain an appearance matching result; the vehicle is tracked based on the above suspicious track and the above appearance matching result. Since the scheme of the present invention obtains the short-term tracking result of the vehicle, and performs track prediction on the vehicle to obtain the vehicle track information, the suspicious vehicle is obtained according to the vehicle track information, and the appearance feature matching is performed on the suspicious vehicle, and the short-term tracking, track prediction and appearance feature matching are combined to achieve the tracking of the vehicle. Therefore, compared with the tracking scheme that separates detection and tracking in the prior art, this scheme can improve the real-time tracking, track vehicles within a long time range, and continuously track before and after the vehicle is blocked. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 It is a flow chart of a vehicle tracking method provided by an embodiment of the present invention;
[0046] Figure 2 Embodiment of the present invention Figure 1 Specific flow diagram of step S200;
[0047] Figure 3 It is a schematic diagram of a specific process of tracking multiple targets of a vehicle during a short-term tracking process provided by an embodiment of the present invention;
[0048] Figure 4 Embodiment of the present invention Figure 1 Specific flow diagram of step S400;
[0049] Figure 5 Embodiment of the present invention Figure 4 Specific flow diagram of step S402;
[0050] Figure 6 Embodiment of the present invention Figure 1 Detailed flow chart of step S500;
[0051] Figure 7 Schematic diagram of a re-identification model training framework provided by an embodiment of the present invention;
[0052] Figure 8 is a structural schematic diagram of a vehicle tracking device provided by an embodiment of the present invention;
[0053] Fig. 9 Embodiment of the present invention Figure 8 A schematic diagram of the specific structure of the short- to medium-term tracking module 820;
[0054] Fig.10 It is a block diagram of the internal structure principle of an intelligent terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0056] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0057] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0058] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0059] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0060] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0062] Target tracking refers to tracking the target object of interest in the target video, identifying the position of the target object from each image frame of the video, and then determining the motion trajectory of the target object in the video. This technology has been widely used in the fields of intelligent transportation, video surveillance, etc. With the rapid development of computer vision and image processing technology, relevant image processing and deep learning methods are applied to the front-end camera equipment or system, and the data collected by the camera is analyzed and processed in real time to obtain the corresponding vehicle tracking information, so that the corresponding abnormal events and vehicle flow can be analyzed in time, and then the corresponding early warning measures can be taken or reasonable scheduling can be carried out manually or automatically. This can effectively alleviate traffic congestion and reduce the probability of traffic accidents. Therefore, it is very necessary to use vehicle tracking for traffic control in congested traffic scenarios.
[0063] With the increase in the number and density of urban vehicles, the traffic environment is becoming more and more complex, so the difficulty of vehicle tracking is also increasing. The multi-target tracking methods in the prior art are all separated from detection and tracking, and are divided into multiple subtasks for processing. The basic process is to first detect the vehicle, then extract features, and then use the single target tracking method (such as Kalman filtering, Hungarian matching or linear assignment) to associate the detection frame. However, in congested traffic scenarios, such as intersections and other areas with high density of pedestrians and vehicles, the vehicle will stop for a long time or be blocked by large trucks, operating vehicles, branches, etc. in a short time during driving, which will cause the vehicle detection and tracking to fail. At the same time, the running speed of vehicles on urban roads can reach 60-100 kilometers per hour. The excessive speed and the occlusion of some areas of the vehicle will cause the appearance size of the vehicle to change greatly. The existing detection methods have poor detection performance for small targets or vehicles that only exist in some areas. Furthermore, the existing vehicle tracking methods take a long time to process multiple targets in a single picture, and the video processing frame rate cannot meet the real-time requirements.
[0064] In order to solve the problems in the prior art, the present invention provides a vehicle tracking method. In an embodiment of the present invention, when a vehicle is to be tracked, continuous video frames containing a vehicle are obtained; based on the continuous video frames, the vehicle is short-term tracked to obtain a short-term tracking result; based on the short-term tracking result, the vehicle is tracked to obtain vehicle track information; based on the vehicle track information, a suspicious track is obtained; a suspicious vehicle corresponding to the suspicious track is obtained, and the appearance feature matching of the suspicious vehicle is performed using a vehicle re-identification scheme to obtain an appearance matching result; and the vehicle is tracked based on the suspicious track and the appearance matching result. In this way, the short-term tracking result of the vehicle is obtained, and the vehicle track information is obtained by performing track prediction on the vehicle, and the suspicious vehicle is obtained according to the vehicle track information. The appearance feature matching is performed on the suspicious vehicle, and the vehicle is tracked by combining short-term tracking, track prediction and appearance feature matching. Therefore, compared with the tracking scheme in the prior art that separates detection and tracking, this scheme can improve the real-time tracking, track vehicles within a long range, and continuously track before and after the vehicle is blocked.
[0065] Exemplary Methods
[0066] like Figure 1 As shown, an embodiment of the present invention provides a vehicle tracking method, the method comprising the following steps:
[0067] Step S100, acquiring continuous video frames containing a vehicle.
[0068] Optionally, continuous video frames containing vehicles can be obtained based on cameras set at corresponding roads. For example, when tracking a vehicle at a certain intersection, continuous video frames containing vehicles can be obtained based on surveillance cameras set at the intersection.
[0069] Step S200: performing short-term tracking on the vehicle based on the continuous video frames to obtain a short-term tracking result.
[0070] Optionally, the short-term tracking can be implemented by a detection plus tracking method. Specifically, two consecutive frames in the continuous video frames can be obtained, and the offset difference between the two consecutive frames can be used as the associated input of the tracking, and an associated algorithm can be used to determine whether they are the same vehicle, thereby reducing the calculation time and improving the accuracy.
[0071] Step S300: Based on the short-term tracking result, the trajectory of the vehicle is predicted to obtain vehicle trajectory information.
[0072] Step S400, obtaining a suspicious trajectory based on the above vehicle trajectory information.
[0073] Optionally, trajectory prediction can be performed for all vehicles included in the above continuous frames and suspicious trajectories can be obtained. When only a specific vehicle needs to be tracked (for example, tracking down the vehicle causing an accident) during actual use, only the corresponding specific vehicle can be used as the tracking object, and no specific limitation is made here.
[0074] Step S500, obtaining a suspicious vehicle corresponding to the suspicious track, and using a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result.
[0075] Optionally, the above re-identification scheme adopts a multi-domain learning method, uses a small segment trajectory level re-ranking strategy with weighted features to post-process the results, and finally uses a multiple-model ensemble method to find the most similar vehicle area.
[0076] Step S600: Tracking the vehicle based on the suspicious trajectory and the appearance matching result.
[0077] As can be seen from the above, the vehicle tracking method provided by the embodiment of the present invention obtains continuous video frames containing vehicles; based on the above continuous video frames, the above vehicle is short-term tracked to obtain short-term tracking results; based on the above short-term tracking results, the above vehicle is tracked and the vehicle track information is obtained; based on the above vehicle track information, the suspicious track is obtained; the suspicious vehicle corresponding to the above suspicious track is obtained, and the appearance feature matching of the above suspicious vehicle is performed using the vehicle re-identification scheme to obtain the appearance matching result; the vehicle is tracked based on the above suspicious track and the above appearance matching result. Since the scheme of the present invention obtains the short-term tracking result of the vehicle, and performs track prediction on the vehicle to obtain the vehicle track information, the suspicious vehicle is obtained according to the vehicle track information, and the appearance feature matching is performed on the suspicious vehicle, and the short-term tracking, track prediction and appearance feature matching are combined to achieve the tracking of the vehicle. Therefore, compared with the tracking scheme that separates detection and tracking in the prior art, this scheme can improve the real-time tracking, track vehicles within a long time range, and continuously track before and after the vehicle is blocked.
[0078] Specifically, Figure 2 As shown, in this embodiment, the above step S200 includes:
[0079] Step S201, obtaining two consecutive frames of the above consecutive video frames.
[0080] Step S202, obtaining the offset vector between the two consecutive frames.
[0081] Step S203: acquiring the short-term tracking result based on the offset vector.
[0082] Optionally, after obtaining two consecutive frames, the center of the target is located based on the CenterNet detector, and the detector and the previous tracklet represented by points are placed on two consecutive frames. The detector is trained to output an offset vector between the center of the target in the current frame and the center of the target in the previous frame. This offset vector is then regarded as an attribute of the center point, and the need to associate the target object is met based only on the distance between the center point detected in the previous frame and the expected offset. In this way, tracking-based detection can be simplified. If each target in the previous frame is represented by a simple point, then multiple targets can be represented by a heat map containing multiple points. The tracking-based detector can directly extract this heat map and perform joint reasoning on them when associating targets in multiple frames. At the same time, cross-time target association can also be simplified. Simple displacement predictions such as sparse optical flow can connect targets in different frames. Displacement predictions are based on previous detection results. It can jointly detect targets in the current frame and associate them with previous detection results.
[0083] Specifically, the above continuous video frames are preprocessed, and at time t, the continuous current frame I is obtained.(t) ∈R WxHx3 and the previous frame I (t-1) ∈R WxHx3 The image is of type t, where W is the image width and H is the image height. Based on the CenterTrack multi-target detection tracker, the detection frame information of each vehicle in the previous frame image and the tracking target T are output. (t-1) = {b (t-1) 0,b (t -1) 1,......}, each tracking target is represented as b = (p, s, w, id), where p is the center point position of the tracking target, p∈R 2 ; s is the size of the tracking target, s∈R 2 ; w is the detection confidence, w∈[0,1]; id is the unique identity tag of the tracked target, id∈I. The CenterTrack model uses the detection results of the current frame and the previous frame {p (t-1) 0,p (t-1) 1,......} and a map rendered based on the center of the tracked target as input to generate the center detection map of the current frame, the target bounding box size map and an offset map H (t-1) =R({p (t-1) 0,p (t-1) 1,...}). Tracking-based detection provides a set of detection targets with temporal coherence, but it does not associate the detection results by time. Vehicle tracking will associate the previous and next frames based on the detection results. Based on the detection results of the previous frame and the detection results of the current frame, the offset value d^ of each pair of detection boxes is obtained. (t) =p^ (t) -p^ (t-1) , use the greedy matching algorithm or the Hungarian matching algorithm to associate the offset values of each pair of detection boxes mentioned above, and for each detection result at position p, associate it with the offset value at position pD p All detected detection frames are associated using the intersection-over-union ratio, and the associated detection frames are arranged in descending order according to the confidence w, where D p is the time when the last detection frame was located. Optionally, if there is no matching result within the preset radius range k, a new tracking piece is generated. Among them, k is a preset radius threshold. In this embodiment, k is set to the geometric mean of the width and height of the predicted bounding box of each tracking piece. In actual use, the value of k can be set according to actual needs, and no specific limitation is made here. In this way, the target is tracked as a point, and cross-time association of objects is achieved through simple displacement prediction. There is no need for complex distance measurement or graph matching, which is conducive to shortening the calculation time and improving the real-time performance of vehicle tracking.
[0084] Optional, Figure 3A specific flow chart of multi-target tracking of a vehicle in a short-term tracking process is shown, wherein NMS is non-maximum suppression, heatmap is a heat map of the position distribution of the center point of the detection frame, offset is the offset vector of the center point of the detection frame of the previous and next frames, hw is the width and height of the predicted detection frame centered on the key point, bbox is the detection frame obtained after vehicle detection, Item is each object corresponding to the detection output, track match is the detection pair that can be matched by vehicle tracking, dist is the suspicious detection frame pair corresponding to the target in N*2 dimensions, trackstate is the tracking result of the target corresponding to the current detection frame, and the second frame is a frame input later. In this embodiment, the second frame mentioned above is the current frame. Figure 3 As shown, during the short-term tracking process, the trajectory of the tracking target can be updated, whether a new ID needs to be assigned to the tracking target and the ID of each tracking target can be obtained.
[0085] Specifically, Figure 4 As shown, in this embodiment, the above step S400 includes:
[0086] Step S401, obtaining structured information of the road based on the above vehicle trajectory information.
[0087] Step S402: obtaining a suspicious trajectory based on the vehicle trajectory information and the structured information of the road.
[0088] Specifically, based on the matching results of steps S201 to S203 above, the position information of the detection box where each ID appears between consecutive frames can be obtained. Based on the above position information, the vehicle trajectory can be predicted and the corresponding vehicle trajectory information can be generated.
[0089] Optionally, based on the above vehicle trajectory information, the structured information of the road is obtained through cluster analysis. In this embodiment, a hierarchical Dirichlet process model is used for clustering to obtain the structured information of the road in the corresponding scenario. Specifically, the hierarchical Dirichlet process model used in this embodiment can not only automatically determine the number of clusters, but also model many groups of data. In this model, it is assumed that there are many groups of data, and each group of data has an unknown number of categories. The hierarchical Dirichlet model is to find the clustering results contained in each group of data. In the structured information of the road obtained, the clustering information of each road represents that there is a trajectory representing the lane in the direction of each lane, and the abnormality of the relevant vehicles can be judged based on this trajectory.
[0090] Specifically, Figure 5 As shown, in this embodiment, the above step S402 includes:
[0091] Step S4021, obtaining the vehicle whose track is lost based on the above vehicle track information.
[0092] Step S4022: determine whether the vehicle with lost track is associated with the road based on the structured information of the road.
[0093] The determining whether the vehicles that have lost their tracks have any correlation on the road is specifically determining whether the vehicles that have lost their tracks have any temporal correlation on the road.
[0094] Step S4023, when the vehicle that has lost its track is associated with the road, the corresponding suspicious track is obtained.
[0095] Among them, the above-mentioned suspicious trajectories are trajectories corresponding to suspicious vehicles with time series correlation.
[0096] Specifically, when a vehicle is blocked (such as a small car blocked by a large truck or blocked by the external environment), the vehicle track may be lost, that is, the vehicle switches ID. At this time, based on the above vehicle track information, it can be determined whether the corresponding track is likely to be the track of the same vehicle according to whether there is a time sequence correspondence between the track points of the vehicle before and after the ID switch.
[0097] In this embodiment, the trajectory with a time sequence correspondence is set as a suspicious trajectory, and the suspicious trajectory is represented by {[lost id0 ,track id0 ],[lost id1 ,track id1 ],[lost id2 ,track id2 ],[lost id3 ,track id3 ],[lost id4 ,track id4 ], ...}, where lost id Indicates the ID of the vehicle whose track was lost before, track id Indicates the ID of the currently tracked vehicle. Pairing them together indicates that the trajectories of the vehicles corresponding to the two IDs have a time-series correspondence relationship and may be the same vehicle. id Corresponding to multiple tracks id Or the same track id Corresponding to multiple lost id Phenomenon, for example, lost id0 and lost id1 The value is the same, but the corresponding track id0 and track id1 The values of are different, so many-to-many matching is required to determine the best match.
[0098] Specifically, Figure 6 As shown, in this embodiment, the above step S500 includes:
[0099] Step S501: Modeling the appearance characteristics of the suspicious vehicle using a vehicle re-identification model.
[0100] Step S502, determining whether the suspicious vehicles corresponding to the suspicious tracks are the same vehicle.
[0101] Step S503: taking the judgment result as the appearance matching result.
[0102] Optionally, based on the ID of the vehicle corresponding to the suspicious track, obtain the image information corresponding to the vehicle detection frame corresponding to the ID, that is,
[0103] {[box lostid0 ,box trackid0 ],[box lostid1 ,box trackid1 ],[box lostid2 ,box trackid2 ],[box lostid3 ,box trackid3 ],[box lostid4 ,box trackid4 ],......}, where box represents the vehicle image cut out of the corresponding frame of the suspicious trajectory ID detection box, such as box lostid0 Indicates the vehicle image cut out of the corresponding frame of the detection box corresponding to lostid0. id0 Indicates the same ID. For convenience, lost is used here. id0 Transformed to lostid0, similarly, trackid0 and track id0 Indicates the same ID. For convenience, track id0 Transformed to trackid0. The vehicle appearance information is used for modeling. The vehicle re-identification model used in this system is used for feature extraction. The re-identification model training method is as follows: ResNet50 is used as the model backbone, and it is modified for the ReID task. The step size of each layer in the last block is changed to 1, and a BN layer is added before the classification full connection layer; data enhancement strategy: random flipping, random cropping, and random erasing; training strategy: use the Adam optimizer to train the network for 150 epochs; the initial learning rate is 0.00035, and the learning rate is multiplied by 0.1 every 20 epochs; loss function: use cross entropy loss to train the classification layer, and use triplet loss to train the feature layer; license plate information fusion: calculate the license plate similarity S based on the license plate recognition resultplate , if the license plates are the same, the similarity is 1, otherwise it is 0; the calculation method of the overall image similarity S is as follows: S = S plate +S cnn , where S cnn is the cosine similarity of CNN features. Based on the above process, Figure 7 A re-identification model training framework in this embodiment is shown, wherein License Plate Recognition is license plate recognition, CNN Feature is CNN feature recognition, Information fusion is information fusion, Classification is classification, Cross entropy loss is cross entropy, which is used to measure the effort required to eliminate the uncertainty of the system using the strategy specified by the non-real distribution under a given real distribution, and Triplet loss is a triplet loss, which is used to make samples with the same label as close as possible in the embedding space, and to make samples with different labels as far away as possible in the embedding space. Furthermore, according to the vehicle picture cut out from the frame corresponding to the above suspicious ID detection frame, the vehicle re-identification model obtained through the above training is used to extract features to obtain each pair of suspicious tracks lost. id and track id The corresponding feature lost feature and track feature Finally, the cosine similarity is calculated based on the features, and each pair of features gets a similarity {Similarity id0 ,Similarity id1 ,Similarity id2 ,Similarity id3 ,Similarity id4 ,......}. At this time, matching is performed according to a preset similarity threshold. In this embodiment, the preset similarity threshold is 0.6, that is, if the Similarity is less than 0.6, no matching is performed. In actual use, the similarity threshold can be set according to needs, and no specific limitation is made here.
[0104] Based on the above suspicious trajectories and the above cosine similarity, {[lost id0 ,track id0 , Similarity id0 ],[lost id1 ,track id1 , Similarity id1 ],[lost id2 ,track id2, Similarity id2 ],[lost id3 ,track id3 , Similarity id3 ],[lost id4 ,track id4 , Similarity id4 ],......}, where n is the number of suspicious track pairs. Because there is a many-to-many phenomenon between the previously lost vehicles and the currently tracked vehicles in the queue, it is necessary to find the optimal ID matching result.
[0105] Optionally, sort the above queues in descending order according to Similarity, and get the lost corresponding to the largest Similarity in the first row. id and track id , which means that this pair has the highest similarity after matching based on appearance features, and is likely to be vehicles with the same ID. Then traverse the remaining queues to see if there is a lost corresponding to the maximum Similarity in the first row above. id and track id If the same value exists, the corresponding row will be deleted, because according to the optimal matching principle, only vehicles with the largest similarity can be similar. id0 ,track id0 , Similarity id0 ],[lost id2 ,track id2 , Similarity id2 ],[lost id3 ,track id3 , Similarity id3 ],......} represents the optimal one-to-one matching result between the final lost ID and the currently tracked ID.
[0106] Optionally, the above step S600 specifically includes: when the suspicious vehicle corresponding to the above suspicious track is the same vehicle, re-matching the vehicle ID of the above suspicious vehicle. Specifically, when it is determined based on the above matching that the suspicious vehicle corresponding to the suspicious track is the same vehicle, re-matching the vehicle ID of the current track corresponding to the vehicle. id Replace with the corresponding lost id ,The vehicle ID re-matching here is helpful to reduce the trajectory ID loss caused by occlusion during vehicle tracking, and can effectively perform ,long-term vehicle tracking.
[0107] Optionally, for normal tracks other than the above-mentioned suspicious tracks in the acquired vehicle track information, it means that there is no occlusion, and the corresponding vehicle can be directly tracked normally. In this way, long-term vehicle tracking can be achieved for both vehicles with occlusion and vehicles without occlusion.
[0108] Exemplary Devices
[0109] like Figure 8 As shown in , corresponding to the above vehicle tracking method, an embodiment of the present invention further provides a vehicle tracking device, and the above vehicle tracking device includes:
[0110] The video acquisition module 810 is used to acquire continuous video frames containing the vehicle.
[0111] Optionally, continuous video frames containing vehicles can be obtained based on cameras set at corresponding roads. For example, when tracking a vehicle at a certain intersection, continuous video frames containing vehicles can be obtained based on surveillance cameras set at the intersection.
[0112] The short-term tracking module 820 is used to perform short-term tracking on the vehicle based on the continuous video frames to obtain short-term tracking results.
[0113] Optionally, the short-term tracking can be implemented by a detection plus tracking method. Specifically, two consecutive frames in the continuous video frames can be obtained, and the offset difference between the two consecutive frames can be used as the associated input of the tracking, and an associated algorithm can be used to determine whether they are the same vehicle, thereby reducing the calculation time and improving the accuracy.
[0114] The trajectory prediction module 830 is used to perform trajectory prediction on the vehicle based on the short-term tracking result to obtain vehicle trajectory information.
[0115] The suspicious trajectory acquisition module 840 is used to acquire the suspicious trajectory based on the above vehicle trajectory information.
[0116] Optionally, trajectory prediction can be performed for all vehicles included in the above continuous frames and suspicious trajectories can be obtained. When only a specific vehicle needs to be tracked (for example, tracking down the vehicle causing an accident) during actual use, only the corresponding specific vehicle can be used as the tracking object, and no specific limitation is made here.
[0117] The appearance matching module 850 is used to obtain the suspicious vehicle corresponding to the suspicious track, and use a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result.
[0118] Optionally, the above re-identification scheme adopts a multi-domain learning method, uses a small segment trajectory level re-ranking strategy with weighted features to post-process the results, and finally uses a multiple-model ensemble method to find the most similar vehicle area.
[0119] The tracking module 860 is used to track the vehicle based on the suspicious trajectory and the appearance matching result.
[0120] As can be seen from the above, the vehicle tracking method provided by the embodiment of the present invention obtains continuous video frames containing vehicles through the video acquisition module 810; performs short-term tracking of the above-mentioned vehicle based on the above-mentioned continuous video frames through the short-term tracking module 820 to obtain short-term tracking results; performs trajectory prediction on the above-mentioned vehicle based on the above-mentioned short-term tracking results through the trajectory prediction module 830 to obtain vehicle trajectory information; obtains suspicious trajectories based on the above-mentioned vehicle trajectory information through the suspicious trajectory acquisition module 840; obtains suspicious vehicles corresponding to the above-mentioned suspicious trajectories through the appearance matching module 850, and uses the vehicle re-identification scheme to perform appearance feature matching on the above-mentioned suspicious vehicles to obtain appearance matching results; and realizes tracking of the vehicle based on the above-mentioned suspicious trajectories and the above-mentioned appearance matching results through the tracking module 860. Since the scheme of the present invention obtains the short-term tracking results of the vehicle, and performs trajectory prediction on the vehicle to obtain vehicle trajectory information, the suspicious vehicle is determined to be obtained according to the vehicle trajectory information, and appearance feature matching is performed on the suspicious vehicle, and the short-term tracking, trajectory prediction and appearance feature matching are combined to realize tracking of the vehicle. Therefore, compared with the tracking scheme in the prior art that separates detection and tracking, this scheme can improve the real-time tracking, track vehicles over a long period of time, and continuously track the vehicle before and after it is blocked.
[0121] Specifically, Fig. 9 As shown, in this embodiment, the short-term tracking module 820 includes:
[0122] The continuous frame acquisition unit 821 is used to acquire two continuous frames of the continuous video frames.
[0123] The offset vector obtaining unit 822 is used to obtain the offset vector between the two consecutive frames.
[0124] The short-term tracking result obtaining unit 823 is used to obtain the short-term tracking result based on the offset vector.
[0125] Optionally, after obtaining two consecutive frames, the center of the target is located based on the CenterNet detector, and the detector and the previous tracklet represented by points are placed on two consecutive frames. The detector is trained to output an offset vector between the center of the target in the current frame and the center of the target in the previous frame. This offset vector is then regarded as an attribute of the center point, and the need to associate the target object is met based only on the distance between the center point detected in the previous frame and the expected offset. In this way, tracking-based detection can be simplified. If each target in the previous frame is represented by a simple point, then multiple targets can be represented by a heat map containing multiple points. The tracking-based detector can directly extract this heat map and perform joint reasoning on them when associating targets in multiple frames. At the same time, cross-time target association can also be simplified. Simple displacement predictions such as sparse optical flow can connect targets in different frames. Displacement predictions are based on previous detection results. It can jointly detect targets in the current frame and associate them with previous detection results.
[0126] Specifically, the above continuous video frames are preprocessed, and at time t, the continuous current frame I is obtained. (t) ∈R WxHx3 and the previous frame I (t-1) ∈R WxHx3 The image is of type t, where W is the image width and H is the image height. Based on the CenterTrack multi-target detection tracker, the detection frame information of each vehicle in the previous frame image and the tracking target T are output. (t-1) = {b (t-1) 0,b (t -1) 1,......}, each tracking target is represented as b = (p, s, w, id), where p is the center point position of the tracking target, p∈R 2 ; s is the size of the tracking target, s∈R 2 ; w is the detection confidence, w∈[0,1]; id is the unique identity tag of the tracked target, id∈I. The CenterTrack model uses the detection results of the current frame and the previous frame {p (t-1) 0,p (t-1) 1,......} and a map rendered based on the center of the tracked target as input to generate the center detection map of the current frame, the target bounding box size map and an offset map H (t-1) =R({p (t-1) 0,p (t-1) 1,...}). Tracking-based detection provides a set of detection targets with temporal coherence, but it does not associate the detection results by time. Vehicle tracking will associate the previous and next frames based on the detection results. Based on the detection results of the previous frame and the detection results of the current frame, the offset value d^ of each pair of detection boxes is obtained. (t) =p^(t) -p^ (t-1) , use the greedy matching algorithm or the Hungarian matching algorithm to associate the offset values of each pair of detection frames mentioned above. For each detection result at position p, associate it with all detected detection frames using the intersection and union ratio, and arrange the associated detection frames in descending order according to the confidence w, where D p is the time when the last detection frame was located. Optionally, if there is no matching result within the preset radius range k, a new tracking piece is generated. Among them, k is a preset radius threshold. In this embodiment, k is set to the geometric mean of the width and height of the predicted bounding box of each tracking piece. In actual use, the value of k can be set according to actual needs, and no specific limitation is made here. In this way, the target is tracked as a point, and cross-time association of objects is achieved through simple displacement prediction. There is no need for complex distance measurement or graph matching, which is conducive to shortening the calculation time and improving the real-time performance of vehicle tracking.
[0127] Optional, Figure 3 The figure shows a specific flow chart of multi-target tracking of a vehicle in a short-term tracking process, wherein NMS is non-maximum suppression, heatmap is a heat map of the position distribution of the center point of the detection frame, offset is the offset vector of the center point of the detection frame of the previous and next frames, hw is the width and height of the detection frame predicted to be centered on the key point, bbox is the detection frame obtained after vehicle detection, Item is each object corresponding to the detection output, track match is the detection pair that can be matched by vehicle tracking, dist is the detection pair that can be matched by vehicle tracking, trackstate is the tracking result of the target corresponding to the current detection frame, and the second frame is a frame input later. In this embodiment, the second frame is the current frame. Figure 3 As shown, during the short-term tracking process, the trajectory of the tracking target can be updated, whether a new ID needs to be assigned to the tracking target and the ID of each tracking target can be obtained.
[0128] Optionally, the suspicious trajectory acquisition module 840 is specifically used to: acquire structured information of the road based on the vehicle trajectory information; acquire a suspicious trajectory based on the vehicle trajectory information and the structured information of the road.
[0129] Specifically, based on the matching result of the short-term tracking module 820, the position information of the detection frame where each ID appears between consecutive frames can be obtained. Based on the position information, the vehicle trajectory can be predicted and the corresponding vehicle trajectory information can be generated.
[0130] Optionally, based on the above vehicle trajectory information, the structured information of the road is obtained through cluster analysis. In this embodiment, a hierarchical Dirichlet process model is used for clustering to obtain the structured information of the road in the corresponding scenario. Specifically, the hierarchical Dirichlet process model used in this embodiment can not only automatically determine the number of clusters, but also model many groups of data. In this model, it is assumed that there are many groups of data, and each group of data has an unknown number of categories. The hierarchical Dirichlet model is to find the clustering results contained in each group of data. In the structured information of the road obtained, the clustering information of each road represents that there is a trajectory representing the lane in the direction of each lane, and the abnormality of the relevant vehicles can be judged based on this trajectory.
[0131] Furthermore, the above-mentioned suspicious trajectory acquisition module 840 can also be specifically used to: acquire the vehicle with lost trajectory based on the above-mentioned vehicle trajectory information; determine whether the above-mentioned vehicle with lost trajectory has any connection on the above-mentioned road based on the structured information of the above-mentioned road; when the above-mentioned vehicle with lost trajectory has any connection on the above-mentioned road, acquire the corresponding suspicious trajectory.
[0132] The determining whether the vehicles that have lost their tracks have any correlation on the road is specifically determining whether the vehicles that have lost their tracks have any temporal correlation on the road.
[0133] Among them, the above-mentioned suspicious trajectories are trajectories corresponding to suspicious vehicles with time series correlation.
[0134] Specifically, when a vehicle is blocked (such as a small car blocked by a large truck or blocked by the external environment), the vehicle track may be lost, that is, the vehicle switches ID. At this time, based on the above vehicle track information, it can be determined whether the corresponding track is likely to be the track of the same vehicle according to whether there is a time sequence correspondence between the track points of the vehicle before and after the ID switch.
[0135] In this embodiment, the trajectory with a time sequence correspondence is set as a suspicious trajectory, and the suspicious trajectory is represented by {[lost id0 ,track id0 ],[lost id1 ,track id1 ],[lost id2 ,track id2 ],[lost id3 ,track id3 ],[lost id4 ,track id4 ], ...}, where lost id Indicates the ID of the vehicle whose track was lost before, track idIndicates the ID of the currently tracked vehicle. Pairing them together indicates that the trajectories of the vehicles corresponding to the two IDs have a time-series correspondence relationship and may be the same vehicle. id Corresponding to multiple tracks id Or the same track id Corresponding to multiple lost id Phenomenon, for example, lost id0 and lost id1 The value is the same, but the corresponding track id0 and track id1 The values of are different, so many-to-many matching is required to determine the best match.
[0136] Optionally, the appearance matching module 850 is specifically used to: model the appearance features of the suspicious vehicle through a vehicle re-identification model; determine whether the suspicious vehicles corresponding to the suspicious tracks are the same vehicle; and use the determination result as the appearance matching result.
[0137] Optionally, based on the ID of the vehicle corresponding to the suspicious trajectory, obtain the image information corresponding to the vehicle detection box corresponding to the ID, that is, {[box lostid0 ,box trackid0 ],[box lostid1 ,box trackid1 ],[box lostid2 ,box trackid2 ],[box lostid3 ,box trackid3 ],[box lostid4 ,box trackid4 ],......}, where box represents the vehicle image cut out of the corresponding frame of the suspicious trajectory ID detection box, such as box lostid0 Indicates the vehicle image cut out of the corresponding frame of the detection box corresponding to lostid0. id0 Indicates the same ID. For convenience, lost is used here. id0 Transformed to lostid0, similarly, trackid0 and track id0 Indicates the same ID. For convenience, track id0Transformed to trackid0. The vehicle appearance information is used for modeling. The vehicle re-identification model used in this system is used for feature extraction. The re-identification model training method is as follows: ResNet50 is used as the model backbone, and it is modified for the ReID task. The step size of each layer in the last block is changed to 1, and a BN layer is added before the classification full connection layer; data enhancement strategy: random flipping, random cropping, and random erasing; training strategy: use the Adam optimizer to train the network for 150 epochs; the initial learning rate is 0.00035, and the learning rate is multiplied by 0.1 every 20 epochs; loss function: use cross entropy loss to train the classification layer, and use triplet loss to train the feature layer; license plate information fusion: calculate the license plate similarity S based on the license plate recognition result plate , if the license plates are the same, the similarity is 1, otherwise it is 0; the calculation method of the overall image similarity S is as follows: S = S plate +S cnn , where S cnn is the cosine similarity of CNN features. Based on the above process, Figure 7 A re-identification model training framework in this embodiment is shown, wherein License Plate Recognition is license plate recognition, CNN Feature is CNN feature recognition, Information fusion is information fusion, Classification is classification, Cross entropy loss is cross entropy, which is used to measure the effort required to eliminate the uncertainty of the system using the strategy specified by the non-real distribution under a given real distribution, and Triplet loss is a triplet loss, which is used to make samples with the same label as close as possible in the embedding space, and to make samples with different labels as far away as possible in the embedding space. Furthermore, according to the vehicle picture cut out from the frame corresponding to the above suspicious ID detection frame, the vehicle re-identification model obtained through the above training is used to extract features to obtain each pair of suspicious tracks lost. id and track id The corresponding feature lost feature and track feature Finally, the cosine similarity is calculated based on the features, and each pair of features gets a similarity {Similarity id0 ,Similarity id1 ,Similarity id2 ,Similarity id3 ,Similarity id4,......}. At this time, matching is performed according to a preset similarity threshold. In this embodiment, the preset similarity threshold is 0.6, that is, if the Similarity is less than 0.6, no matching is performed. In actual use, the similarity threshold can be set according to needs, and no specific limitation is made here.
[0138] Based on the above suspicious trajectories and the above cosine similarity, {[lost id0 ,track id0 , Similarity id0 ],[lost id1 ,track id1 , Similarity id1 ],[lost id2 ,track id2 , Similarity id2 ],[lost id3 ,track id3 , Similarity id3 ],[lost id4 ,track id4 , Similarity id4 ],......}, where n is the number of suspicious track pairs. Because there is a many-to-many phenomenon between the previously lost vehicles and the currently tracked vehicles in the queue, it is necessary to find the optimal ID matching result.
[0139] Optionally, sort the above queues in descending order according to Similarity, and get the lost corresponding to the largest Similarity in the first row. id and track id , which means that this pair has the highest similarity after matching based on appearance features, and is likely to be vehicles with the same ID. Then traverse the remaining queues to see if there is a lost corresponding to the maximum Similarity in the first row above. id and track id If the same value exists, the corresponding row will be deleted, because according to the optimal matching principle, only vehicles with the largest similarity can be similar. id0 ,track id0 , Similarity id0 ],[lost id2 ,track id2 , Similarity id2 ],[lost id3 ,track id3 , Similarity id3],......} represents the optimal one-to-one matching result between the final lost ID and the currently tracked ID.
[0140] Optionally, the tracking module 860 is specifically used to: when the suspicious vehicle corresponding to the suspicious track is the same vehicle, re-match the vehicle ID of the suspicious vehicle. Specifically, when it is determined based on the matching that the suspicious vehicle corresponding to the suspicious track is the same vehicle, the current track ID of the vehicle corresponding to the suspicious vehicle is re-matched. id Replace with the corresponding lost id ,The vehicle ID re-matching here is helpful to reduce the trajectory ID loss caused by occlusion during vehicle tracking, and can effectively perform ,long-term vehicle tracking.
[0141] Optionally, for normal tracks other than the above-mentioned suspicious tracks in the acquired vehicle track information, it means that there is no occlusion, and the corresponding vehicle can be directly tracked normally. In this way, long-term vehicle tracking can be achieved for both vehicles with occlusion and vehicles without occlusion.
[0142] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Fig.10 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps of any one of the above-mentioned vehicle tracking methods are implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0143] Those skilled in the art will understand that Fig.10 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In one embodiment, a smart terminal is provided, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program performs the following operation instructions when executed by the processor:
[0145] Obtaining continuous video frames containing the vehicle;
[0146] Perform short-term tracking on the vehicle based on the continuous video frames to obtain a short-term tracking result;
[0147] Based on the short-term tracking results, the vehicle trajectory is predicted to obtain vehicle trajectory information;
[0148] Obtaining a suspicious trajectory based on the above vehicle trajectory information;
[0149] Obtaining a suspicious vehicle corresponding to the suspicious trajectory, and using a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result;
[0150] The vehicle is tracked based on the suspicious track and the appearance matching result. The present invention also provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any vehicle tracking method provided by the present invention are implemented.
[0151] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0152] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0153] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. For quantities with the same expression form in various formulas, unless otherwise specified, they represent the same quantity, and various formulas can refer to each other.
[0154] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and method can be implemented in other ways. For example, the apparatus / terminal equipment embodiments described above are only illustrative, for example, the division of the above modules or units is only a logical function division, and in actual implementation, other division methods can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0156] If the above-mentioned integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0157] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features therein may be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A vehicle tracking method, characterized in that: The method comprises: Obtaining continuous video frames containing the vehicle; Performing short-term tracking on the vehicle based on the continuous video frames to obtain a short-term tracking result; Based on the short-term tracking result, predict the trajectory of the vehicle to obtain vehicle trajectory information; Acquire a suspicious trajectory based on the vehicle trajectory information; Obtaining a suspicious vehicle corresponding to the suspicious track, and performing appearance feature matching on the suspicious vehicle using a vehicle re-identification solution to obtain an appearance matching result; Tracking the vehicle based on the suspicious trajectory and the appearance matching result; The short-term tracking of the vehicle based on the continuous video frames to obtain a short-term tracking result includes: obtaining two consecutive frames in the continuous video frames; obtaining an offset vector between the two consecutive frames; and obtaining the short-term tracking result based on the offset vector; The obtaining of suspicious trajectories based on the vehicle trajectory information includes: obtaining structured information of roads through cluster analysis based on the vehicle trajectory information; obtaining suspicious trajectories based on the vehicle trajectory information and the structured information of the roads; The method of obtaining a suspicious trajectory based on the vehicle trajectory information and the structured information of the road includes: obtaining a vehicle with a lost trajectory based on the vehicle trajectory information; judging whether the vehicle with the lost trajectory has a time sequence correlation on the road based on the structured information of the road; and obtaining a corresponding suspicious trajectory when the vehicle with the lost trajectory has a time sequence correlation on the road; wherein, based on the vehicle trajectory information, judging whether the corresponding trajectory is the trajectory of the same vehicle based on whether there is a time sequence correspondence between the trajectory points of the vehicle before and after the vehicle switches its ID, so as to determine whether the vehicle with the lost trajectory has a time sequence correlation on the road, and setting the trajectory with a time sequence correspondence as the suspicious trajectory.
2. The vehicle tracking method according to claim 1, characterized in that: The obtaining of the suspicious vehicle corresponding to the suspicious track, and performing appearance feature matching on the suspicious vehicle using a vehicle re-identification solution to obtain an appearance matching result, includes: Modeling the appearance features of the suspicious vehicle using a vehicle re-identification model; Determining whether the suspicious vehicles corresponding to the suspicious tracks are the same vehicle; The judgment result is used as the appearance matching result.
3. The vehicle tracking method according to claim 2, characterized in that: The tracking of the vehicle based on the suspicious trajectory and the appearance matching result includes: When the suspicious vehicle corresponding to the suspicious track is the same vehicle, the vehicle ID of the suspicious vehicle is re-matched.
4. A vehicle tracking device, characterized in that: The device comprises: A video acquisition module, used to acquire continuous video frames containing vehicles; A short-term tracking module, used for performing short-term tracking on the vehicle based on the continuous video frames to obtain a short-term tracking result; A trajectory prediction module, used to predict the trajectory of the vehicle based on the short-term tracking result and obtain vehicle trajectory information; A suspicious trajectory acquisition module, used to acquire a suspicious trajectory based on the vehicle trajectory information; An appearance matching module is used to obtain a suspicious vehicle corresponding to the suspicious track, and use a vehicle re-identification solution to perform appearance feature matching on the suspicious vehicle to obtain an appearance matching result; A tracking module, used to track the vehicle based on the suspicious trajectory and the appearance matching result; The short-term tracking module includes: a continuous frame acquisition unit, used to acquire two consecutive frames in the continuous video frames; an offset vector acquisition unit, used to acquire an offset vector between the two consecutive frames; a short-term tracking result acquisition unit, used to acquire the short-term tracking result based on the offset vector; The trajectory prediction module is specifically used to: obtain structured information of the road through cluster analysis based on the vehicle trajectory information; obtain suspicious trajectory based on the vehicle trajectory information and the structured information of the road; The suspicious trajectory acquisition module is specifically used to: acquire the vehicle with lost trajectory based on the vehicle trajectory information; determine whether the vehicle with lost trajectory has a time sequence correlation on the road based on the structured information of the road; when the vehicle with lost trajectory has a time sequence correlation on the road, acquire the corresponding suspicious trajectory; wherein, based on the vehicle trajectory information, determine whether the corresponding trajectory is the trajectory of the same vehicle according to whether there is a time sequence correspondence between the trajectory points of the vehicle before and after the vehicle with lost trajectory switches its ID, so as to determine whether the vehicle with lost trajectory has a time sequence correlation on the road, and set the trajectory with a time sequence correspondence as the suspicious trajectory.
5. An intelligent terminal, characterized in that: The method comprises a memory, a processor and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 3.
6. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Video synopsis generation method capable of solving multi-target collision and occlusion problem
CN106856577A
Active detection vehicle continuous tracking breakpoint compensation device, system and method
CN111257864A
Lane position identification method and device
CN111325187A
Lane marker projection method for a motor vehicle vision system
US7050908B1
Travelling trajectory estimation method and travelling trajectory estimation apparatus
WO2018037508A1
