int clusterCount = descriptorSize(); // = vocabulary.rows
// Compute descriptors for the image.
- Mat descriptors = _descriptors ? *_descriptors : Mat();
+ Mat descriptors;
dextractor->compute( image, keypoints, descriptors );
// Match keypoint descriptors to cluster center (to vocabulary)
// Normalize image descriptor.
imgDescriptor /= descriptors.rows;
+
+ // Add the descriptors of image keypoints
+ if (_descriptors) {
+ *_descriptors = descriptors.clone();
+ }
}
int BOWImgDescriptorExtractor::descriptorSize() const