Class that manages the extraction and selection of features
[AAM] Feature Extraction and Feature Set Refinement (Feature Processing and Feature Selection). See table I and section III C [AMVOT] Appearance modelling -> Visual representation (Table II, section 3.1 - 3.2)
TrackerFeatureSet class:
class CV_EXPORTS_W TrackerFeatureSet
{
public:
TrackerFeatureSet();
~TrackerFeatureSet();
void extraction( const std::vector<Mat>& images );
void selection();
void removeOutliers();
bool addTrackerFeature( String trackerFeatureType );
bool addTrackerFeature( Ptr<TrackerFeature>& feature );
const std::vector<std::pair<String, Ptr<TrackerFeature> > >& getTrackerFeature() const;
const std::vector<Mat>& getResponses() const;
};
TrackerFeatureSet is an aggregation of TrackerFeature
See also
Extract features from the images collection
Parameters: |
|
---|
Identify most effective features for all feature types (optional)
Remove outliers for all feature types (optional)
Add TrackerFeature in the collection. Return true if TrackerFeature is added, false otherwise
Parameters: |
|
---|
Parameters: |
|
---|
The modes available now:
The modes that will be available soon:
Example TrackerFeatureSet::addTrackerFeature :
//sample usage:
Ptr<TrackerFeature> trackerFeature = new TrackerFeatureHAAR( HAARparameters );
featureSet->addTrackerFeature( trackerFeature );
//or add CSC sampler with default parameters
//featureSet->addTrackerFeature( "HAAR" );
Note
If you use the second method, you must initialize the TrackerFeature
Get the TrackerFeature collection (TrackerFeature name, TrackerFeature pointer)
Get the responses
Note
Be sure to call extraction before getResponses
Example TrackerFeatureSet::getResponses :
//get the patches from sampler
std::vector<Mat> detectSamples = sampler->getSamples();
if( detectSamples.empty() )
return false;
//features extraction
featureSet->extraction( detectSamples );
//get responses
std::vector<Mat> response = featureSet->getResponses();
Abstract base class for TrackerFeature that represents the feature.
TrackerFeature class:
class CV_EXPORTS_W TrackerFeature
{
public:
virtual ~TrackerFeature();
static Ptr<TrackerFeature> create( const String& trackerFeatureType );
void compute( const std::vector<Mat>& images, Mat& response );
virtual void selection( Mat& response, int npoints ) = 0;
String getClassName() const;
};
Create TrackerFeature by tracker feature type
Parameters: |
|
---|
The modes available now:
The modes that will be available soon:
Compute the features in the images collection
Parameters: |
|
---|
In [AAM] table I and section III C are described the most known features type. At moment only TrackerFeatureHAAR is implemented.
TrackerFeature based on HAAR features, used by TrackerMIL and many others algorithms
TrackerFeatureHAAR class:
class CV_EXPORTS_W TrackerFeatureHAAR : TrackerFeature
{
public:
TrackerFeatureHAAR( const TrackerFeatureHAAR::Params ¶meters = TrackerFeatureHAAR::Params() );
~TrackerFeatureHAAR();
void selection( Mat& response, int npoints );
bool extractSelected( const std::vector<int> selFeatures, const std::vector<Mat>& images, Mat& response );
std::vector<std::pair<float, float> >& getMeanSigmaPairs();
bool swapFeature( int source, int target );
bool swapFeature( int id, CvHaarEvaluator::FeatureHaar& feature );
CvHaarEvaluator::FeatureHaar& getFeatureAt( int id );
};
Note
HAAR features implementation is copied from apps/traincascade and modified according to MIL implementation
List of TrackerFeatureHAAR parameters:
struct CV_EXPORTS Params
{
Params();
int numFeatures; // # of rects
Size rectSize; // rect size
bool isIntegral; // true if input images are integral, false otherwise
};
Constructor
Parameters: |
|
---|
Identify most effective features
Parameters: |
|
---|
Note
This method modifies the response parameter
Compute the features only for the selected indices in the images collection
Parameters: |
|
---|
Get the list of mean/sigma. Return the list of mean/sigma
Swap the feature in position source with the feature in position target
Parameters: |
|
---|
Swap the feature in position id with the feature input
Parameters: |
|
---|
Get the feature in position id
Parameters: |
|
---|
TODO To be implemented
TODO To be implemented
TODO To be implemented