| OpenCV 4.3.0 Open Source Computer Vision

Public Types | Public Member Functions | List of all members
cv::tbm::ITrackerByMatching Class Referenceabstract

Tracker-by-Matching algorithm interface. More...

`#include <opencv2/tracking/tracking_by_matching.hpp>`

## Public Types
using | Descriptor = std::shared_ptr< IImageDescriptor >
using | Distance = std::shared_ptr< IDescriptorDistance >

## Public Member Functions
virtual | ~ITrackerByMatching ()
| Destructor for the tracker. More...
virtual size_t | count () const =0
| Returns number of counted people. More...
virtual const Descriptor & | descriptorFast () const =0
| Fast descriptor getter. More...
virtual const Descriptor & | descriptorStrong () const =0
| Strong descriptor getter. More...
virtual const Distance & | distanceFast () const =0
| Fast distance getter. More...
virtual const Distance & | distanceStrong () const =0
| Strong distance getter. More...
virtual cv::Mat | drawActiveTracks (const cv::Mat &frame)=0
| Draws active tracks on a given frame. More...
virtual void | dropForgottenTrack (size_t track_id)=0
| dropForgottenTrack Check that the track was lost too many frames ago and removes it frm memory. More...
virtual void | dropForgottenTracks ()=0
| dropForgottenTracks Removes tracks from memory that were lost too many frames ago. More...
virtual std::unordered_map< size_t, std::vector< cv::Point > > | getActiveTracks () const =0
| Get active tracks to draw. More...
virtual bool | isTrackForgotten (size_t id) const =0
| isTrackForgotten returns true if track is forgotten. More...
virtual bool | isTrackValid (size_t track_id) const =0
| isTrackValid Checks whether track is valid (duration > threshold). More...
virtual const TrackerParams & | params () const =0
| Pipeline parameters getter. More...
virtual void | process (const cv::Mat &frame, const TrackedObjects &detections, uint64_t timestamp)=0
| Process given frame. More...
virtual void | setDescriptorFast (const Descriptor &val)=0
| Fast descriptor setter. More...
virtual void | setDescriptorStrong (const Descriptor &val)=0
| Strong descriptor setter. More...
virtual void | setDistanceFast (const Distance &val)=0
| Fast distance setter. More...
virtual void | setDistanceStrong (const Distance &val)=0
| Strong distance setter. More...
virtual void | setParams (const TrackerParams &params)=0
| Pipeline parameters setter. More...
virtual TrackedObjects | trackedDetections () const =0
| Get tracked detections. More...
virtual const std::unordered_map< size_t, Track > & | tracks () const =0
| tracks Returns all tracks including forgotten (lost too many frames ago). More...

## Detailed Description

Tracker-by-Matching algorithm interface.

This class is implementation of tracking-by-matching system. It uses two different appearance measures to compute affinity between bounding boxes: some fast descriptor and some strong descriptor. Each time the assignment problem is solved. The assignment problem in our case is how to establish correspondence between existing tracklets and recently detected objects. First step is to compute an affinity matrix between tracklets and detections. The affinity equals to appearance_affinity * motion_affinity * shape_affinity. Where appearance is 1 - distance(tracklet_fast_dscr, detection_fast_dscr). Second step is to solve the assignment problem using Kuhn-Munkres algorithm. If correspondence between some tracklet and detection is established with low confidence (affinity) then the strong descriptor is used to determine if there is correspondence between tracklet and detection.

## Member Typedef Documentation

## ◆ Descriptor

using cv::tbm::ITrackerByMatching::Descriptor = std::shared_ptr<IImageDescriptor>

## ◆ Distance

using cv::tbm::ITrackerByMatching::Distance = std::shared_ptr<IDescriptorDistance>

## Constructor & Destructor Documentation

## ◆ ~ITrackerByMatching()

virtual cv::tbm::ITrackerByMatching::~ITrackerByMatching | ( |  | ) |
| inline virtual

Destructor for the tracker.

## Member Function Documentation

## ◆ count()

virtual size_t cv::tbm::ITrackerByMatching::count | ( |  | ) | const
| pure virtual

Returns number of counted people.

Returns
  a number of counted people.

## ◆ descriptorFast()

virtual const Descriptor& cv::tbm::ITrackerByMatching::descriptorFast | ( |  | ) | const
| pure virtual

Fast descriptor getter.

Returns
  Fast descriptor used in pipeline.

## ◆ descriptorStrong()

virtual const Descriptor& cv::tbm::ITrackerByMatching::descriptorStrong | ( |  | ) | const
| pure virtual

Strong descriptor getter.

Returns
  Strong descriptor used in pipeline.

## ◆ distanceFast()

virtual const Distance& cv::tbm::ITrackerByMatching::distanceFast | ( |  | ) | const
| pure virtual

Fast distance getter.

Returns
  Fast distance used in pipeline.

## ◆ distanceStrong()

virtual const Distance& cv::tbm::ITrackerByMatching::distanceStrong | ( |  | ) | const
| pure virtual

Strong distance getter.

Returns
  Strong distance used in pipeline.

## ◆ drawActiveTracks()

virtual cv::Mat cv::tbm::ITrackerByMatching::drawActiveTracks | ( | const cv::Mat & | frame | ) |
| pure virtual

Draws active tracks on a given frame.

Parameters

  [in] | frame | Colored image (CV_8UC3).

Returns
  Colored image with drawn active tracks.

## ◆ dropForgottenTrack()

virtual void cv::tbm::ITrackerByMatching::dropForgottenTrack | ( | size_t | track_id | ) |
| pure virtual

dropForgottenTrack Check that the track was lost too many frames ago and removes it frm memory.

## ◆ dropForgottenTracks()

virtual void cv::tbm::ITrackerByMatching::dropForgottenTracks | ( |  | ) |
| pure virtual

dropForgottenTracks Removes tracks from memory that were lost too many frames ago.

## ◆ getActiveTracks()

virtual std::unordered_map<size_t, std::vector<cv::Point> > cv::tbm::ITrackerByMatching::getActiveTracks | ( |  | ) | const
| pure virtual

Get active tracks to draw.

Returns
  Active tracks.

## ◆ isTrackForgotten()

virtual bool cv::tbm::ITrackerByMatching::isTrackForgotten | ( | size_t | id | ) | const
| pure virtual

isTrackForgotten returns true if track is forgotten.

Parameters

  id | Track ID.

Returns
  true if track is forgotten.

## ◆ isTrackValid()

virtual bool cv::tbm::ITrackerByMatching::isTrackValid | ( | size_t | track_id | ) | const
| pure virtual

isTrackValid Checks whether track is valid (duration > threshold).

Parameters

  track_id | Index of checked track.

Returns
  True if track duration exceeds some predefined value.

## ◆ params()

virtual const TrackerParams& cv::tbm::ITrackerByMatching::params | ( |  | ) | const
| pure virtual

Pipeline parameters getter.

Returns
  Parameters of pipeline.

## ◆ process()

virtual void cv::tbm::ITrackerByMatching::process | ( | const cv::Mat & | frame,
|  | const TrackedObjects & | detections,
|  | uint64_t | timestamp
| ) |  |
| pure virtual

Process given frame.

Parameters

  [in] | frame | Colored image (CV_8UC3).
  [in] | detections | Detected objects on the frame.
  [in] | timestamp | Timestamp must be positive and measured in milliseconds

## ◆ setDescriptorFast()

virtual void cv::tbm::ITrackerByMatching::setDescriptorFast | ( | const Descriptor & | val | ) |
| pure virtual

Fast descriptor setter.

Parameters

  [in] | val | Fast descriptor used in pipeline.

## ◆ setDescriptorStrong()

virtual void cv::tbm::ITrackerByMatching::setDescriptorStrong | ( | const Descriptor & | val | ) |
| pure virtual

Strong descriptor setter.

Parameters

  [in] | val | Strong descriptor used in pipeline.

## ◆ setDistanceFast()

virtual void cv::tbm::ITrackerByMatching::setDistanceFast | ( | const Distance & | val | ) |
| pure virtual

Fast distance setter.

Parameters

  [in] | val | Fast distance used in pipeline.

## ◆ setDistanceStrong()

virtual void cv::tbm::ITrackerByMatching::setDistanceStrong | ( | const Distance & | val | ) |
| pure virtual

Strong distance setter.

Parameters

  [in] | val | Strong distance used in pipeline.

## ◆ setParams()

virtual void cv::tbm::ITrackerByMatching::setParams | ( | const TrackerParams & | params | ) |
| pure virtual

Pipeline parameters setter.

Parameters

  [in] | params | Parameters of pipeline.

## ◆ trackedDetections()

virtual TrackedObjects cv::tbm::ITrackerByMatching::trackedDetections | ( |  | ) | const
| pure virtual

Get tracked detections.

Returns
  Tracked detections.

## ◆ tracks()

virtual const std::unordered_map<size_t, Track>& cv::tbm::ITrackerByMatching::tracks | ( |  | ) | const
| pure virtual

tracks Returns all tracks including forgotten (lost too many frames ago).

Returns
  Set of tracks {id, track}.

The documentation for this class was generated from the following file:

- opencv2/tracking/tracking_by_matching.hpp