OpenCV
4.5.1
Open Source Computer Vision
|
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 ¶ms)=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... | |
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.
using cv::detail::tracking::tbm::ITrackerByMatching::Descriptor = std::shared_ptr<IImageDescriptor> |
using cv::detail::tracking::tbm::ITrackerByMatching::Distance = std::shared_ptr<IDescriptorDistance> |
|
inlinevirtual |
Destructor for the tracker.
|
pure virtual |
Returns number of counted people.
|
pure virtual |
Fast descriptor getter.
|
pure virtual |
Strong descriptor getter.
|
pure virtual |
Fast distance getter.
|
pure virtual |
Strong distance getter.
|
pure virtual |
Draws active tracks on a given frame.
[in] | frame | Colored image (CV_8UC3). |
|
pure virtual |
dropForgottenTrack Check that the track was lost too many frames ago and removes it frm memory.
|
pure virtual |
dropForgottenTracks Removes tracks from memory that were lost too many frames ago.
|
pure virtual |
Get active tracks to draw.
|
pure virtual |
isTrackForgotten returns true if track is forgotten.
id | Track ID. |
|
pure virtual |
isTrackValid Checks whether track is valid (duration > threshold).
track_id | Index of checked track. |
|
pure virtual |
Pipeline parameters getter.
|
pure virtual |
Process given frame.
[in] | frame | Colored image (CV_8UC3). |
[in] | detections | Detected objects on the frame. |
[in] | timestamp | Timestamp must be positive and measured in milliseconds |
|
pure virtual |
Fast descriptor setter.
[in] | val | Fast descriptor used in pipeline. |
|
pure virtual |
Strong descriptor setter.
[in] | val | Strong descriptor used in pipeline. |
|
pure virtual |
Fast distance setter.
[in] | val | Fast distance used in pipeline. |
|
pure virtual |
Strong distance setter.
[in] | val | Strong distance used in pipeline. |
|
pure virtual |
Pipeline parameters setter.
[in] | params | Parameters of pipeline. |
|
pure virtual |
Get tracked detections.
|
pure virtual |
tracks Returns all tracks including forgotten (lost too many frames ago).