Grid-Based Multi Object Tracker

Libraries:
Sensor Fusion and Tracking Toolbox /
Multi-Object Tracking Algorithms
Description
The Grid-Based Multi Object Tracker is a tracker capable of processing detections of multiple targets from multiple sensors in a 2-D environment. The tracker tracks dynamic objects around an autonomous system using high resolution sensor data such as point clouds and radar detections. The tracker uses the random finite set (RFS) based approach, combined with Dempster-Shafer approximations [1], to estimate the dynamic characteristics of the grid cells. To extract objects from the grid, the tracker uses a cell-to-track association scheme [2]. For more details, see Algorithms.
Examples
Grid-based Tracking in Urban Environments Using Multiple Lidars in Simulink
Track moving objects with multiple lidars using a grid-based tracker in Simulink. You use the Grid-Based Multi Object Tracker Simulink block to define the grid-based tracker. This Grid-based tracker uses dynamic occupancy grid map as an intermediate representation of the environment. This example closely follows the Grid-Based Tracking in Urban Environments Using Multiple Lidars MATLAB® example.
- Since R2021b
- Open Model
Ports
Input
Sensor data, specified as a Simulink bus containing a MATLAB structure. The structure contains these fields:
Field | Description |
---|---|
NumSensors | Number of sensors, specified as a nonnegative integer. |
SensorData | Sensor data, specified as an array of sensor data structures. The first
NumSensors elements of the array are actual
detections. |
Each SensorData
structure contains these
fields::
Field | Description |
---|---|
Time | Measurement time, specified as a nonnegative scalar. |
SensorIndex | Unique identifier of the sensor, specified as a positive integer. |
Measurement | Object measurements, specified a K-by-M matrix. K is the dimension of each measurement and M is the number of measurements. Each measurement defines the positional aspects of the detection in a rectangular or spherical frame. |
MeasurementParameters | Measurement parameters, specified as a structure describing the
transformation from the particle state to the measurement. See the
|
NumMeasurements | Number of measurements or number of points in the point cloud sensor detections, specified as a positive integer. |
Note
The Time
field of each structure must be less than or equal
to the time of the current invocation of the block. The time 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 increase with each invocation of the block,
and must be at least as large as the largest Time
specified to the
Sensor Data 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 the
Prediction time source parameter to Input
port
.
Configurations of the tracking sensors, specified as a Simulink bus containing a MATLAB structure. The structure contains these fields:
Field | Description |
---|---|
NumConfigurations | Number of sensor configurations, specified as a positive integer. |
Configurations | Sensor configurations, specified as an array of sensor
configuration structures. The first If you use a Radar Data Generator (Radar Toolbox) block in the tracking system, you can directly specify this value by using the Configuration output of the Radar Data Generator (Radar Toolbox) block, instead. |
Dependencies
To enable this port, in the Tracker Configuration tab, select the Update sensor configurations with time parameter.
Track state parameters, specified as a Simulink bus containing a MATLAB structure. The block uses this structure as the value of the
StateParameters
field of the generated tracks. You can use
these parameters to define the reference frame in which the block report tracks as
well as other desirable attributes of the generated tracks.
For example, you can use a structure with these fields to define a rectangular
reference frame with origin position at [10 10 0]
meters and
origin velocity of [2 -2 0]
meters per second, with respect to the
scenario frame.
Field Name | Value |
---|---|
Frame | "Rectangular" |
Position | [10 10 0] |
Velocity | [2 -2 0] |
Dependencies
To enable this port, in the Tracker Configuration tab, select the Update track state parameters with time parameter.
Output
Confirmed tracks updated to the current time, returned as a Simulink bus containing a MATLAB structure. The structure contains these fields:
Field | Description |
---|---|
NumTracks | Number of tracks. |
Tracks | Array of track structures of a length set by the Maximum number
of tracks parameter. Only the first NumTracks
element of the array are actual tracks. |
The fields of the track structure are shown in Track Structure. The state form of each track follows the form specified in the Motion model for tracking parameter.
Tentative tracks updated to the current time, returned as a Simulink bus containing a MATLAB structure. A track is tentative before it is confirmed.
The structure contains these fields:
Field | Description |
---|---|
NumTracks | Number of tracks |
Tracks | Array of track structures of a length set by the Maximum number
of tracks parameter. Only the first NumTracks
elements of the array are actual tracks. |
The fields of the track structure are shown in Track Structure. The state form of each track follows the form specified in the Motion model for tracking parameter.
Dependencies
To enable this port, in the Port Setting tab, select Enable tentative tracks output.
Combined list of confirmed and tentative tracks updated to the current time, returned as a Simulink bus containing a MATLAB structure.
The structure contains these fields:
Field | Description |
---|---|
NumTracks | Number of tracks |
Tracks | Array of track structures of a length set by the Maximum number
of tracks parameter. Only the first NumTracks
elements of the array are actual tracks. |
The fields of the track structure are shown in Track Structure. The state form of each track follows the form specified in the Motion model for tracking parameter.
Dependencies
To enable this port, in the Port Setting tab, select Enable all tracks output.
Parameters
Tracker Configuration
Specify the unique tracker identifier as a nonnegative integer. This parameter is
passed as the SourceIndex
in the tracker outputs, and distinguishes
tracks that come from different trackers in a multiple-tracker system. You must specify
this property as a positive integer to use the track outputs as inputs to a Track-To-Track Fuser
block.
Example: 1
Maximum number of tracks that the block can maintain, specified as a positive integer.
Specify the maximum number of sensors that can be connected to the tracker as a
positive integer. MaxNumSensors
must be greater than or equal to
the largest value of SensorIndex
found in all the sensor data used to
update the block.
Data Types: single
| double
Specify the configurations of tracking sensors as a structure or an array of structures. This parameter provides the tracking sensor configuration information, such as sensor detection limits and sensor resolution, to the tracker. You must specify these fields for each structure:
Field Name | Format |
---|---|
SensorIndex | Unique identifier of the sensor, specified as a positive integer. |
IsValidTime | Indicate if the sensor data should be used to update tracks,
specified as |
SensorTransformParameters | Parameters of the sensor transform function, specified as a
p-element array of measurement parameter structures.
p is the number of sensors. Each structure should
contain fields with the same names as the measurement parameters used in a
measurement function, such as the The first structure must describe the transformation from the autonomous system to the sensor coordinates. The subsequent structure describes the transformation from the autonomous system to the tracking coordinate frame. If you only provide one structure, the tracker assumes tracking is performed in the coordinate frame of the autonomous system. |
SensorLimits | Sensor detection limits, specified as a 2-by-2 matrix. The first row specifies the lower and upper limits of the azimuth angle in degrees. The second row specifies the lower and upper limits of the detection range in meters. |
The other allowed field names of each structure correspond to the
property names of the trackingSensorConfiguration
object. The tracker ignores the
FilterInitializationFcn
, SensorTransformFcn
,
and MaxNumDetsPerObject
fields, even when you specify them in the
structure.
You can update the configurations by using the Sensor configurations input port after selecting the Update sensor configurations with time parameter.
Select this parameter to enable the Sensor Configurations input port. This enables you to update tracking sensor configurations during the simulation.
Specify the parameters of the track state reference frame as a structure. The block
passes the value of this parameter to the StateParameters
field of
the generated tracks. You can use these parameters to define the reference frame in
which the block reports tracks, as well as other desirable attributes of the generated
tracks.
For example, you can use a structure with these fields to define a rectangular
reference frame with origin position at [10 10 0]
meters and origin
velocity of [2 -2 0]
meters per second with respect to the scenario
frame.
Field Name | Value |
---|---|
Frame | "Rectangular" |
Position | [10 10 0] |
Velocity | [2 -2 0] |
You can update the track state parameters through the State Parameters input port by selecting the Update track state parameters with time parameter.
Data Types: struct
Select this parameter to enable the input port for track state parameters through the State Parameters input port.
Select this parameter to enable using GPU for the estimation of the dynamic grid map. Enabling GPU computation requires the Parallel Computing Toolbox™.
Specify the x-dimension of the grid in the local coordinates as a positive scalar, in meters.
Specify the y-dimension of the grid in the local coordinates as a positive scalar, in meters.
Specify the resolution of the grid as a positive scalar. The resolution represents the number of cells per meter of the grid for both the x- and y-directions of the grid.
Specify the origin of the grid in the local coordinate frame as a two-element vector of scalars, in meters.
Select the type of simulation to run from these options:
Interpreted execution
— Simulate the model using the MATLAB interpreter. This option shortens startup time. In theInterpreted 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.
Particle Filtering
Select the motion model for tracking as
constant-velocity
,
constant-acceleration
, or
constant-turnrate
.
The particle state and object state for each motion model are:
Motion Model | Particle State | Object State |
---|---|---|
constant-velocity | [x; vx; y; vy] | [x; vx; y; vy; yaw; L; W] |
constant-acceleration | [x; vx; ax; y; vy; ay] | [x; vx; ax; y; vy; ay; yaw; L; W] |
constant-turn-rate | [x; vx; y; vy; w] | [x; vx; y; vy; w; yaw; L; W] |
where:
x
— Position of the object in the x-direction of the local tracking frame (m)y
— Position of the object in the y-direction of the local tracking frame (m)vx
— Velocity of the object in the x-direction of the local tracking frame (m/s)vy
— Velocity of the object in the y-direction of the local tracking frame (m/s)ax
— Acceleration of the object in the x-direction of the local tracking frame (m/s2)ay
— Acceleration of the object in the y-direction of the local tracking frame (m/s2)w
— Yaw-rate of the object in the local tracking frame (deg/s)yaw
— Yaw angle of the object in the local tracking frame (deg)L
— Length of the object (m)W
— Width of the object (m)
Specify the minimum and maximum velocities of objects as a 2-by-2 matrix of scalars in m/s. The first row specifies the lower and upper velocity limits in the x-direction, and the second row specifies the lower and upper velocity limits in the y-direction. The tracker uses these limits to sample new particles in the grid using a uniform distribution.
Select this parameter to model process noise as additive. When selected, process noise is added directly to the state vector. Otherwise, noise is incorporated in the motion model.
Specify process noise covariance as an N-by-N matrix. This parameter specifies the process noise for positions of particles and the geometric centers of targets.
If you select the Enable additive process noise parameter, the process noise adds directly to the prediction model. In this case, N is equal to the dimension of the particle state in the Motion model for tracking parameter.
If you do not select the Enable additive process noise parameter, define the process noise according to the selected motion model. The model adds process noise to the higher-order terms, such as acceleration for the
constant-velocity
model.MotionModel
Number of Terms for Acceleration Meaning of Terms constant-velocity
2
Acceleration in the x- and y- directions constant-acceleration
2
Jerk in the x- and y- directions constant-turn-rate
3
Acceleration in the x- and y- directions, as well as the angular acceleration
Example: [1.0 0.05; 0.05 2]
Specify the number of persistent particles per grid as a positive integer. A higher number of particles can improve estimation quality, but can increase computational cost.
Specify the number of new-born (initialized) particles per time step as a positive integer. The tracker determines the locations of these new-born particles by using the mismatch between the predicted and the updated occupancy belief masses and the Probability of birth in a cell per step parameter. A reasonable value of this parameter is approximately 10 percent of the number of particles specified by the Number of persistent particles parameter.
Specify the probability of target birth in a cell per step as a scalar in the range
[0, 1)
. The birth probability controls the
probability that new particles are generated in a cell.
Example: 1e-4
Specify the death rate of targets per unit time as a positive scalar. Death rate indicates the possibility that a particle or target vanishes after each time step. Death rate (Pd) influences the survival probability (Ps) of a component across successive time steps as:
where ΔT is the number of time steps.
Example: 1e-4
Specify the confidence in free space prediction as a scalar. In the prediction stage of the tracker, this parameter reduces the belief mass of a cell to be in the "free" (unoccupied) state as:
where k is the time step index, m is the belief mass, α is the factor representing the confidence in free space prediction, and ΔT is the time step.
Select the method of random number seed generation as
Repeatable
, Not repeatable
, or
Specify seed
.
Repeatable
— The block uses the same random seed every time.Not repeatable
— The block uses a different random seed every time.Specify seed
— Specify a random seed for the block using the Initial Seed parameter.
Specify the initial seed for randomization in the block as a nonnegative integer.
Dependencies
To enable this parameter, select the Random number generation
parameter as Specify seed
.
Track Management
Specify the clustering method used for new object extraction as
DBSCAN
or Custom
.
DBSCAN
— Cluster unassigned dynamic grid cells using the density-based spatial clustering of applications with noise (DBSCAN) algorithm. You can configure the DBSCAN algorithm by specifying the Threshold for DBSCAN clustering and Minimum number of cells per cluster for DBSCAN parameters.Custom
— Cluster unassigned dynamic grid cells using a custom clustering function specified in the Name of 'Custom' clustering function parameter.
Specify the threshold for DBSCAN clustering as a positive scalar.
Dependencies
To enable this parameter, select the Clustering method for new object
extraction parameter as DBSCAN
.
Specify the minimum number of cells per cluster for DBSCAN as a positive integer. This parameter affects whether a point is a core point in the DBSCAN algorithm.
Dependencies
To enable this parameter, select the Clustering method for new object
extraction parameter as DBSCAN
.
Specify the name of the custom function for clustering unassigned grid cells as a function name. The function must support this signature:
function indices = myFunction(dynamicGridCells)
dynamicGridCells
is a structure that defines a set of grid cells
initializing the track. It must have these fields:
Field | Description |
---|---|
Width | Width of the cell, specified as a positive scalar. |
GridIndices | Indices of the grid cells, specified as an N-by-2 array, where N is the number of unassigned cells. The first element specifies the grid index in the x-direction and the second element specifies the grid index in the y-direction. |
State | States of the grid cells, specified as a P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. |
StateCovariance | State covariances of the grid cells, specified as a P-by-P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. |
OccupancyMass | Occupancy belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. |
FreeMass | Free belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. |
The custom function must return indices
as an
N-element vector of indices that defines the cluster index for each
dynamic grid cell.
Dependencies
To enable this parameter, select the Clustering method for new object
extraction parameter as Custom
.
Specify the function used to initialize new tracks as a function name. The initialization function initiates a track from a set of dynamic grid cells.
The default initialization function merges the Gaussian estimates from cells to describe the state of the object. The orientation of the object aligns with the direction of its mean velocity. With a defined orientation, the length and width of the object are extracted using the geometric properties of the cells. The block calculates uncertainties in length, width, and orientation estimates using linear approximations.
If you choose to use your own initialization function, the function must support this signature:
function track = myFunction(dynamicGridCells)
dynamicGridCells
is a structure that defines a set of grid cells
initializing the track. It has these fields:
Field | Description |
---|---|
Width | Width of the cell, specified as a positive scalar. |
GridIndices | Indices of the grid cells, specified as an N-by-2 array, where N is the number of unassigned cells. The first element specifies the grid index in the x-direction and the second element specifies the grid index in the y-direction. |
State | States of the grid cells, specified as a P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. |
StateCovariance | State covariances of the grid cells, specified as a P-by-P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. |
OccupancyMass | Occupancy belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. |
FreeMass | Free belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. |
The custom function must return track
as an objectTrack
object or a structure
with field names that correspond to the property names of an objectTrack
object. The dimension
of the state must be the same as the state dimension specified in the Motion
model for tracking parameter.
Example: myFunction
Specify the function used to update an existing track using its associated set of dynamic grid cells as a function name.
The default update function updates the State
and
StateCovariance
fields of the track using the new estimate from
the dynamic grid cells associated with the track. The update process is similar to the
initialization process for the Function to initialize tracks from grid cell
sets parameter. The tracker does not apply filtering to the state and state
covariance.
If you choose to customize your own update function, the function must support this signature:
function updatedTrack = TrackUpdateFcn(predictedTrack,dynamicGridCells)
predictedTrack
is the predicted track of an object, specified as anobjectTrack
object.dynamicGridCells
is a structure that defines a set of dynamic grid cells associated with the track. The structure has these fields:Field Description Width
Width of the cell, specified as a positive scalar. GridIndices
Indices of the grid cells, specified as an N-by-2 array, where N is the number of unassigned cells. The first element specifies the grid index in the x-direction and the second element specifies the grid index in the y-direction. State
States of the grid cells, specified as a P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. StateCovariance
State covariances of the grid cells, specified as a P-by-P-by-N array of scalars, where P is the dimension of the state and N is the number of unassigned cells. OccupancyMass
Occupancy belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. FreeMass
Free belief mass of the cells, specified as an N-element vector, where N is the number of unassigned cells. updatedTrack
is the updated track, returned as anobjectTrack
object or a structure that has field names that correspond to the property names of anobjectTrack
object.
Example: TrackUpdateFcn
Specify the threshold for assigning dynamic grid cells to tracks as a positive scalar. A dynamic grid cell can only be associated to a track if its distance (represented by the negative log-likelihood) to the track is less than the value of this parameter.
Increase the threshold if a dynamic cell is not being assigned to a track that it should be assigned to.
Decrease the threshold if there are dynamic cells being assigned to a track that they should be not assigned to.
Example: 18.1
Specify the threshold for track confirmation as a 1-by-2 vector of positive
integers [M N]
. A track is confirmed if it has been assigned to
dynamic grid cells in at least M
updates of the last
N
updates.
Specify the threshold for track deletion as a 1-by-2 vector of positive integers
[P Q]
. A track is deleted if has not been assigned to any dynamic
grid cell in at least P
updates of the last Q
updates.
Example: 0.01
Data Types: single
| double
Visualization
Select this parameter to enable the dynamic grid map visualization. If a current axes exists, the block shows the dynamic map on the current axes. Otherwise, the block creates an axes to show the map.
Select this parameter to enable velocity plotting on the dynamic grid map.
Select this parameter to enable updating from previous map. When selected, the block plots the map via a lightweight update to the previous map in the figure. Otherwise, the block plots a new map on the figure every time.
Select this parameter to enable inverted colors on the map. When selected, the block plots empty space in white and occupied space in black. Otherwise, the block plots empty space in black and occupied space in white.
Port Setting
Specify the source for prediction time 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 parameter to enable the output of tentative tracks through the Tentative Tracks output port.
Select this parameter to enable the output of all the tracks through the All Tracks 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.
Algorithms
The Grid-Based Multi Object Tracker
block initializes, confirms, and deletes tracks
automatically by using this algorithm:
The tracker projects sensor data from all sensors on a two-dimensional grid map to represent the occupancy and free evidence in a Dempster-Shafer framework.
The tracker uses a particle-based approach to estimate the dynamic state of the 2-D grid. This helps the tracker classify each cell as dynamic or static.
The tracker manage tracks based on this logic:
The tracker associates each dynamic grid cell with the existing tracks using a gated nearest-neighbor approach.
The tracker initializes new tracks using unassigned dynamic grid cells. A track is created with a
Tentative
status, and the status will change toConfirmed
after enough updates. For more information, see the Confirmation threshold [M N] parameter.Alternatively, the tracker confirms a track immediately if the
ObjectClassID
of the track is a positive value after track initialization. For more information, see the Function to initialize tracks from grid cell sets parameter.The tracker performs coasting, predicting unassigned tracks to the current time, and deletes tracks with more misses than the specified threshold. For more information, see the Deletion threshold [P Q] parameter.
The fields of the track structure are:
Field | Definition |
---|---|
TrackID | Unique track identifier used to distinguish multiple tracks. |
BranchID | Unique track branch identifier used to distinguish multiple track branches. |
SourceIndex | Unique source index used to distinguish tracking sources in a multiple tracker environment. |
UpdateTime | Time at which the track is updated. Units are in seconds. |
Age | Number of times the track survived. |
State | Value of the state vector at the update time. |
StateCovariance | Uncertainty covariance matrix. |
ObjectClassID | Integer value representing the object classification. The value
0 represents an unknown classification. Nonzero
classifications apply only to confirmed tracks. |
TrackLogic | Confirmation and deletion logic type, returned as 'History' or 'Score' . |
TrackLogicState | The current state of the track logic type. Based on the logic type
|
IsConfirmed | Confirmation status. This field is true if the track is confirmed to be a real target. |
IsCoasted | Coasting status. This field is true if the track is updated without a new detection. |
IsSelfReported | Indicate if the track is reported by the tracker. This field is used in a track fusion environment. It is returned as |
ObjectAttributes | Additional information about the track. |
References
[1] Nuss, D., Reuter, S., Thom, M., Yuan, T., Krehl, G., Maile, M., Gern, A. and Dietmayer, K., 2018. A random finite set approach for dynamic occupancy grid maps with real-time application. The International Journal of Robotics Research, 37(8), pp.841-866.
[2] Steyer, Sascha, Georg Tanzmeister, and Dirk Wollherr. "Object tracking based on evidential dynamic occupancy grids in urban environments." In 2017 IEEE Intelligent Vehicles Symposium (IV), pp. 1064-1070. IEEE, 2017.
Extended Capabilities
Usage notes and limitations:
The visualization of the grid map does not support code generation.
Version History
Introduced in R2021bAs of R2023a, the Simulink buses created by this block no longer show in MATLAB workspace.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)