trackerPHD
Multisensor, multiobject PHD tracker
Description
The trackerPHD
System object™ is a tracker capable of processing detections of multiple targets from multiple
sensors. The tracker uses a multitarget probability hypothesis density (PHD) filter to
estimate the states of point targets and extended objects. PHD is a function defined over the
statespace of the tracking system, and its value at a state is defined as the expected number
of targets per unit statespace volume. The PHD is represented by a weighted summation
(mixture) of probability density functions, and peaks in the PHD correspond to possible
targets. For an overview of how the tracker functions, see Algorithms.
By default, the trackerPHD
can track extended objects using the ggiwphd
filter, which models
detections from an extended object as a parse points cloud. You can also use
trackerPHD
with the gmphd
filters, which tracks point targets and extended objects with designated
shapes. Inputs to the tracker are detection reports generated by objectDetection
, fusionRadarSensor
,
irSensor
, or
sonarSensor
objects. The tracker outputs all maintained tracks and their analysis information.
To track targets using this object:
Create the
trackerPHD
object and set its properties.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
creates a
tracker
= trackerPHDtrackerPHD
System object with default property values.
sets properties for the tracker using one or more namevalue pairs. For example,
tracker
= trackerPHD(Name,Value
)trackerPHD('MaxNumTracks',100)
creates a PHD tracker that allows 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
release
function unlocks them.
If a property is tunable, you can change its value at any time.
For more information on changing property values, see System Design in MATLAB Using System Objects.
TrackerIndex
— Unique tracker identifier
0
(default)  nonnegative integer
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 multipletracker system. You must specify this property as a positive integer to use the track outputs as inputs to a track fuser.
Example: 1
SensorConfigurations
— Configurations of tracking sensors
cell array of trackingSensorConfiguration
objects
Configuration of tracking sensors, specified as a cell array of trackingSensorConfiguration
objects. This property provides the tracking
sensor configuration information, such as sensor detection limits and sensor resolution,
to the tracker. Note that there are no default values for the
SensorConfigurations
property, and you must specify the
SensorConfigurations
property before using the tracker. However,
you can update the configuration by setting the
HasSensorConfigurationsInput
property to true
and specifying the configuration input, config
. If you set the
MaxDetsPerObject
property of the
trackingSensorConfiguration
object to 1, the tracker creates only one
partition, such that at most one detection can be assigned to each target.
PartitioningFcn
— Function to partition detections into detection cells
@partitionDetections
(default)  function handle  character vector
Function to partition detections into detection cells, specified as a function handle or as a character vector. When each sensor can report more than one detection per object, a partition function is required. The partition function reports all possible partitions of the detections from a sensor. In each partition, the detections are separated into mutually exclusive detection cells, assuming that each detection cell belongs to one extended object.
You can also specify your own detections partition function. For guidance in writing
this function, you can examine the details of the default partitioning function,
partitionDetections
, using the type
command
as:
type partitionDetections
Example:
@myfunction
or 'myfunction'
Data Types: function_handle
 char
BirthRate
— Birth rate of new targets in the density
1e3
(default)  positive real scalar
Birth rate of new targets in the density, specified as a scalar. Birth rate
indicates the expected number of targets added in the density per unit time. The birth
density is created by using the FilterInitializationFcn
of the
trackingSensorConfiguration
used with the tracker. In general, the tracker
adds components to the density function in two ways:
Predictive birth density – density initialized by
FilterInitializationFcn
function when called with no inputs.Adaptive birth density – density initialized by
FilterInitializationFcn
function when called with detections inputs. The detections are chosen by the tracker based on their loglikelihood of association with the current estimates of the targets.
Note that the value for the BirthRate
property
represents the summation of both predictive birth density and adaptive birth density for
each time step.
Example: 0.01
Data Types: single
 double
DeathRate
— Death rate of components in the density
1e6
(default)  positive real scalar
Death rate of components in the density, specified as a scalar. Death rate indicates the rate at which a component vanishes in the density after one time step. Death rate (P_{d}) relates to the survival probability (P_{s}) of a component between successive time steps by
$${P}_{\text{s}}={\left(1{P}_{d}\right)}^{\Delta T}$$
where ΔT is the time step.
Example: 1e4
Data Types: single
 double
AssignmentThreshold
— Threshold of selecting detections for component initialization
25
(default)  real positive scalar
Threshold of selecting detections for component initialization, specified as a positive scalar. During correction, the tracker calculates the likelihood of association between existing tracks and detection cells. If the association likelihood (given by negative loglikelihood) of a detection cell to all existing tracks is higher than the threshold (which means the detection cell has low likelihood of association to existing tracks), the detection cell is used to initialize new components in the adaptive birth density.
Example: 18.1
Data Types: single
 double
ExtractionThreshold
— Threshold for initializing tentative track
0.5
(default)  real positive scalar
Threshold for initializing a tentative track, specified as a scalar. If the weight
of a component is higher than the threshold specified by the
ExtractionThreshold
property, the component is labeled as a
'Tentative'
track and given a TrackID
.
Example: 0.45
Data Types: single
 double
ConfirmationThreshold
— Threshold for track confirmation
0.8
(default)  real positive scalar
Threshold for track confirmation, specified as a scalar. In a
trackerPHD
object, a track can have multiple components sharing the
same TrackID
. If the weight summation of a tentative track's
components is higher than the threshold specified by the
ConfirmationThreshold
property, the track's status is marked as
'Confirmed'
.
Example: 0.85
Data Types: single
 double
DeletionThreshold
— Threshold for component deletion
1e3
(default)  real positive scalar
Threshold for component deletion, specified as a scalar. In the PHD tracker, if the
weight of a component is lower than the value specified by the
DeletionThreshold
property, the component is deleted.
Example: 0.01
Data Types: single
 double
MergingThreshold
— Threshold for components merging
25
(default)  real positive scalar
Threshold for components merging, specified as a real positive scalar. In the PHD
tracker, if the KullbackLeibler distance between components with the same
TrackID
is smaller than the value specified by the
MergingThreshold
property, then these components are merged into
one component. The merged weight of the new component is equal to the summation of the
weights of the premerged components. Moreover, if the merged weight is higher than the
first threshold specified in the LabelingThresholds
property, the
merged weight is truncated to the first threshold. Note that components with
TrackID
equal to 0
can also be merged with each
other.
Example: 30
Data Types: single
 double
LabelingThresholds
— Thresholds for label management
[1.1 1 0.8]
(default)  1by3 vector of positive values
Labeling thresholds, specified as an 1by3 vector of decreasing positive values,
[C_{1},
C_{2},
C_{3}]. Based on the
LabelingThresholds
property, the tracker manages components in
the density using these rules:
The weight of any component that is higher than the first threshold C_{1} is reduced to C_{1}.
For all components with the same
TrackID
, if the largest weight among these components is greater than C_{2}, then the component with the largest weight is preserved to retain theTrackID
, while all other components are deleted.For all components with the same
TrackID
, if the ratio of the largest weight to the weight summation of all these components is greater than C_{3}, then the component with the largest weight is preserved to retain theTrackID
, while all other components are deleted.If neither condition 2 nor condition 3 is satisfied, then the component with the largest weight retains the
TrackID
, while the labels of all other components are set to 0. When this occurs, it essentially means that some components may represent other objects. This treatment keeps the possibility for these unreserved components to be extracted again in the future.
Data Types: single
 double
HasSensorConfigurationsInput
— Enable updating sensor configurations with time
false
(default)  true
Enable updating sensor configurations with time, specified as
false
or true
. Set this property to
true
if you want the configurations of the sensor updated with
time. Also, when this property is set to true
, the tracker must be
called with the configuration input, config
, as shown in the usage
syntax.
Data Types: logical
StateParameters
— Parameters of track state reference frame
struct([])
(default)  struct array
Parameters of the track state reference frame, specified as a structure or a structure
array. The tracker passes its StateParameters
property values to
the StateParameters
property of the generated tracks. You can use
these parameters to define the reference frame in which the track is reported or other
desirable attributes of the generated tracks.
For example, you can use the following structure to define a rectangular reference
frame whose origin position is at [10 10 0]
meters and whose origin
velocity is [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] 
Tunable: Yes
Data Types: struct
NumTracks
— Number of tracks maintained by tracker
nonnegative integer
This property is readonly.
Number of tracks maintained by the tracker, returned as a nonnegative integer.
Data Types: double
NumConfirmedTracks
— Number of confirmed tracks
nonnegative integer
This property is readonly.
Number of confirmed tracks, returned as a nonnegative integer. If the
IsConfirmed
field of an output track structure is
true
, the track is confirmed.
Data Types: double
MaxNumSensors
— Maximum number of sensors
20
(default)  positive integer
Maximum number of sensors that can be connected to the tracker, specified as a
positive integer. MaxNumSensors
must be greater than or equal to
the largest value of SensorIndex
found in all the detections used to
update the tracker. SensorIndex
is a property of an objectDetection
object.
Data Types: single
 double
MaxNumTracks
— Maximum number of tracks
100
(default)  positive integer
Maximum number of tracks that the tracker can maintain, specified as a positive integer.
Data Types: single
 double
Usage
To process detections and update tracks, call the tracker with arguments, as if it were a function (described here).
Syntax
Description
returns a list of confirmed tracks that are updated from a list of detections,
confirmedTracks
= tracker(detections
,time
)detections
, at the update time, time
.
Confirmed tracks are corrected and predicted to the update time.
also specifies a sensor configuration input, confirmedTracks
= tracker(detections
,config
,time
)config
. Use this syntax
when the configurations of sensors are changing with time. To enable this syntax, set the
HasSensorConfigurationsInput
property to
true
.
[
also returns a list of tentative tracks, confirmedTracks
,tentativeTracks
,allTracks
] = tracker(___)tentativeTracks
, and a list
of all tracks, allTracks
. You can use this output syntax with any of
the previous input syntaxes.
[
also returns the analysis information, confirmedTracks
,tentativeTracks
,allTracks
,analysisInformation
] = tracker(___)analysisInformation
, which can
be used for track analysis. You can use this output syntax with any of the previous input
syntaxes.
Input Arguments
detections
— Detection list
cell array of objectDetection
objects
Detection list, specified as a cell array of objectDetection
objects. The Time
property value of
each objectDetection
object must be less than or equal
to the current update time, time
, and greater than the previous
time value used to update the tracker. Also, the Time
differences
between different objectDetection
objects in the cell
array do not need to be equal.
time
— Time of update
scalar
Time of update, specified as a 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 objectDetection
objects in the input detections
list.
time
must increase in value with each update to the
tracker.
Data Types: single
 double
config
— Sensor configurations
array of structs  cell array of structs  cell array of trackingSensorConfiguration
objects
Sensor configurations, specified as an array of structs, a cell array of structs,
or a cell array of trackingSensorConfiguration
objects. If you specify the value using an
array of structs or a cell array of structs, you must include
SensorIndex
as a field for each struct. The other optional fields
in each struct must have the same name as one of the properties of the
trackingSensorConfiguration
object. Note that you only need to
specify sensor configurations that need to be updated. For example, if you only want
to update the IsValidTime
property for the fifth sensor, provide
the value for config
as
struct('SensorIndex',5,'IsValidTime',false)
.
Dependencies
To enable this argument, set the
HasSensorConfigurationsInput
property to
true
.
Output Arguments
confirmedTracks
— Confirmed tracks
structure  array of structures
Confirmed tracks updated to the current time, returned as a structure or an array
of structures. Each structure corresponds to a track. A track is confirmed if the
weight summation of its components is above the threshold specified by the
ConfirmationThreshold
property. If a track is confirmed, the
IsConfirmed
field of the structure is true
.
The fields of the confirmed tracks structure are defined in Track Structure.
Data Types: struct
tentativeTracks
— Tentative tracks
structure  array of structures
Tentative tracks, returned as a structure or an array of structures. Each
structure corresponds to a track. A track is tentative if the weight summation of its
components is above the threshold specified by the
ExtractionThreshold
property, but below the threshold specified
by the ConfirmationThreshold
property. In that case, the
IsConfirmed
field of the structure is false
.
The fields of the structure are defined in Track Structure.
Data Types: struct
allTracks
— All tracks
structure  array of structures
All tracks, returned as a structure or an array of structures. Each structure corresponds to a track. The set of all tracks consists of confirmed and tentative tracks. The fields of the structure are defined in Track Structure.
Data Types: struct
analysisInformation
— Additional information for analyzing track updates
structure
Additional information for analyzing track updates, returned as a structure. The fields of this structure are:
Field  Description 
CorrectionOrder  The order in which sensors are used for state estimate correction,
returned as a row vector of 
TrackIDsAtStepBeginning  Track IDs when step began. 
DeletedTrackIDs  IDs of tracks deleted during the step. 
TrackIDsAtStepEnd  Track IDs when the step ended. 
SensorAnalysisInfo  Cell array of sensor analysis information. 
The SensorAnalysisInfo
field can include multiple sensor
information reports. Each report is a structure containing:
Field  Description 
SensorIndex  Sensor index. 
DetectionCells  Detection cells, returned as a logical matrix. Each column of the matrix denotes a detection cell. In each column, if the ith element is 1, then the ith detection belongs to the detection cell denoted by that column. 
DetectionLikelihoods  The association likelihoods between components in the density function and detection cells, returned as an NbyP matrix. N is the number of components in the density function, and P is the number of detection cells. 
IsBirthCells  Indicates if the detection cells listed in

NumPartitions  Number of partitions. 
DetectionProbability  Probability of existing tracks being detected by the sensor, specified as a 1byN row vector, where N is the number of components in the density function. 
LabelsBeforeCorrection  Labels of components in the density function before correction,
return as a 1byM_{b} row vector.
M_{b} is the number of
components maintained in the tracker before correction. Each element of
the vector is a 
LabelsAfterCorrection  Labels of components in the density function after correction,
returned as a 1byM_{a} row
vector. M_{a} is the number of
components maintained in the tracker after correction. Each element of the
vector is a 
WeightsBeforeCorrection  Weights of components in the density function before correction,
returned as a 1byM_{b} row
vector. M_{b} is the number of
components maintained in the tracker before correction. Each element of
the vector is the weight of the corresponding component given in

WeightsAfterCorrection  Weights of components in the density function after correction,
returned as a 1byM_{a} row
vector. M_{a} is the number of
components maintained in the tracker after correction. Each element of the
vector is the weight of the corresponding component given in

Data Types: struct
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)
Specific to trackerPHD
predictTracksToTime  Predict track state 
deleteTrack  Delete existing track 
initializeTrack  Initialize new track 
sensorIndices  List of sensor indices 
Examples
Track Two Objects Using trackerPHD
Set up the sensor configuration, create a PHD tracker, and feed the tracker with detections.
% Create sensor configuration. Specify clutter density of the sensor and % set the IsValidTime property to true. configuration = trackingSensorConfiguration(1); configuration.ClutterDensity = 1e7; configuration.IsValidTime = true; % Create a PHD tracker. tracker = trackerPHD('SensorConfigurations',configuration); % Create detections near points [5;5;0] and [5;5;0] at t=0, and % update the tracker with these detections. detections = cell(20,1); for i = 1:10 detections{i} = objectDetection(0,[5;5;0] + 0.2*randn(3,1)); end for j = 11:20 detections{j} = objectDetection(0,[5;5;0] + 0.2*randn(3,1)); end tracker(detections,0);
Update the tracker again after 0.1 seconds by assuming that targets move at a constant velocity of [1;2;0] unit per second.
dT = 0.1; for i = 1:20 detections{i}.Time = detections{i}.Time + dT; detections{i}.Measurement = detections{i}.Measurement + [1;2;0]*dT; end [confTracks,tentTracks,allTracks] = tracker(detections,dT);
Visualize detections and confirmed tracks.
% Obtain measurements from detections. d = [detections{:}]; measurements = [d.Measurement]; % Extract positions of confirmed tracking using getTrackPositions function. % Note that we used the default sensor configuration % FilterInitializationFcn, initcvggiwphd, which uses a constant velocity % model and defines the states as [x;vx;y;vy;z;vy]. positionSelector = [1 0 0 0 0 0;0 0 1 0 0 0;0 0 0 0 1 0]; positions = getTrackPositions(confTracks,positionSelector); figure() plot(measurements(1,:),measurements(2,:),'x','MarkerSize',5,'MarkerEdgeColor','b'); hold on; plot(positions(1,1),positions(1,2),'v','MarkerSize',5,'MarkerEdgeColor','r' ); hold on; plot(positions(2,1),positions(2,2),'^','MarkerSize',5,'MarkerEdgeColor','r' ); legend('Detections','Track 1','Track 2') xlabel('x') ylabel('y')
More About
Track Structure
Track information is returned as an array of structures having the following fields:
Field  Description 
TrackID  Unique integer that identifies the track. 
SouceIndex  Unique identifier of the tracker in a multiple tracker environment. The

UpdateTime  The time the track was updated. 
Age  Number of times the track survived. 
State  Value of state vector at the update time. 
StateCovariance  Uncertainty covariance matrix. 
Extent  Spatial extent estimate of the tracked object, returned as a
dbyd matrix, where d
is the dimension of the object. This field is only returned when the tracking
filter is specified as a 
MeasurementRate  Expected number of detections from the tracked object. This field is only
returned when the tracking filter is specified as a 
IsConfirmed  True if the track is assumed to be of a real target. 
IsCoasted 

ObjectClassID 

StateParamaters  Parameters about the track state reference frame specified in the

IsSelfReported  Indicate if the track is reported by the tracker. This field is used in a
track fusion environment. It is returned as 
Algorithms
Tracker Logic Flow
trackerPHD
adopts an iteratedcorrector approach to update the
probability hypothesis density by processing detection information from multiple sensors
sequentially. The workflow of trackerPHD
follows these steps:
The tracker sorts sensors according to their detection reporting time and determines the order of correction accordingly.
The tracker considers two separate densities: current density and birth density. The current density is the density of targets propagated from the previous time step. The birth density is the density of targets expected to be born in the current time step.
For each sensor:
The tracker predicts the current density to sensor timestamp using the survival probability calculated from
DeathRate
and the elapsed time from the last prediction.The tracker adds new components to the birth density using the
FilterInitializationFcn
with no inputs. This corresponds to the predictive birth density.The tracker creates partitions of the detections from the current sensor using the function specified by the
PartitioningFcn
property. Each partition is a possible segmentation of detections into detection cells for each object. If theSensorConfiguration
specifies theMaxNumDetsPerObject
as 1, the tracker generates only 1 partition, in which each detection is a standalone cell.Each detection cell is evaluated against the current density, and a loglikelihood value is computed for each detection cell.
Using the loglikelihood values, the tracker calculates the probability of each partition.
The tracker corrects the current density using each detection cell.
For detection cells with high negative loglikelihood (greater than
AssignmentThreshold
), the tracker adds new components to the birth density usingFilterInitializationFcn
. This corresponds to the adaptive birth density.
After correcting the current density with each sensor, the tracker adds the birth density to the current density. The tracker makes sure that number of possible targets in the birth density is equal to
BirthRate
×dT, where dT is the time step.The current density is then predicted to the current update time.
Probability Hypothesis Density
Probability hypothesis density (PHD) is a function defined over the statespace of the tracking system, and its value at a state is defined as the expected number of targets per unit statespace volume. The PHD is usually approximated by a mixture of components, and each component corresponds to an estimate of the state. The commonly used approximations of PHD are Gaussian mixture, SMC mixture, GGIW mixture, and GIW mixture.
To understand PHD, take the Gaussian mixture as an example. The Gaussian mixture can be represented by
$$D(x)={\displaystyle \sum _{i=1}^{M}{w}_{i}N(x{m}_{i},{P}_{i})}$$
where M is the total number of components, N(xm_{i},P_{i}) is a normal distribution with mean m_{i} and covariance P_{i}, and w_{i} is the weight of the ith component. The weight w_{i} denotes the number, which can be fractional, of targets represented by the ith component. Integration of D(x) over a statespace region results in the expected number of targets in that region. Integrating D(x) over the whole state space results in the total expected number of targets (∑ w_{i}), since the integration of a normal distribution over the whole state space is 1. The xcoordinates of the peaks (local maximums) of D(x) represent the most likely states of targets.
For example, the following figure illustrates a PHD function given by D(x) = N(x−4,2) + 0.5N(x3,0.4) + 0.5N(x4,0.4). The weight summation of these components is 2, which means that two targets probably exist. From the peaks of D(x), the possible positions of these targets are at x = −4, x = 3, and x = 4. Notice that the last two components are very close to each other, which means that these two components can possibly be attributed to one object.
References
[1] Granstorm, K., C. Lundquiest, and O. Orguner. " Extended target tracking using a Gaussianmixture PHD filter." IEEE Transactions on Aerospace and Electronic Systems. Vol. 48, Number 4, 2012, pp. 32683286.
[2] Granstorm, K., and O. Orguner." A PHD filter for tracking multiple extended targets using random matrices." IEEE Transactions on Signal Processing. Vol. 60, Number 11, 2012, pp. 56575671.
[3] Granstorm, K., and A. Natale, P. Braca, G. Ludeno, and F. Serafino."Gamma Gaussian inverse Wishart probability hypothesis density for extended target tracking using Xband marine radar data." IEEE Transactions on Geoscience and Remote Sensing. Vol. 53, Number 12, 2015, pp. 66176631.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).
All the detections must have properties with the same sizes and types.
See Also
Functions
Objects
Objects
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLABBefehl
Sie haben auf einen Link geklickt, der diesem MATLABBefehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLABBefehlsfenster aus. Webbrowser unterstützen keine MATLABBefehle.
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: .
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)