Method and device for target tracking and storage medium
A method for multi-target multi-camera tracking includes: performing multi-target tracking on a video captured by each of multiple cameras, to extract a tracklet for each target appearing in the video, wherein multiple tracklets for multiple targets are extracted on the basis of multiple videos; extracting a feature for each tracklet; determining orientation of each tracklet based on orientation of the target relative to the camera; dividing the multiple tracklets into multiple groups based on the determined orientations; performing clustering on tracklets in each group based on the extracted features, such that tracklets corresponding to the same target are aggregated into an initial set; performing merging among initial sets obtained by performing clustering on respective groups, such that tracklets corresponding to the same target and having different orientations are merged into a final set; and using the tracklets in the final set as tracking information for the corresponding target.
1 . A method for multi-target multi-camera tracking, comprising:
performing multi-target tracking on an image sequence captured by each of a plurality of cameras that capture different scenes respectively, to extract a tracklet for each target appearing in the image sequence, wherein a plurality of tracklets for a plurality of targets are extracted on the basis of a plurality of image sequences captured by the plurality of cameras;
extracting a feature for each tracklet;
determining an orientation of each tracklet based on an orientation of the target relative to the camera in the tracklet;
dividing the plurality of tracklets into a plurality of groups based on the determined orientations, wherein tracklets in a same group have a same orientation, and tracklets in different groups have different orientations;
performing clustering on tracklets in each group based on the extracted features, such that tracklets corresponding to a same target are aggregated into an initial set;
performing merging among a plurality of initial sets obtained by performing clustering on the plurality of groups respectively, such that tracklets corresponding to the same target and having different orientations are merged into a final set; and
using the tracklets in the final set as tracking information for the corresponding target,
wherein each tracklet is a set of target boxes that identify the target in a plurality of frames of the image sequence respectively,
the method further comprising:
determining the orientation of the target in each of the target boxes relative to the camera;
when the number of target boxes in which the orientation of the target is a specific orientation is larger than a first threshold, determining that the orientation of the tracklet is the specific orientation; or
when the number of target boxes in which the orientation of the target is a specific orientation is larger than the number of target boxes in which the orientation of the target is any other orientation, determining that the orientation of the tracklet is the specific orientation.
2 . The method according to claim 1 , wherein the orientation of the target relative to the camera is one of front, back, and sideways.
3 . The method according to claim 1 , wherein each tracklet can be determined to have one or more orientations, and the tracklet can be included in one or more of the plurality of groups.
4 . The method according to claim 3 , further comprising:
establishing a matrix, wherein an element value of the matrix is the number of identical tracklets included in both of the following two initial sets: an i-th initial set obtained by performing clustering on a first group corresponding to a first orientation, and an j-th initial set obtained by performing clustering on a second group corresponding to a second orientation, wherein i=1, 2, . . . , M, j=1, 2, . . . , N, and M and N are natural numbers.
5 . The method according to claim 4 , further comprising:
determining a maximum value among the element values of the matrix; and
not performing merging among the initial sets when the maximum value is zero.
6 . The method according to claim 4 , further comprising:
determining a maximum value among the element values of the matrix; and
when the maximum value is not zero,
a) merging an initial set derived from the first group and an initial set derived from the second group that correspond to the maximum value into one set;
b) setting element values on a row and a column where the maximum value is located in the matrix to zero;
c) determining a maximum value among element values of the modified matrix; and
d) iteratively performing the steps a) to c), until the maximum value among the element values of the matrix is zero.
7 . The method according to claim 6 , wherein K initial sets are obtained by performing clustering on a third group corresponding to a third orientation,
the method further comprising: after performing merging between the M initial sets derived from the first group and the N initial sets derived from the second group, performing merging between the resulted sets and the K initial sets derived from the third group.
8 . A non-transitory computer-readable storage medium storing a program that, when executed by a computer, causes the computer to perform the method for multi-target multi-camera tracking according to claim 1 .
9 . The method according to claim 1 , wherein extracting the feature for each tracklet comprises using pedestrian re-identification (Re-ID) technology.
10 . The method according to claim 9 , wherein the feature of the tracklet is a set of features of the respective target boxes.
11 . The method according to claim 1 , wherein performing clustering on tracklets includes using an agglomerative clustering method.
12 . The method according to claim 1 , wherein determining the orientation of the target includes using an attribute recognition model.
13 . The method according to claim 1 , wherein determining the orientation of the target includes using a zero-sample method based on a trained large model.
14 . The method according to claim 1 , wherein performing merging among the plurality of initial sets includes:
performing merging on initial sets of two groups to obtain a merged set; and
merging the merged set with initial sets of a remaining group.
15 . The method according to claim 14 , wherein the two groups correspond to a front orientation and a back orientation, and the remaining group corresponds to a sideways orientation.
16 . The method according to claim 1 , wherein a specific tracklet is determined to have multiple orientations and is assigned to multiple groups.
17 . The method according to claim 1 , wherein determining the orientation of the target comprises using a supervised training method.
18 . A device for multi-target multi-camera tracking, comprising:
a memory storing a computer program; and
a processor configured to execute the computer program to perform operations of:
performing multi-target tracking on an image sequence captured by each of a plurality of cameras that capture different scenes respectively, to extract a tracklet for each target appearing in the image sequence, wherein a plurality of tracklets for a plurality of targets are extracted on the basis of a plurality of image sequences captured by the plurality of cameras;
extracting a feature for each tracklet;
determining an orientation of each tracklet based on an orientation of the target relative to the camera in the tracklet;
dividing the plurality of tracklets into a plurality of groups based on the determined orientations, wherein tracklets in a same group have a same orientation, and tracklets in different groups have different orientations;
performing clustering on tracklets in each group based on the extracted features, such that tracklets corresponding to a same target are aggregated into an initial set;
performing merging among a plurality of initial sets obtained by performing clustering on the plurality of groups respectively, such that tracklets corresponding to the same target and having different orientations are merged into a final set; and
using the tracklets in the final set as tracking information for the corresponding target,
wherein each tracklet is a set of target boxes that identify the target in a plurality of frames of the image sequence respectively,
the method further comprising:
determining the orientation of the target in each of the target boxes relative to the camera;
when the number of target boxes in which the orientation of the target is a specific orientation is larger than a first threshold, determining that the orientation of the tracklet is the specific orientation; or
when the number of target boxes in which the orientation of the target is a specific orientation is larger than the number of target boxes in which the orientation of the target is any other orientation, determining that the orientation of the tracklet is the specific orientation.
19 . The device according to claim 18 , wherein the processor is configured to extract the feature for each tracklet using pedestrian re-identification (Re-ID) technology.
20 . The device according to claim 18 , wherein the processor is configured to perform clustering on tracklets using an agglomerative clustering method.