added clear method to GenericDescriptorMatch

pull/13383/head
Maria Dimashova 15 years ago
parent 9690cd396b
commit b4275e1987
  1. 5
      modules/features2d/include/opencv2/features2d/features2d.hpp
  2. 11
      modules/features2d/src/descriptors.cpp

@ -1559,6 +1559,9 @@ public:
// Returns the keypoint by its global index
KeyPoint getKeyPoint( int index ) const;
// Clears images, keypoints and startIndices
void clear();
vector<Mat> images;
vector<vector<KeyPoint> > points;
@ -1599,6 +1602,8 @@ public:
// class_ids A vector to be filled with keypoint class_ids
virtual void match( const Mat& image, vector<KeyPoint>& points, vector<int>& indices ) = 0;
// Clears keypoints storing in collection
virtual void clear();
protected:
KeyPointCollection collection;
};

@ -150,6 +150,13 @@ size_t KeyPointCollection::calcKeypointCount() const
return *startIndices.rbegin() + points.rbegin()->size();
}
void KeyPointCollection::clear()
{
images.clear();
points.clear();
startIndices.clear();
}
/*
* GenericDescriptorMatch
*/
@ -169,6 +176,10 @@ void GenericDescriptorMatch::classify( const Mat& image, vector<cv::KeyPoint>& p
points[i].class_id = collection.getKeyPoint(keypointIndices[i]).class_id;
};
void GenericDescriptorMatch::clear()
{
collection.clear();
}
/****************************************************************************************\
* OneWayDescriptorMatch *
\****************************************************************************************/

Loading…
Cancel
Save