OpenCV  4.1.0
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
cv::MultiTracker Class Reference

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

#include <opencv2/tracking/tracker.hpp>

Inheritance diagram for cv::MultiTracker:
cv::Algorithm

Public Member Functions

 MultiTracker ()
 Constructor.
 
 ~MultiTracker () CV_OVERRIDE
 Destructor.
 
bool add (Ptr< Tracker > newTracker, InputArray image, const Rect2d &boundingBox)
 Add a new object to be tracked.
 
bool add (std::vector< Ptr< 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
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindingsThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

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< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file.
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String.
 
template<typename _Tp >
static Ptr< _Tp > read (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

cv::MultiTracker::MultiTracker ( )
Python:
<MultiTracker object>=cv.MultiTracker()

Constructor.

cv::MultiTracker::~MultiTracker ( )

Destructor.

Member Function Documentation

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

Add a new object to be tracked.

Parameters
newTrackertracking algorithm to be used
imageinput image
boundingBoxa rectangle represents ROI of the tracked object
bool cv::MultiTracker::add ( std::vector< Ptr< Tracker > >  newTrackers,
InputArray  image,
std::vector< Rect2d boundingBox 
)
Python:
retval=cv.MultiTracker.add(newTracker, image, boundingBox)

Add a set of objects to be tracked.

Parameters
newTrackerslist of tracking algorithms to be used
imageinput image
boundingBoxlist of the tracked objects
static Ptr<MultiTracker> cv::MultiTracker::create ( )
static
Python:
retval=cv.MultiTracker_create()

Returns a pointer to a new instance of MultiTracker.

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

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

bool cv::MultiTracker::update ( InputArray  image)
Python:
retval, boundingBox=cv.MultiTracker.update(image)

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

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

Update the current tracking status.

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

Member Data Documentation

std::vector<Rect2d> cv::MultiTracker::objects
protected
std::vector< Ptr<Tracker> > cv::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: