main content

multi-凯发k8网页登录

multi-target tracker using gnn assignment

since r2021a

description

the radartracker system object™ initializes, confirms, predicts, corrects, and deletes the tracks of moving objects. inputs to the radar tracker are detection reports generated as an object by radar sensors. the radar tracker accepts detections from multiple sensors and assigns them to tracks using a global nearest neighbor (gnn) criterion. each detection is assigned to a separate track. if the detection cannot be assigned to any track, based on the assignmentthreshold property, the tracker creates a new track. the tracks are returned in a structure array.

a new track starts in a tentative state. if enough detections are assigned to a tentative track, its status changes to confirmed. if the detection is a known classification (the objectclassid field of the returned track is nonzero), that track can be confirmed immediately. for details on the radar tracker properties used to confirm tracks, see algorithms.

when a track is confirmed, the radar tracker considers that track to represent a physical object. if detections are not added to the track within a specifiable number of updates, the track is deleted.

the tracker also estimates the state vector and state vector covariance matrix for each track using a kalman filter. these state vectors are used to predict a track's location in each frame and determine the likelihood of each detection being assigned to each track.

to track objects using a radar tracker:

  1. create the radartracker object and set its properties.

  2. call the object with arguments, as if it were a function.

to learn more about how system objects work, see what are system objects?

creation

description

tracker = radartracker creates a radartracker system object with default property values.

example

tracker = radartracker(name,value) sets properties for the radar tracker using one or more name-value pairs. for example, radartracker('filterinitializationfcn',@initcvukf,'maxnumtracks',100) creates a radar tracker that uses a constant-velocity, unscented kalman filter and maintains a maximum of 100 tracks. enclose each property name in quotes.

properties

unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. objects lock when you call them, and the function unlocks them.

if a property is tunable, you can change its value at any time.

for more information on changing property values, see .

unique tracker identifier, specified as a nonnegative integer. this property is used as the sourceindex in the tracker outputs, and distinguishes tracks that come from different trackers in a multiple-tracker system.

example: 1

kalman filter initialization function, specified as a function handle or as a character vector or string scalar of the name of a valid kalman filter initialization function.

the toolbox supplies several initialization functions that you can use to specify filterinitializationfcn.

initialization functionfunction definition
initialize constant-velocity extended kalman filter.
initialize constant-velocity linear kalman filter.
initialize constant-velocity unscented kalman filter.
initialize constant-acceleration extended kalman filter.
initialize constant-acceleration linear kalman filter.
initialize constant-acceleration unscented kalman filter.
initialize constant-turnrate extended kalman filter.
initialize constant-turnrate unscented kalman filter.

you can also write your own initialization function. the input to this function must be a detection report created by . the output of this function must be a kalman filter object: , , or . to guide you in writing this function, you can examine the details of the supplied functions from within matlab®. for example:

type initcvkf

data types: function_handle | char | string

detection assignment threshold (or gating threshold), specified as a positive scalar or an 1-by-2 vector of [c1,c2], where c1c2. if specified as a scalar, the specified value, val, will be expanded to [val, inf].

initially, the tracker executes a coarse estimation for the normalized distance between all the tracks and detections. the tracker only calculates the accurate normalized distance for the combinations whose coarse normalized distance is less than c2. also, the tracker can only assign a detection to a track if their accurate normalized distance is less than c1. see the distance function used with tracking filters (for example, ) for an explanation of the distance calculation.

tips:

  • increase the value of c2 if there are combinations of track and detection that should be calculated for assignment but are not. decrease it if cost calculation takes too much time.

  • increase the value of c1 if there are detections that should be assigned to tracks but are not. decrease it if there are detections that are assigned to tracks they should not be assigned to (too far away).

maximum number of tracks that the tracker can maintain, specified as a positive integer.

data types: double

maximum number of sensors that can be connected to the tracker, specified as a positive integer. when you specify detections as input to the radar tracker, maxnumsensors must be greater than or equal to the highest sensorindex value in the detections cell array of objects used to update the radar tracker. this property determines how many sets of objectattributes fields each output track can have.

data types: double

maximum number of detections that the tracker can take as inputs, specified as a positive integer.

data types: single | double

out-of-sequence measurements handling, specified as terminate or neglect. each detection has a timestamp associated with it, td, and the tracker block has it own timestamp, tt, which is updated in each invocation. the tracker block considers a measurement as an oosm if td < tt.

when the parameter is specified as:

  • terminate — the block stops running when it encounters any out-of-sequence measurements.

  • neglect — the block neglects any out-of-sequence measurements and continue to run.

threshold for track confirmation, specified as a two-element vector of non-decreasing positive integers, [m n], where m is less than or equal to n. a track is confirmed if it receives at least m detections in the last n updates.

  • when setting m, take into account the probability of object detection for the sensors. the probability of detection depends on factors such as occlusion or clutter. you can reduce m when tracks fail to be confirmed or increase m when too many false detections are assigned to tracks.

  • when setting n, consider the number of times you want the tracker to update before it makes a confirmation decision. for example, if a tracker updates every 0.05 seconds, and you allow 0.5 seconds to make a confirmation decision, set n = 10.

example: [3 5]

data types: double

threshold for track deletion, specified as a two-element vector of positive non-decreasing integers [p q], where p is less than or equal to q. if a confirmed track is not assigned to any detection p times in the last q tracker updates, then the track is deleted.

  • decrease q (or increase p) if tracks should be deleted earlier.

  • increase q (or decrease p) if tracks should be kept for a longer time before deletion.

example: [3 5]

data types: single | double

enable a cost matrix as input to the radartracker system object, specified as false or true.

data types: logical

enable the input of detectable track ids at each object update, specified as false or true. set this property to true if you want to provide a list of detectable track ids. this list tells the tracker of all tracks that the sensors are expected to detect and, optionally, the probability of detection for each track.

data types: logical

parameters of the track state reference frame, specified as a struct or a struct array. use this property to define the track state reference frame and how to transform the track from the tracker (called source) coordinate system to the fuser coordinate system.

this property is tunable.

data types: struct

this property is read-only.

number of tracks maintained by the radar tracker, specified as a nonnegative integer.

data types: double

this property is read-only.

number of confirmed tracks, specified as a nonnegative integer. the isconfirmed fields of the output track structures indicate which tracks are confirmed.

data types: double

usage

description

confirmedtracks = tracker(detections,time) creates, updates, and deletes tracks in the radar tracker and returns details about the confirmed tracks. updates are based on the specified list of detections, and all tracks are updated to the specified time. each element in the returned confirmedtracks corresponds to a single track.

[confirmedtracks,tentativetracks] = tracker(detections,time) also returns tentativetracks containing details about the tentative tracks.

example

[confirmedtracks,tentativetracks,alltracks] = tracker(detections,time) also returns alltracks containing details about all the confirmed and tentative tracks. the tracks are returned in the order by which the tracker internally maintains them. you can use this output to help you calculate the cost matrix, an optional input argument.

[___] = tracker(detections,time,costmatrix) specifies a cost matrix, returning any of the outputs from preceding syntaxes.

to specify a cost matrix, set the hascostmatrixinput property of the tracker to true.

[___] = tracker(___,detectabletrackids) also specifies a list of expected detectable tracks given by detectabletrackids. this argument can be used with any of the previous input syntaxes.

to enable this syntax, set the hasdetectabletrackidsinput property to true.

input arguments

detection list, specified as a cell array of objects. the time property value of each objectdetection object must be less than or equal to the current time of update, time, and greater than the previous time value used to update the multi-object tracker.

time of update, specified as a real scalar. the tracker updates all tracks to this time. units are in seconds.

time must be greater than or equal to the largest time property value of the objects in the input detections list. time must increase in value with each update to the multi-object tracker.

data types: double

cost matrix, specified as a real-valued nt-by-nd matrix, where nt is the number of existing tracks, and nd is the number of current detections. the rows of the cost matrix correspond to the existing tracks. the columns correspond to the detections. tracks are ordered as they appear in the list of tracks in the alltracks output argument of the previous update to the multi-object tracker.

in the first update to the multi-object tracker, or when the tracker has no previous tracks, assign the cost matrix a size of [0, nd]. the cost must be calculated so that lower costs indicate a higher likelihood that the tracker assigns a detection to a track. to prevent certain detections from being assigned to certain tracks, use inf.

dependencies

to enable specification of the cost matrix when updating tracks, set the hascostmatrixinput property of the tracker to true

data types: double

detectable track ids, specified as a real-valued m-by-1 vector or m-by-2 matrix. detectable tracks are tracks that the sensors expect to detect. the first column of the matrix contains a list of track ids that the sensors report as detectable. the optional second column contains the detection probability for the track. the detection probability is either reported by a sensor or, if not reported, obtained from the detectionprobability property.

tracks whose identifiers are not included in detectabletrackids are considered as undetectable. the track deletion logic does not count the lack of detection as a 'missed detection' for track deletion purposes.

dependencies

to enable this input argument, set the detectabletrackids property to true.

data types: single | double

output arguments

confirmed tracks, returned as an array of objects in matlab, and returned as an array of structures in code generation. in code generation, the field names of the returned structure are same with the property names of objecttrack.

a track is confirmed if it satisfies the confirmation threshold specified in the confirmationthreshold property. in that case, the isconfirmed property of the object or field of the structure is true.

data types: struct | object

tentative tracks, returned as an array of objects in matlab, and returned as an array of structures in code generation. in code generation, the field names of the returned structure are same with the property names of objecttrack.

a track is tentative if it does not satisfy the confirmation threshold specified in the confirmationthreshold property. in that case, the isconfirmed property of the object or field of the structure is false.

data types: struct | object

all tracks, returned as an array of objects in matlab, and returned as an array of structures in code generation. in code generation, the field names of the returned structure are same with the property names of objecttrack. all tracks consists of confirmed and tentative tracks.

data types: struct | object

object functions

to use an object function, specify the system object as the first input argument. for example, to release system resources of a system object named obj, use this syntax:

release(obj)
delete existing track
obtain values of filter properties from radartracker
initialize new track in tracker
confirm tentative track
predict tracks to a time stamp
sets values of track filter properties
run system object algorithm
release resources and allow changes to system object property values and input characteristics
create duplicate system object
determine if system object is in use
reset internal states of system object

examples

create a radartracker system object™ using the default filter initialization function for a 3-d constant-velocity model. for this motion model, the state vector is [x;vx;y;vy;z;vz].

tracker = radartracker('confirmationthreshold',[4 5], ...
    'deletionthreshold',10);

create a detection by specifying an objectdetection object. to use this detection with the radar tracker, enclose the detection in a cell array.

dettime = 1.0;
det = { ...
    objectdetection(dettime,[10; -1; 1], ...
    'sensorindex',1, ...
    'objectattributes',{'exampleobject',1}) ...
    };

update the radar tracker with this detection. the time at which you update the tracker must be greater than or equal to the time at which the object was detected.

updatetime = 1.25;
[confirmedtracks,tentativetracks,alltracks] = tracker(det,updatetime);

create another detection of the same object and update the tracker. the tracker maintains only one track.

dettime = 1.5;
det = { ...
    objectdetection(dettime,[10.1; -1.1; 1.2], ...
    'sensorindex',1, ...
    'objectattributes',{'exampleobject',1}) ...
    };
updatetime = 1.75;
[confirmedtracks,tentativetracks,alltracks] = tracker(det,updatetime);

determine whether the track has been verified by checking the number of confirmed tracks.

numconfirmed = tracker.numconfirmedtracks
numconfirmed = 0

examine the position and velocity of the tracked object. because the track has not been confirmed, get the position and velocity from the tentativetracks structure.

positionselector = [1 0 0 0 0 0; 0 0 1 0 0 0; 0 0 0 0 1 0];
velocityselector = [0 1 0 0 0 0; 0 0 0 1 0 0; 0 0 0 0 0 1];
position = gettrackpositions(tentativetracks,positionselector)
position = 1×3
   10.1426   -1.1426    1.2852
velocity = gettrackvelocities(tentativetracks,velocityselector)
velocity = 1×3
    0.1852   -0.1852    0.3705

create a sequence of detections of a moving object. track the detections using a radartracker system object™. observe how the tracks switch from tentative to confirmed and then to deleted.

create a radar tracker using the initcakf filter initialization function. the tracker models 2-d constant-acceleration motion. for this motion model, the state vector is [x;vx;ax;y;vy;ay].

tracker = radartracker('filterinitializationfcn',@initcakf, ...
    'confirmationthreshold',[3 4],'deletionthreshold',[6 6]);

create a sequence of detections of a moving target using objectdetection. to use these detections with the radartracker, enclose the detections in a cell array.

dt = 0.1;
pos = [10; -1];
vel = [10; 5];
for detno = 1:2
    time = (detno-1)*dt;
    det = { ...
        objectdetection(time,pos, ...
        'sensorindex',1, ...
        'objectattributes',{'exampleobject',1}) ...
        };
    [confirmedtracks,tentativetracks,alltracks] = tracker(det,time);
    pos = pos   vel*dt;
    meas = pos;
end

verify that the track has not been confirmed yet by checking the number of confirmed tracks.

numconfirmed = tracker.numconfirmedtracks
numconfirmed = 0

because the track is not confirmed, get the position and velocity from the tentativetracks structure.

positionselector = [1 0 0 0 0 0; 0 0 0 1 0 0];
velocityselector = [0 1 0 0 0 0; 0 0 0 0 1 0];
position = gettrackpositions(tentativetracks,positionselector)
position = 1×2
   10.6669   -0.6665
velocity = gettrackvelocities(tentativetracks,velocityselector)
velocity = 1×2
    3.3473    1.6737

add more detections to confirm the track.

for detno = 3:5
    time = (detno-1)*dt;
    det = { ...
        objectdetection(time,pos, ...
        'sensorindex',1, ...
        'objectattributes',{'exampleobject',1}) ...
        };
    [confirmedtracks,tentativetracks,alltracks] = tracker(det,time);
    pos = pos   vel*dt;
    meas = pos;
end

verify that the track has been confirmed, and display the position and velocity vectors for that track.

numconfirmed = tracker.numconfirmedtracks
numconfirmed = 1
position = gettrackpositions(confirmedtracks,positionselector)
position = 1×2
   13.8417    0.9208
velocity = gettrackvelocities(confirmedtracks,velocityselector)
velocity = 1×2
    9.4670    4.7335

let the tracker run but do not add new detections. the existing track is deleted.

for detno = 6:20
    time = (detno-1)*dt;
    det = {};
    [confirmedtracks,tentativetracks,alltracks] = tracker(det,time);
    pos = pos   vel*dt;
    meas = pos;
end

verify that the tracker has no tentative or confirmed tracks.

isempty(alltracks)
ans = logical
   1

algorithms

when you pass detections into a radar tracker, the system object:

  • attempts to assign the input detections to existing tracks, based on the assignmentthreshold property of the multi-object tracker.

  • creates new tracks from unassigned detections.

  • updates already assigned tracks and possibly confirms them, based on the confirmationthreshold property of the tracker.

  • deletes tracks that have no assigned detections, based on the deletionthreshold property of the tracker.

extended capabilities

version history

introduced in r2021a

see also

functions

  • |

objects

  • | | |
网站地图