Skip to content

Tracking

Moscowsky Anton edited this page Nov 23, 2021 · 8 revisions

Tracking

1. Overview

Tracking in this package is an add-on over OpenCV tracking API. The main difference lies in the fact that OpenCV tracking is included in the work only when the main object detector has not coped with the task. The rest of the time, the tracking task is concerned with the ratio of objects in subsequent frames.

This part of the package only works with the version OpenCV 4!

1.1. Process

  1. The object detector returns a new set of recognized object instances. If this object is recognized for the first time, then all instances form new tracks.
  2. If there are already tracks in the system, then the matcher, based on the criterion of maximum intersection over union, matches the object instances to the tracks. Such tracks receive the DETECTED status.
  3. For those instances of objects that have not received a pair of tracks, they form new tracks, also receiving the DETECTED status.
  4. For those tracks that have not received a pair among the objects, tracking is initiated by OpenCV, which tries to detect the object by the latest data about it. The track gets TRACKED status. Moreover, each step of work in this mode decreases the confidence coefficient according to the formula score [t + 1] = score [t] (1 - decay). If this coefficient reaches the Probability threshold of the object, then the track receives the LOST status and is deleted at the next iteration.
  5. Further, for tracks in the TRACKED status, attributes with the Check type and Extract type are applied.

tracking process

1.2. Track status

As mentioned, a track can have three statuses DETECTED, TRACKCED and LOST.

  • DETECTED means that this object is recognized directly by its detector.
  • TRACKED means that this object was recognized using OpenCV tracking.
  • LOST Indicates that both the object detector and OpenCV tracking could not find the object. The object visualisates or published with this status contains information on the latest data. Tis stauses are inclided to ROS messages of package.

2. XML-description

2.1. Parameters

  • The tracking method is described inside the tag. Below is a table of tracking methods.
  • IOU (double, default: 0.5) Intersection over union. Object and track can only be matched to each other if they have IOUs greater than this threshold.
  • decay (double, default: 0.1) Decay rate, i.e. how quickly the confidence factor will decrease if OpenCV tracking is working. A decay of 0 means that tracking will continue until the object is lost. A decay equal to 1 means that the track will be deleted immediately after the detector fails. However, the same effect can be achieved by specifying None in the tracking method.

2.2. Example

<Tracker IOU="0.5" decay="0.1">KCF</Tracker>

Трекер должен быть объявлен в описании объекта

<SimpleObject Name="PersonCNNtracked" ID="1">    
   <Tracker IOU="0.5" decay="0.1">KCF</Tracker>
   <Attribute Type="Detect">Person</Attribute>            
</SimpleObject> 

2.3. Tracking method table

Metod Comment
None OpenCV tracking disabled, only IOU matcher works
KCF
BOOSTING
MIL
TLD
MEDIANFLOW
GOTURN Additional steps are required to use TODO
MOSSE
CSRT

2.4. Video-examples

OpenCV tracking algorithms comparison in motion

Soft Tracking Example

Clone this wiki locally