summaryrefslogtreecommitdiff
path: root/macros/invertedIndexImages.sci
blob: a92b7287c6133186f5109a50ebb4778c8cedc7c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function [invertedImageIndexStruct]=invertedIndexImages(imgSet,bagOfFeatures)
// This function creates image search index
//
// Calling Sequence
//  imageIndex = invertedIndexImages(imgSet, bagOfFeatures );
//
// Parameters
//  imgSet: Collection of images with their location and labels
//  bagOfFeatures: Bag of Visual Words
//  SaveFeatureLocations [Optional Input Argument]: A boolean value inicating whether feature locations has to be saved or not. Values: [True(default)|False]
//  imageIndex: Search Index Object containing the mapping of visual vocabulary to each image in the image set
//
// Description
//  Creates a search Index Object that has been mapped to visual words that can be used for retrieve Images
//
// Examples
//    imgSet = imageSet(directory,'recursive');
//    [trainingSet testSet] = partition(imgSet,[0.8]);
//    bag = bagOfFeatures(trainingSet);
//    imageindex = invertedIndexImages(trainingSet, bag);
//
// With Optional Arguments:
//    imageindex = invertedIndexImages(trainingSet, bag, "SaveFeatureLocations", 1);
//
// Authors
//  Umang Agrawal
//  Rohit Suri
//  Sridhar Reddy

    invertedImageIndexList=indexImages(imgSet,bagOfFeatures);
    invertedImageIndexStruct=struct('Type','invertedImageIndex','ImageLocation',invertedImageIndexList(5), 'ImageWords',invertedImageIndexList(2), 'WordFrequency',invertedImageIndexList(3),'BagOfFeatures',bagOfFeatures,)
endfunction