| OpenCV 5.0.0alpha Open Source Computer Vision

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
cv::detail::tracking::tbm::ITrackerByMatching Class Referenceabstract

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

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

Collaboration diagram for cv::detail::tracking::tbm::ITrackerByMatching:

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

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

## 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::detail::tracking::tbm::ITrackerByMatching::Descriptor = std::shared_ptr<IImageDescriptor>

## ◆ Distance

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

## Constructor & Destructor Documentation

## ◆ ~ITrackerByMatching()

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

Destructor for the tracker.

## Member Function Documentation

## ◆ count()

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

Returns number of counted people.

Returns
  a number of counted people.

## ◆ descriptorFast()

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

Fast descriptor getter.

Returns
  Fast descriptor used in pipeline.

## ◆ descriptorStrong()

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

Strong descriptor getter.

Returns
  Strong descriptor used in pipeline.

## ◆ distanceFast()

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

Fast distance getter.

Returns
  Fast distance used in pipeline.

## ◆ distanceStrong()

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

Strong distance getter.

Returns
  Strong distance used in pipeline.

## ◆ drawActiveTracks()

virtual cv::Mat cv::detail::tracking::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::detail::tracking::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::detail::tracking::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::detail::tracking::tbm::ITrackerByMatching::getActiveTracks | ( |  | ) | const
| pure virtual

Get active tracks to draw.

Returns
  Active tracks.

## ◆ isTrackForgotten()

virtual bool cv::detail::tracking::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::detail::tracking::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::detail::tracking::tbm::ITrackerByMatching::params | ( |  | ) | const
| pure virtual

Pipeline parameters getter.

Returns
  Parameters of pipeline.

## ◆ process()

virtual void cv::detail::tracking::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::detail::tracking::tbm::ITrackerByMatching::setDescriptorFast | ( | const Descriptor & | val | ) |
| pure virtual

Fast descriptor setter.

Parameters

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

## ◆ setDescriptorStrong()

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

Strong descriptor setter.

Parameters

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

## ◆ setDistanceFast()

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

Fast distance setter.

Parameters

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

## ◆ setDistanceStrong()

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

Strong distance setter.

Parameters

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

## ◆ setParams()

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

Pipeline parameters setter.

Parameters

  [in] | params | Parameters of pipeline.

## ◆ trackedDetections()

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

Get tracked detections.

Returns
  Tracked detections.

## ◆ tracks()

virtual const std::unordered_map< size_t, Track > & cv::detail::tracking::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