Represents the model of the target at frame (all states and scores)
[AAM] The set of the pair
ConfidenceMap:
typedef std::vector<std::pair<Ptr<TrackerTargetState>, float> > ConfidenceMap;
See also
Represents the estimate states for all frames
[AAM] is the trajectory of the target up to time
Trajectory:
typedef std::vector<Ptr<TrackerTargetState> > Trajectory;
See also
Abstract base class for TrackerTargetState that represents a possible state of the target.
[AAM] all the states candidates.
Inherits this class with your Target state
TrackerTargetState class:
class CV_EXPORTS_W TrackerTargetState
{
public:
virtual ~TrackerTargetState(){};
Point2f getTargetPosition() const;
void setTargetPosition( const Point2f& position );
int getTargetWidth() const;
void setTargetWidth( int width );
int getTargetHeight() const;
void setTargetHeight( int height );
};
In own implementation you can add scale variation, width, height, orientation, etc.
Abstract base class for TrackerStateEstimator that estimates the most likely target state.
[AAM] State estimator
[AMVOT] Statistical modeling (Fig. 3), Table III (generative) - IV (discriminative) - V (hybrid)
TrackerStateEstimator class:
class CV_EXPORTS_W TrackerStateEstimator
{
public:
virtual ~TrackerStateEstimator();
static Ptr<TrackerStateEstimator> create( const String& trackeStateEstimatorType );
Ptr<TrackerTargetState> estimate( const std::vector<ConfidenceMap>& confidenceMaps );
void update( std::vector<ConfidenceMap>& confidenceMaps );
String getClassName() const;
};
Create TrackerStateEstimator by tracker state estimator type
Parameters: |
|
---|
The modes available now:
The modes available soon:
Estimate the most likely target state, return the estimated state
Parameters: |
|
---|
Update the ConfidenceMap with the scores
Parameters: |
|
---|
Get the name of the specific TrackerStateEstimator
Abstract class that represents the model of the target. It must be instantiated by specialized tracker
[AAM] Ak
Inherits this with your TrackerModel
TrackerModel class:
class CV_EXPORTS_W TrackerModel
{
public:
TrackerModel();
virtual ~TrackerModel();
void modelEstimation( const std::vector<Mat>& responses );
void modelUpdate();
bool runStateEstimator();
bool setTrackerStateEstimator( Ptr<TrackerStateEstimator> trackerStateEstimator );
void setLastTargetState( const Ptr<TrackerTargetState>& lastTargetState );
Ptr<TrackerTargetState> getLastTargetState() const;
const std::vector<ConfidenceMap>& getConfidenceMaps() const;
const ConfidenceMap& getLastConfidenceMap() const;
Ptr<TrackerStateEstimator> getTrackerStateEstimator() const;
};
Estimate the most likely target location
[AAM] ME, Model Estimation table I
Parameters: |
|
---|
Update the model
[AAM] MU, Model Update table I
Run the TrackerStateEstimator, return true if is possible to estimate a new state, false otherwise
Set TrackerEstimator, return true if the tracker state estimator is added, false otherwise
Parameters: |
|
---|
Note
You can add only one TrackerStateEstimator
Set the current TrackerTargetState in the Trajectory
Parameters: |
|
---|
Get the last TrackerTargetState from Trajectory
Get the list of the ConfidenceMap
Get the last ConfidenceMap for the current frame
Get the TrackerStateEstimator
In [AMVOT] Statistical modeling (Fig. 3), Table III (generative) - IV (discriminative) - V (hybrid) are described the most known statistical model.
At moment TrackerStateEstimatorMILBoosting and TrackerStateEstimatorAdaBoosting are implemented.
TrackerStateEstimator based on Boosting
TrackerStateEstimatorMILBoosting class:
class CV_EXPORTS_W TrackerStateEstimatorMILBoosting : public TrackerStateEstimator
{
public:
class TrackerMILTargetState : public TrackerTargetState
{
...
};
TrackerStateEstimatorMILBoosting( int nFeatures = 250 );
~TrackerStateEstimatorMILBoosting();
void setCurrentConfidenceMap( ConfidenceMap& confidenceMap );
};
Implementation of the target state for TrackerMILTargetState
TrackerMILTargetState class:
class TrackerMILTargetState : public TrackerTargetState
{
public:
TrackerMILTargetState( const Point2f& position, int targetWidth, int targetHeight, bool foreground, const Mat& features );
~TrackerMILTargetState(){};
void setTargetFg( bool foreground );
void setFeatures( const Mat& features );
bool isTargetFg() const;
Mat getFeatures() const;
};
Set label: true for target foreground, false for background
Parameters: |
|
---|
Set the features extracted from TrackerFeatureSet
Parameters: |
|
---|
Get the label. Return true for target foreground, false for background
Get the features extracted
Constructor
Parameters: |
|
---|
Set the current confidenceMap
Parameters: |
|
---|
TrackerStateEstimatorAdaBoosting based on ADA-Boosting
TrackerStateEstimatorAdaBoosting class:
class CV_EXPORTS_W TrackerStateEstimatorAdaBoosting : public TrackerStateEstimator
{
public:
class TrackerAdaBoostingTargetState : public TrackerTargetState
{
...
};
TrackerStateEstimatorAdaBoosting( int numClassifer, int initIterations, int nFeatures, Size patchSize, const Rect& ROI, const std::vector<std::pair<float, float> >& meanSigma );
~TrackerStateEstimatorAdaBoosting();
Rect getSampleROI() const;
void setSampleROI( const Rect& ROI );
void setCurrentConfidenceMap( ConfidenceMap& confidenceMap );
std::vector<int> computeSelectedWeakClassifier();
std::vector<int> computeReplacedClassifier();
std::vector<int> computeSwappedClassifier();
void setMeanSigmaPair( const std::vector<std::pair<float, float> >& meanSigmaPair );
};
Implementation of the target state for TrackerAdaBoostingTargetState
TrackerAdaBoostingTargetState class:
class TrackerAdaBoostingTargetState : public TrackerTargetState
{
public:
TrackerAdaBoostingTargetState( const Point2f& position, int width, int height, bool foreground, const Mat& responses );
~TrackerAdaBoostingTargetState(){};
void setTargetResponses( const Mat& responses );
void setTargetFg( bool foreground );
Mat getTargetResponses() const;
bool isTargetFg() const;
};
Set label: true for target foreground, false for background
Parameters: |
|
---|
Set the features extracted from TrackerFeatureSet
Parameters: |
|
---|
Get the label. Return true for target foreground, false for background
Get the features extracted
Constructor
Parameters: |
|
---|
Set the current confidenceMap
Parameters: |
|
---|
Get the sampling ROI
Set the sampling ROI
Parameters: |
|
---|
Get the list of the selected weak classifiers for the classification step
Get the list of the weak classifiers that should be replaced