OpenCV  4.8.0
Open Source Computer Vision
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>

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 DescriptordescriptorFast () const =0
 Fast descriptor getter. More...
 
virtual const DescriptordescriptorStrong () const =0
 Strong descriptor getter. More...
 
virtual const DistancedistanceFast () const =0
 Fast distance getter. More...
 
virtual const DistancedistanceStrong () 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 TrackerParamsparams () 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

◆ Distance

Constructor & Destructor Documentation

◆ ~ITrackerByMatching()

virtual cv::detail::tracking::tbm::ITrackerByMatching::~ITrackerByMatching ( )
inlinevirtual

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]frameColored 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
idTrack 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_idIndex 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]frameColored image (CV_8UC3).
[in]detectionsDetected objects on the frame.
[in]timestampTimestamp 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]valFast descriptor used in pipeline.

◆ setDescriptorStrong()

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

Strong descriptor setter.

Parameters
[in]valStrong descriptor used in pipeline.

◆ setDistanceFast()

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

Fast distance setter.

Parameters
[in]valFast distance used in pipeline.

◆ setDistanceStrong()

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

Strong distance setter.

Parameters
[in]valStrong distance used in pipeline.

◆ setParams()

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

Pipeline parameters setter.

Parameters
[in]paramsParameters 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: