summaryrefslogtreecommitdiff
path: root/macros/invertedIndexImages.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/invertedIndexImages.sci')
-rw-r--r--macros/invertedIndexImages.sci32
1 files changed, 32 insertions, 0 deletions
diff --git a/macros/invertedIndexImages.sci b/macros/invertedIndexImages.sci
new file mode 100644
index 0000000..a92b728
--- /dev/null
+++ b/macros/invertedIndexImages.sci
@@ -0,0 +1,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