Returns updated track positions and position covariance matrix
returns a matrix of track positions. Each row contains the position of a tracked
object.position
= getTrackPositions(tracks
,positionSelector
)
[
returns a matrix of track positions.position
,positionCovariances
]
= getTrackPositions(tracks
,positionSelector
)
Create an extended Kalman filter tracker for 3-D constant-acceleration motion.
tracker = trackerTOMHT('FilterInitializationFcn',@initcaekf);
Update the tracker with a single detection and get the tracks output.
detection = objectDetection(0,[10;-20;4],'ObjectClassID',3);
tracks = step(tracker,detection,0)
tracks = objectTrack with properties: TrackID: 1 BranchID: 1 SourceIndex: 0 UpdateTime: 0 Age: 1 State: [9x1 double] StateCovariance: [9x9 double] StateParameters: [1x1 struct] ObjectClassID: 3 TrackLogic: 'Score' TrackLogicState: [13.7102 13.7102] IsConfirmed: 1 IsCoasted: 0 IsSelfReported: 1 ObjectAttributes: [1x1 struct]
Obtain the position vector from the track state.
positionSelector = [1 0 0 0 0 0 0 0 0; 0 0 0 1 0 0 0 0 0; 0 0 0 0 0 0 1 0 0]; position = getTrackPositions(tracks, positionSelector)
position = 1×3
10.0000 -20.0000 4.0000
Create an extended Kalman filter tracker for 3-D constant-velocity motion.
tracker = trackerTOMHT('FilterInitializationFcn',@initcvekf);
Update the tracker with a single detection and get the tracks output.
detection = objectDetection(0,[10;3;-7],'ObjectClassID',3);
tracks = step(tracker,detection,0)
tracks = objectTrack with properties: TrackID: 1 BranchID: 1 SourceIndex: 0 UpdateTime: 0 Age: 1 State: [6x1 double] StateCovariance: [6x6 double] StateParameters: [1x1 struct] ObjectClassID: 3 TrackLogic: 'Score' TrackLogicState: [13.7102 13.7102] IsConfirmed: 1 IsCoasted: 0 IsSelfReported: 1 ObjectAttributes: [1x1 struct]
Obtain the position vector and position covariance for that track
positionSelector = [1 0 0 0 0 0; 0 0 1 0 0 0; 0 0 0 0 1 0]; [position,positionCovariance] = getTrackPositions(tracks,positionSelector)
position = 1×3
10.0000 3.0000 -7.0000
positionCovariance = 3×3
1.0000 -0.0000 0
-0.0000 1.0000 -0.0000
0 -0.0000 1.0000
tracks
— Track data structurestruct array
Tracked object, specified as a
struct
array. A track struct
array
is an array of MATLAB®
struct
types containing sufficient information to obtain
the track position vector and, optionally, the position covariance matrix.
At a minimum, the struct
must contain a
State
column vector field and a positive-definite
StateCovariance
matrix field. For an example of a
track struct
used by Sensor Fusion and Tracking Toolbox™, examine the output argument, tracks
,
returned by the step
object function of trackerGNN
.
positionSelector
— Position selection matrixPosition selector, specified as a D-by-N real-valued matrix of ones and zeros. D is the number of dimensions of the tracker. N is the size of the state vector. Using this matrix, the function extracts track positions from the state vector. Multiply the state vector by position selector matrix returns positions. The same selector is applied to all object tracks.
position
— Positions of tracked objectsPositions of tracked objects at last update time, returned as a real-valued M-by-D matrix. D represents the number of position elements. M represents the number of tracks.
positionCovariances
— Position covariance matrices of tracked objectsPosition covariance matrices of tracked objects, returned as a real-valued D-by-D-M array. D represents the number of position elements. M represents the number of tracks. Each D-by-D submatrix is a position covariance matrix for a track.
Show the position selection matrix for two-dimensional motion when the state consists of the position and velocity.
Show the position selection matrix for three-dimensional motion when the state consists of the position and velocity.
Show the position selection matrix for three-dimensional motion when the state consists of the position, velocity, and acceleration.
getTrackVelocities
| initcaekf
| initcakf
| initcaukf
| initctekf
| initctukf
| initcvkf
| initcvukf
You have a modified version of this example. Do you want to open this example with your edits?