# trackCLEARMetrics

## Description

The `trackCLEARMetrics`

object implements the Classification of Events,
Activities, and Relationships (CLEAR) Multi-Object Tracking (MOT) metrics, which evaluate
tracking performance by comparing tracks with ground truth. Other than CLEAR, the object also
outputs Mostly-Tracked, Partially-Tracked, and Mostly-Lost MOT metrics. You can set the
similarity method to intersection over union, Euclidean distance, and a custom method. The
object uses the similarity method to compare tracks with truth.

## Creation

## Properties

## Object Functions

`evaluate` | Evaluate metrics on tracks and truths |

## Examples

## Algorithms

The `trackCLEARMetrics`

object implements the CLEAR
algorithms and takes these steps to calculate various metrics based on a list of tracks
(*T*) and truths (*R*).

First, the object loops over each time step

*t*_{k},*k*= 1, …,*N*, derived from the time in the list of truths.The object extracts all the tracks and truths at time

*t*_{k}as*T*_{k}and*R*_{k}, respectively, from the track list (*T*) and truth list (*R*).The object calculates the similarity scores between tracks in

*T*_{k}and truths in*R*_{k}based on the specified similarity method.Using the calculated similarities at

*t*_{k}and the matching history at*t*_{k-1}, the object forms a cost matrix for matching between*T*_{k}and*R*_{k}. After that, the object matches between*T*_{k}and*R*_{k}based on the Hungarian assignment algorithm and the similarity threshold.There are three types of results from the matching:

True match — A match that associates a valid track in

*T*_{k}to a valid truth in*R*_{k}.False positive — A match in which a track is not associated to any truths.

False negative — A match in which a truth is not associated to any tracks.

The object increments the number of true matches, false positives, and false negatives, as well as the sum of all true matches similarity scores across timestamps.

Using the true matches of the previous timestamp, the object also increments the number of track switches and track fragmentations. A track switch occurs if a true object is matched in both the current and previous timestamps and the identity of the matched track changes across these two timestamps. A track fragmentation occurs if a true object has a true match in the current timestamp but does not have a true match in the previous timestamp.

Next, the object calculates metrics based on various values cumulated during the loop. In particular, it calculates the multiple object tracking accuracy (MOTA) , the multiple object tracking precision (MOTP), the Precision, and the Recall metrics as follows:

MOTA metric:

$$\text{MOTA}=1-\frac{{n}_{fp}+{n}_{fn}+{n}_{s}}{{n}_{truths}},$$

where

*n*_{truths}is the total number of truth occurrences across all time steps,*n*_{fp}is the total number of false positives,*n*_{fn}is the total number of false negatives, and*n*_{s}is the total number of switches.MOTP:

$$\text{MOTP}=\frac{1}{{n}_{t}}{\displaystyle \sum _{i=1}^{{n}_{t}}{s}_{i}},$$

where

*n*_{t}is the total number of true matches across all time stamps and*s*_{i}is the similarity score of the*i*-th true match.Precision:

$$\text{Precision}=\frac{{n}_{t}}{{n}_{t}+{n}_{fp}},$$

where

*n*_{t}is the total number of true matches and*n*_{fp}is the total number of false positives.Recall:

$$\text{Recall}=\frac{{n}_{t}}{{n}_{t}+{n}_{fn}},$$

where

*n*_{t}is the total number of true matches and*n*_{fn}is the total number of false negatives.

The definitions for all the metrics are given in the `results`

argument
of the `evaluate`

object function.

## References

[1] Bernardin, Keni, and Rainer
Stiefelhagen. “Evaluating Multiple Object Tracking Performance: The CLEAR MOT Metrics.”
*EURASIP Journal on Image and Video Processing*, vol. 2008, 2008, pp.
1–10.

[2] Li, Yuan, et al. “Learning to
Associate: HybridBoosted Multi-Target Tracker for Crowded Scene.” *2009 IEEE
Conference on Computer Vision and Pattern Recognition*, IEEE, 2009, pp.
2953–60.

[3] Luiten, Jonathon, et al. “HOTA: A
Higher Order Metric for Evaluating Multi-Object Tracking.” *International Journal of
Computer Vision*, vol. 129, no. 2, Feb. 2021, pp. 548–78.

## Version History

**Introduced in R2023a**