initcvimm

IMM initialization with two constant velocity models

Since R2023b

Syntax

``imm = initcvimm(detection)``

Description

example

````imm = initcvimm(detection)` initializes a `trackingIMM` object with two constant velocity models based on the information provided in `detection`. The first model assumes a smooth trajectory and uses low process noise. The second model assumes a maneuvering trajectory and uses high process noise. For more details, see Algorithms and `trackingIMM`.```

Examples

collapse all

Create a 3-D position detection in the rectangular frame. The measured coordinates are x = 1, y = 3, and z = 0. Set the covariance of the measurement noise as [1 0.4 0; 0.4 4 0; 0 0 1].

`detection = objectDetection(0,[1;3;0],MeasurementNoise=[1 0.4 0; 0.4 4 0; 0 0 1]);`

Use the `initcvimm` function to create a `trackingIMM` object based on the detection.

`imm = initcvimm(detection);`

As expected, the initialized filter has two tracking filters with low and high process noise, respectively.

`imm.TrackingFilters`
```ans=2×1 cell array {1x1 trackingEKF} {1x1 trackingEKF} ```
`imm.TrackingFilters{1}.ProcessNoise`
```ans = 3×3 0.0400 0 0 0 0.0400 0 0 0 0.0400 ```
`imm.TrackingFilters{2}.ProcessNoise`
```ans = 3×3 100 0 0 0 100 0 0 0 100 ```

Verify the filter state has the same position components as those of the detection.

`imm.State`
```ans = 6×1 1 0 3 0 0 0 ```

Verify that the filter measurement noise is the same as that of the detection.

`imm.MeasurementNoise`
```ans = 3×3 1.0000 0.4000 0 0.4000 4.0000 0 0 0 1.0000 ```

Create a 3-D position detection in the spherical frame. The measurement has an azimuth of 40 degrees, an elevation of 6 degrees, a range of 100 meters, and a rang-rate of 5 m/s. Also, specify the measurement noise for the measurement.

```meas = [40;6;100;5]; measNoise = diag([2.5,2.5,0.5,1].^2);```

Specify the measurement parameters and create the detection.

```measParams = struct(Frame="Spherical",HasAzimuth=true, ... HasElevation=true,HasRange=true, ... HasVelocity=true); detection = objectDetection(0,meas,MeasurementNoise=measNoise, ... MeasurementParameters=measParams);```

Use the `initcvimm` function to create a `trackingIMM` object based on the detection.

`imm = initcvimm(detection);`

As expected, the initialized filter has two tracking filters with low and high process noise, respectively.

`imm.TrackingFilters`
```ans=2×1 cell array {1x1 trackingEKF} {1x1 trackingEKF} ```
`imm.TrackingFilters{1}.ProcessNoise`
```ans = 3×3 0.0400 0 0 0 0.0400 0 0 0 0.0400 ```
`imm.TrackingFilters{2}.ProcessNoise`
```ans = 3×3 100 0 0 0 100 0 0 0 100 ```

Verify that the filter measurement noise is the same as that of the detection.

`imm.MeasurementNoise`
```ans = 4×4 6.2500 0 0 0 0 6.2500 0 0 0 0 0.2500 0 0 0 0 1.0000 ```

Input Arguments

collapse all

Detection report, specified as an `objectDetection` object.

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

Interacting multiple model filter, returned as a `trackingIMM` object. The object has two constant velocity motion models.

Algorithms

• The function initializes a `trackingIMM` object. The state of the filter is defined as [x; vx; y; vy; z; vz], where x, y, and z are the position coordinates and vx, vy, and vz are the corresponding velocities.

• The `TrackingFilters` property of the initialized `trackingIMM` object contains these tracking filters.

• The first filter is a `trackingEKF` object based on the constant velocity motion model. The `ProcessNoise` property of the filter is set to `0.04*eye(3)` m/s2. The rest of the filter properties are initialized by using the `initcvekf` function. See the Algorithm section of the `initcvekf` function page for more details.

• The second filter is the same as the first filter except its `ProcessNoise` property is set to `100*eye(3)` m/s2.

• You can use this function as the `FilterInitializationFcn` property of a tracker object such as the `trackerGNN` object.

Version History

Introduced in R2023b