Class to compute an image descriptor using the bag of visual words. More...
#include <features2d.hpp>
Public Member Functions | |
| CV_WRAP | BOWImgDescriptorExtractor (const Ptr< Feature2D > &dextractor, const Ptr< DescriptorMatcher > &dmatcher) |
| The constructor. | |
| BOWImgDescriptorExtractor (const Ptr< DescriptorMatcher > &dmatcher) | |
| virtual | ~BOWImgDescriptorExtractor () |
| CV_WRAP void | setVocabulary (const Mat &vocabulary) |
| Sets a visual vocabulary. | |
| CV_WRAP const Mat & | getVocabulary () const |
| Returns the set vocabulary. | |
| void | compute (InputArray image, std::vector< KeyPoint > &keypoints, OutputArray imgDescriptor, std::vector< std::vector< int > > *pointIdxsOfClusters=0, Mat *descriptors=0) |
| Computes an image descriptor using the set visual vocabulary. | |
| void | compute (InputArray keypointDescriptors, OutputArray imgDescriptor, std::vector< std::vector< int > > *pointIdxsOfClusters=0) |
| CV_WRAP_AS (compute) void compute2(const Mat &image | |
| CV_WRAP int | descriptorSize () const |
| Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0. | |
| CV_WRAP int | descriptorType () const |
| Returns an image descriptor type. | |
Public Attributes | |
| std::vector< KeyPoint > & | keypoints |
| std::vector< KeyPoint > CV_OUT Mat & | imgDescriptor { compute(image,keypoints,imgDescriptor) |
Protected Attributes | |
| Mat | vocabulary |
| Ptr< DescriptorExtractor > | dextractor |
| Ptr< DescriptorMatcher > | dmatcher |
Class to compute an image descriptor using the bag of visual words.
Such a computation consists of the following steps:
| CV_WRAP cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor | ( | const Ptr< Feature2D > & | dextractor, |
| const Ptr< DescriptorMatcher > & | dmatcher | ||
| ) |
The constructor.
| dextractor | Descriptor extractor that is used to compute descriptors for an input image and its keypoints. |
| dmatcher | Descriptor matcher that is used to find the nearest word of the trained vocabulary for each keypoint descriptor of the image. |
| cv::BOWImgDescriptorExtractor::BOWImgDescriptorExtractor | ( | const Ptr< DescriptorMatcher > & | dmatcher | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
| void cv::BOWImgDescriptorExtractor::compute | ( | InputArray | image, |
| std::vector< KeyPoint > & | keypoints, | ||
| OutputArray | imgDescriptor, | ||
| std::vector< std::vector< int > > * | pointIdxsOfClusters = 0, |
||
| Mat * | descriptors = 0 |
||
| ) |
Computes an image descriptor using the set visual vocabulary.
| image | Image, for which the descriptor is computed. |
| keypoints | Keypoints detected in the input image. |
| imgDescriptor | Computed output image descriptor. |
| pointIdxsOfClusters | Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) returned if it is non-zero. |
| descriptors | Descriptors of the image keypoints that are returned if they are non-zero. |
| void cv::BOWImgDescriptorExtractor::compute | ( | InputArray | keypointDescriptors, |
| OutputArray | imgDescriptor, | ||
| std::vector< std::vector< int > > * | pointIdxsOfClusters = 0 |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| keypointDescriptors | Computed descriptors to match with vocabulary. |
| imgDescriptor | Computed output image descriptor. |
| pointIdxsOfClusters | Indices of keypoints that belong to the cluster. This means that pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) returned if it is non-zero. |
| cv::BOWImgDescriptorExtractor::CV_WRAP_AS | ( | compute | ) | const & |
| CV_WRAP int cv::BOWImgDescriptorExtractor::descriptorSize | ( | ) | const |
Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
| CV_WRAP int cv::BOWImgDescriptorExtractor::descriptorType | ( | ) | const |
Returns an image descriptor type.
Returns the set vocabulary.
Sets a visual vocabulary.
| vocabulary | Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the vocabulary is a visual word (cluster center). |
|
protected |
|
protected |
| std::vector<KeyPoint> CV_OUT Mat& cv::BOWImgDescriptorExtractor::imgDescriptor { compute(image,keypoints,imgDescriptor) |
| std::vector<KeyPoint>& cv::BOWImgDescriptorExtractor::keypoints |
|
protected |