Class: invertedImageIndex

Add new images to image index




addImages(imageIndex,imds) adds the images in imds into the imageIndex object.

addImages(imageIndex,imds,'Verbose',true) also displays progress information. 'Verbose' to false to turn display off.

This object supports parallel computing using multiple MATLAB® workers. Enable parallel computing from the Computer Vision Toolbox Preferences dialog box. To open Computer Vision Toolbox™ preferences, on the Home tab, in the Environment section, click Preferences. Then select Computer Vision Toolbox .

Input Arguments

expand all

Image search index, specified as an invertedImageIndex object.

Images, specified as an ImageDatastore object. imds contains new images to add to an existing index. Duplicate images are not ignored.


expand all

Define a set of images to search

imageFiles = ...
  {'elephant.jpg', 'cameraman.tif', ...
   'peppers.png',  'saturn.png',...
   'pears.png',    'stapleRemover.jpg', ...
   'football.jpg', 'mandi.tif',...
   'kids.tif',     'liftingbody.png', ...
   'office_5.jpg', 'gantrycrane.png',...
   'moon.tif',     'circuit.tif', ...
   'tape.png',     'coins.png'};

imds = imageDatastore(imageFiles);

Learn the visual vocabulary.

bag = bagOfFeatures(imds,'PointSelection','Detector',...

Create an image search index.

imageIndex = invertedImageIndex(bag);

Add images.

Encoding images using Bag-Of-Features.

* Encoding 16 images...done.