MATLAB File Help: cv.BOWImgDescriptorExtractor Index
cv.BOWImgDescriptorExtractor

Class to compute an image descriptor using the bag of visual words

Such a computation consists of the following steps:

  1. Compute descriptors for a given image and its keypoints set.
  2. Find the nearest visual words from the vocabulary for each keypoint descriptor.
  3. 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.

Example

% create bag of visual words
trainer = cv.BOWKMeansTrainer(K);
dictionary = trainer.cluster(train_descs);

% Compute histogram of visual word occurrences of an image
extractor = cv.BOWImgDescriptorExtractor('SIFT','BruteForce');
extractor.setVocabulary(dictionary);
descs = extractor.compute(im, keypoints);
See also
Class Details
Superclasses handle
Sealed false
Construct on load false
Constructor Summary
BOWImgDescriptorExtractor The constructor 
Property Summary
Vocabulary Visual vocabulary 
id Object ID 
Method Summary
  addlistener Add listener for event. 
  compute Computes an image descriptor using the set visual vocabulary 
  compute1 Computes an image descriptor using keypoint descriptors 
  compute2 Computes an image descriptor using the set visual vocabulary 
  delete Destructor 
  descriptorSize Returns image discriptor size 
  descriptorType Returns image descriptor type 
  eq == (EQ) Test handle equality. 
  findobj Find objects matching specified conditions. 
  findprop Find property of MATLAB handle object. 
  ge >= (GE) Greater than or equal relation for handles. 
  gt > (GT) Greater than relation for handles. 
Sealed   isvalid Test handle validity. 
  le <= (LE) Less than or equal relation for handles. 
  lt < (LT) Less than relation for handles. 
  ne ~= (NE) Not equal relation for handles. 
  notify Notify listeners of event.