Global Nearest Neighbor Multi Object Tracker

Multi-sensor, multi-object tracker using GNN assignment

  • Library:
  • Sensor Fusion and Tracking Toolbox

Description

The Global Nearest Neighbor Multi Object Tracker block is capable of processing detections of many targets from multiple sensors, much like the trackerGNN System object™. The tracker initializes, confirms, predicts, corrects, and deletes tracks based on a global nearest neighbor (GNN) assignment algorithm. The tracker estimates the state vector and state vector covariance matrix for each track. Each detection is assigned to at most one track. If the detection cannot be assigned to any track, the tracker initializes a new track.

Any new track starts in a tentative state. If enough detections are assigned to a tentative track, its status changes to confirmed. If the detection already has a known classification (the ObjectClassID field of the returned track is nonzero), that track is confirmed immediately. When a track is confirmed, the tracker considers the track to represent a physical object. If detections are not assigned to the track within a specifiable number of updates, the track is deleted.

Ports

Input

expand all

Detection list, specified as a Simulink bus containing a MATLAB structure. The structure has the form:

FieldDescriptionType
NumDetectionsNumber of detectionsinteger
DetectionsObject detectionsArray of object detection structures. The first NumDetections of these detections are actual detections.

The fields of Detections are:

FieldDescriptionType
TimeMeasurement timesingle or double
MeasurementObject measurementssingle or double
MeasurementNoiseMeasurement noise covariance matrixsingle or double
SensorIndexUnique ID of the sensorsingle or double
ObjectClassIDObject classification IDsingle or double
MeasurementParametersParameters used by initialization functions of tracking filtersSimulink Bus
ObjectAttributesAdditional information passed to trackerSimulink Bus

See objectDetection for more detailed explanations of these fields.

Note

The object detection structure contains a Time field. The time tag of each object detection must be less than or equal to the time of the current invocation of the block. The time tag must also be greater than the update time specified in the previous invocation of the block.

Track update time, specified as a real scalar in seconds. The tracker updates all tracks to this time. The update time must always increase with each invocation of the block. Units are in seconds. The update time must be at least as large as the largest Time specified at the Detections input port.

If this port is not enabled, the simulation clock managed by Simulink determines the update time.

Dependencies

To enable this port, in the Port Setting tab, set Prediction time source to Input port.

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 at the All Tracks output port on the previous invocation of the block.

In the first update to the tracker, or if the track 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.

If this port is not enabled, the filter initialized by the Filter initialization function calculates the cost matrix using the distance method.

Dependencies

To enable this port, in the Port Setting tab, select Enable cost matrix input.

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 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 Probability of detection used for track score parameter.

Tracks whose identifiers are not included in Detectable TrackIDs are considered undetectable. The track deletion logic does not count the lack of detection as a "missed detection" for track deletion purposes.

If this port is not enabled, the tracker assumes all tracks to be detectable at each invocation of the block.

Dependencies

To enable this port, in the Port Setting tab, select Enable detectable track IDs Input.

Output

expand all

Confirmed tracks, returned as a Simulink bus containing a MATLAB structure. The structure has the form:

FieldDescription
NumTracksNumber of tracks
TracksArray of track structures of a length set by the Maximum number of tracks parameter. Only the first NumTracks of these are actual tracks.

The fields of the track structure are shown in Track Structure.

Depending on the track logic, a track is confirmed if:

  • History – A track receives at least M detections in the last N updates. M and N are specified in Confirmation threshold for the History logic.

  • Score – The track score is at least as high as the confirmation threshold specified in Confirmation threshold for the Score logic.

Tentative tracks, returned as a Simulink bus containing a MATLAB structure. A track is tentative before it is confirmed.

The fields of the track structure are shown in Track Structure.

Dependencies

To enable this port, in the Port Setting tab, select Enable tentative tracks output.

Combined list of confirmed and tentative tracks, returned as a Simulink bus containing a MATLAB structure.

The fields of the track structure are shown in Track Structure.

Dependencies

To enable this port, in the Port Setting tab, select Enable all tracks output.

Additional information for analyzing track updates, returned as a Simulink bus containing a MATLAB structure.

This table shows the fields of the info structure:

FieldDescription
TrackIDsAtStepBeginning

Track IDs when step began

CostMatrix

Cost of assignment matrix

Assignments

Assignments returned from the assignment function

UnassignedTracks

IDs of unassigned tracks returned from the tracker

UnassignedDetections

IDs of unassigned detections returned from the tracker

InitiatedTrackIDs

IDs of tracks initiated during the step

DeletedTrackIDs

IDs of tracks deleted during the step

TrackIDsAtStepEnd

Track IDs when the step ended

Dependencies

To enable this port, in the Port Setting tab, select Enable information output.

Parameters

expand all

Tracker Management

Filter initialization function, specified as a function handle or as a character vector containing the name of a valid filter initialization function. The tracker uses the filter initialization function when creating new tracks.

Sensor Fusion and Tracking Toolbox™ supplies many initialization functions that you can use:

Initialization FunctionFunction Definition
initcvabfInitialize constant-velocity alpha-beta filter
initcaabfInitialize constant-acceleration alpha-beta filter
initcvekfInitialize constant-velocity extended Kalman filter.
initcackfInitialize constant-acceleration cubature filter.
initctckfInitialize constant-turn-rate cubature filter.
initcvckfInitialize constant-velocity cubature filter.
initcapfInitialize constant-acceleration particle filter.
initctpfInitialize constant-turn-rate particle filter.
initcvpfInitialize constant-velocity particle filter.
initcvkfInitialize constant-velocity linear Kalman filter.
initcvukfInitialize constant-velocity unscented Kalman filter.
initcaekfInitialize constant-acceleration extended Kalman filter.
initcakfInitialize constant-acceleration linear Kalman filter.
initcaukf Initialize constant-acceleration unscented Kalman filter.
initctekf Initialize constant-turn-rate extended Kalman filter.
initctukfInitialize constant-turn-rate unscented Kalman filter.
initcvmscekfInitialize constant-velocity modified spherical coordinates extended Kalman filter.
initrpekfInitialize constant-velocity range-parametrized extended Kalman filter.
initapekfInitialize constant-velocity angle-parametrized extended Kalman filter.
initekfimmInitialize tracking IMM filter.

You can also write your own initialization function. The function must have this syntax:

filter = filterInitializationFcn(detection)
The input to this function is a detection report like those created by objectDetection. The output of this function must be a filter object: trackingKF, trackingEKF, trackingUKF, trackingCKF, trackingPF, trackingMSCEKF, trackingGSF, trackingIMM, or trackingABF.

To guide you in writing this function, you can examine the details of the supplied functions from within MATLAB. For example:

type initcvekf

Assignment algorithm, specified as 'MatchPairs', 'Munkres', 'Jonker-Volgenant', 'Auction', or 'Custom'. Munkres is the only assignment algorithm that guarantees an optimal solution, but it is also the slowest, especially for large numbers of detections and tracks. The other algorithms do not guarantee an optimal solution but can be faster for problems with 20 or more tracks and detections. Use'Custom' to define your own assignment function and specify its name in the CustomAssignmentFcn property.

Custom assignment function name, specified as a character string. An assignment function must have this syntax:

 [assignment,unTrs,unDets] = f(cost,costNonAssignment)
For an example of an assignment function and a description of its arguments, see assignmunkres.

Example: 'mycustomfcn'

Dependencies

To enable this property, set the Assignment algorithm name name to 'Custom'.

Threshold for assigning detections to tracks (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, trackingCKF and trackingEKF) 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 block can maintain, specified as a positive integer.

Maximum number of sensors that the block can process, specified as a positive integer. This value should be greater than or equal to the highest SensorIndex value input at the Detections input port.

  • Interpreted execution — Simulate the model using the MATLAB interpreter. This option shortens startup time. In Interpreted execution mode, you can debug the source code of the block.

  • Code generation — Simulate the model using generated C code. The first time you run a simulation, Simulink generates C code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time.

Track Logic

Confirmation and deletion logic type, selected as History or Score.

  • History – Track confirmation and deletion is based on the number of times the track has been assigned to a detection in the latest tracker updates.

  • Score – Track confirmation and deletion is based on a log-likelihood track score. A high score means that the track is more likely to be valid. A low score means that the track is more likely to be a false alarm.

Track confirmation threshold for history logic, specified as a real-valued 1-by-2 vector of positive integers [M N]. A track is confirmed if it receives at least M detections in the last N updates.

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to History.

Track deletion threshold for history logic, specified as a real-valued 1-by-2 vector of positive integers [P Q]. A track is deleted if, in the last Q updates, it was assigned less than P detections.

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to History.

Track confirmation threshold for score logic, specified as a real-valued positive scalar. A track is confirmed if its score is at least as high as the confirmation threshold.

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

Track deletion threshold for score logic, specified as a negative scalar. A track is deleted if its score decreases by at least the threshold from the maximum track score.

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

Probability of detection used for track score, specified as a positive scalar in (0,1).

Example: 0.5

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

The probability of false alarm used for track score, specified as a scalar in (0,1).

Example: 1e-5

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

The volume of a sensor detection bin, specified as a positive scalar. For example, if a radar produces a 4-D measurement, which includes azimuth, elevation, range, and range rate, the 4-D volume is defined by the radar angular beam width, the range bin width, and the range-rate bin width. Volume is used in calculating the track score when initializing and updating a track.

Example: 1.5

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

The rate of new tracks per unit volume, specified as a positive scalar. The rate of new tracks is used in calculating the track score during track initialization.

Example: 2.5

Dependencies

To enable this parameter, set Type of track confirmation and deletion logic to Score.

Port Setting

Source for prediction time, specified as Input port or Auto. Select Input port to input an update time by using the Prediction Time input port. Otherwise, the simulation clock managed by Simulink determines the update time.

Select this check box to enable the input of a cost matrix by using the Cost Matrix input port.

Select this check box to enable the Detectable track IDs input port.

Select this check box to enable the output of tentative tracks through the Tentative Tracks output port.

Select this check box to enable the output of all the tracks through the All Tracks output port.

Select this check box to enable the output port for analysis information through the Info output port.

Source of the output track bus name, specified as:

  • Auto — The block automatically creates an output track bus name.

  • Property — Specify the output track bus name by using the Specify an output bus name parameter.

Source of the output info bus name, specified as one of these options:

  • Auto — The block automatically creates an output info bus name.

  • Property — Specify the output info bus name by using the Specify an output bus name parameter.

Algorithms

expand all

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2019b