OpenCV 4.11.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::legacy::MultiTracker Class Reference

This class is used to track multiple objects using the specified tracker algorithm. More...

#include <opencv2/tracking/tracking_legacy.hpp>

Collaboration diagram for cv::legacy::MultiTracker:

Public Member Functions

 MultiTracker ()
 Constructor.
 
 ~MultiTracker () CV_OVERRIDE
 Destructor.
 
bool add (Ptr< cv::legacy::Tracker > newTracker, InputArray image, const Rect2d &boundingBox)
 Add a new object to be tracked.
 
bool add (std::vector< Ptr< legacy::Tracker > > newTrackers, InputArray image, std::vector< Rect2d > boundingBox)
 Add a set of objects to be tracked.
 
const std::vector< Rect2d > & getObjects () const
 Returns a reference to a storage for the tracked objects, each object corresponds to one tracker algorithm.
 
bool update (InputArray image)
 Update the current tracking status. The result will be saved in the internal storage.
 
bool update (InputArray image, std::vector< Rect2d > &boundingBox)
 Update the current tracking status.
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 Clears the algorithm state.
 
virtual bool empty () const
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 Reads algorithm parameters from a file storage.
 
virtual void save (const String &filename) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
 
void write (FileStorage &fs, const String &name) const
 

Static Public Member Functions

static Ptr< MultiTrackercreate ()
 Returns a pointer to a new instance of MultiTracker.
 
- Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp >
static Ptr< _Tpload (const String &filename, const String &objname=String())
 Loads algorithm from the file.
 
template<typename _Tp >
static Ptr< _TploadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String.
 
template<typename _Tp >
static Ptr< _Tpread (const FileNode &fn)
 Reads algorithm from the file node.
 

Protected Attributes

std::vector< Rect2dobjects
 
std::vector< Ptr< Tracker > > trackerList
 < storage for the tracker algorithms.
 

Additional Inherited Members

- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

Detailed Description

This class is used to track multiple objects using the specified tracker algorithm.

The MultiTracker is naive implementation of multiple object tracking. It process the tracked objects independently without any optimization accross the tracked objects.

Constructor & Destructor Documentation

◆ MultiTracker()

cv::legacy::MultiTracker::MultiTracker ( )
Python:
cv.legacy.MultiTracker() -> <legacy_MultiTracker object>

Constructor.

◆ ~MultiTracker()

cv::legacy::MultiTracker::~MultiTracker ( )

Destructor.

Member Function Documentation

◆ add() [1/2]

bool cv::legacy::MultiTracker::add ( Ptr< cv::legacy::Tracker > newTracker,
InputArray image,
const Rect2d & boundingBox )
Python:
cv.legacy.MultiTracker.add(newTracker, image, boundingBox) -> retval

Add a new object to be tracked.

Parameters
newTrackertracking algorithm to be used
imageinput image
boundingBoxa rectangle represents ROI of the tracked object

◆ add() [2/2]

bool cv::legacy::MultiTracker::add ( std::vector< Ptr< legacy::Tracker > > newTrackers,
InputArray image,
std::vector< Rect2d > boundingBox )
Python:
cv.legacy.MultiTracker.add(newTracker, image, boundingBox) -> retval

Add a set of objects to be tracked.

Parameters
newTrackerslist of tracking algorithms to be used
imageinput image
boundingBoxlist of the tracked objects

◆ create()

static Ptr< MultiTracker > cv::legacy::MultiTracker::create ( )
static
Python:
cv.legacy.MultiTracker.create() -> retval
cv.legacy.MultiTracker_create() -> retval

Returns a pointer to a new instance of MultiTracker.

◆ getObjects()

const std::vector< Rect2d > & cv::legacy::MultiTracker::getObjects ( ) const
Python:
cv.legacy.MultiTracker.getObjects() -> retval

Returns a reference to a storage for the tracked objects, each object corresponds to one tracker algorithm.

◆ update() [1/2]

bool cv::legacy::MultiTracker::update ( InputArray image)
Python:
cv.legacy.MultiTracker.update(image) -> retval, boundingBox

Update the current tracking status. The result will be saved in the internal storage.

Parameters
imageinput image

◆ update() [2/2]

bool cv::legacy::MultiTracker::update ( InputArray image,
std::vector< Rect2d > & boundingBox )
Python:
cv.legacy.MultiTracker.update(image) -> retval, boundingBox

Update the current tracking status.

Parameters
imageinput image
boundingBoxthe tracking result, represent a list of ROIs of the tracked objects.

Member Data Documentation

◆ objects

std::vector<Rect2d> cv::legacy::MultiTracker::objects
protected

◆ trackerList

std::vector< Ptr<Tracker> > cv::legacy::MultiTracker::trackerList
protected

< storage for the tracker algorithms.

storage for the tracked objects, each object corresponds to one tracker algorithm.


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