This class is used to track multiple objects using the specified tracker algorithm. More...
#include <opencv2/tracking/tracking_legacy.hpp>
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< MultiTracker > | create () |
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< Rect2d > | objects |
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 | ( | ) |
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 | ||
) |
Add a new object to be tracked.
- Parameters
-
newTracker tracking algorithm to be used image input image boundingBox a 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 | ||
) |
Add a set of objects to be tracked.
- Parameters
-
newTrackers list of tracking algorithms to be used image input image boundingBox list of the tracked objects
◆ create()
|
static |
Returns a pointer to a new instance of MultiTracker.
◆ getObjects()
const std::vector< Rect2d > & cv::legacy::MultiTracker::getObjects | ( | ) | const |
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 | ) |
Update the current tracking status. The result will be saved in the internal storage.
- Parameters
-
image input image
◆ update() [2/2]
bool cv::legacy::MultiTracker::update | ( | InputArray | image, |
std::vector< Rect2d > & | boundingBox | ||
) |
Update the current tracking status.
- Parameters
-
image input image boundingBox the tracking result, represent a list of ROIs of the tracked objects.
Member Data Documentation
◆ objects
|
protected |
◆ trackerList
< 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:
- opencv2/tracking/tracking_legacy.hpp