Class to compute an image descriptor using the bag of visual words.
Such a computation consists of the following steps:
Compute descriptors for a given image and its keypoints set.
Find the nearest visual words from the vocabulary for each keypoint descriptor.
Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the vocabulary in the given image.
Computes an image descriptor using the set visual vocabulary.
Parameters
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.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Parameters
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.