This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Create constant velocity ggiwphd filter from detection report


phd = initggiwphd(detections)



phd = initggiwphd(detections) initializes a constant velocity ggiwphd filter based on information provided in object detections, detections.


This initialization function is not compatible with trackerGNN, trackerJPDA, and trackerTOMHT system objects.


collapse all

Consider an object located at position [1;2;3] with detections uniformly spread around it's extent. The size of the extent is 1.2, 2.3 and 3.5 in x, y and z directions, respectively.

detections = cell(20,1);
location = [1;2;3];
dimensions = [1.2;2.3;3.5];
rng(2018) % Reproducible results
measurements = location + dimensions.*(-1 + 2*rand(3,20));
for i = 1:20
    detections{i} = objectDetection(0,measurements(:,i));

Initialize a constant velocity ggiwphd filter with the generated detections.

phd = initcvggiwphd(detections);

Check the values of state in the filter has the same position estimates as the mean of measurements.

states = phd.States
measurementMean = mean(measurements,2)
states =


measurementMean =


Check the extent and expected number of detections.

extent = phd.ScaleMatrices/(phd.DegreesOfFreedom - 4)
expDetections = phd.Shapes/phd.Rates
extent =

    1.4603    0.0885   -0.2403
    0.0885    3.0050   -0.0225
   -0.2403   -0.0225    4.8365

expDetections =


Input Arguments

collapse all

Object detections, specified as a cell array of objectDetection objects. You can create detections directly, or you can obtain detections from the outputs of sensor objects, such as radarSensor, monostaticRadarSensor, irSensor, and sonarSensor.

Example: detection = objectDetection(0,[1;4.5;3],'MeasurementNoise', [1.0 0 0; 0 2.0 0; 0 0 1.5])

Output Arguments

collapse all

ggiwphd filter, returned as a ggiwphd object.


  • You can use initcvggiwphd as the FilterInitializationFcn property of trackingSensorConfiguration.

  • When detections are provided as input, the function adds one component to the density which reflects the mean of the detections. When the function is called without any inputs, a filter is initialized with no components in the density.

  • The function uses the spread of measurements to describe the Inverse-Wishart distribution.

  • The function uses the number of detections to describe the Gamma distribution.

  • The function configures the process noise of the filter by assuming a unit acceleration standard deviation.

  • The function specifies a maximum of 500 components in the filter.

Extended Capabilities

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

Introduced in R2019a