mirror of
https://github.com/opencv/opencv.git
synced 2024-12-18 03:18:01 +08:00
minor change of BOW
This commit is contained in:
parent
2cd9fbb66a
commit
d7c86bbcdc
@ -2468,7 +2468,7 @@ public:
|
||||
void setVocabulary( const Mat& vocabulary );
|
||||
const Mat& getVocabulary() const { return vocabulary; }
|
||||
void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& imgDescriptor,
|
||||
vector<vector<int> >* pointIdxsOfClusters=0 ); //not constant because DescriptorMatcher::match is not constant
|
||||
vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 ); //not constant because DescriptorMatcher::match is not constant
|
||||
int descriptorSize() const { return vocabulary.empty() ? 0 : vocabulary.rows; }
|
||||
int descriptorType() const { return CV_32FC1; }
|
||||
|
||||
|
@ -112,7 +112,7 @@ void BOWImgDescriptorExtractor::setVocabulary( const Mat& _vocabulary )
|
||||
}
|
||||
|
||||
void BOWImgDescriptorExtractor::compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& imgDescriptor,
|
||||
vector<vector<int> >* pointIdxsOfClusters )
|
||||
vector<vector<int> >* pointIdxsOfClusters, Mat* _descriptors )
|
||||
{
|
||||
imgDescriptor.release();
|
||||
|
||||
@ -122,7 +122,7 @@ void BOWImgDescriptorExtractor::compute( const Mat& image, vector<KeyPoint>& key
|
||||
int clusterCount = descriptorSize(); // = vocabulary.rows
|
||||
|
||||
// Compute descriptors for the image.
|
||||
Mat descriptors;
|
||||
Mat descriptors = _descriptors ? *_descriptors : Mat();
|
||||
dextractor->compute( image, keypoints, descriptors );
|
||||
|
||||
// Match keypoint descriptors to cluster center (to vocabulary)
|
||||
|
Loading…
Reference in New Issue
Block a user