Written by Mohamed Eldawy (eldawy@cs.wisc.edu) on 12-30-2006. Please email me with any questions. What does this do? ------------------ This matlab program does the following 1. Read the feature vectors output by step 2 2. Apply a clustering alogithm (Mean Shift) on the feature vectors 3. Select the largest cluster 4. Find the centroid of the largest cluster 5. Select the point closest to this centroid 6. Return the ID of the image from which this segment came as the most representative image. What is its role? ----------------- This is step #3 for finding the best image for a keyword. Here we simply output the number of the image we think is the best. How to use it? -------------- First, you need to install Piotr's Matlab toolbox (http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html) unzip it to a local directory Replace line 1 in the given file (step3.txt) with the place where you have installed the toobox Next, put the file "histogram.txt" output by step 2 into the current directory run matlab to execute the script matlab < step3.txt It outputs the index of the image it thinks is the best. Notes ----- You can change the radius of the gaussian filter used by mean shift in line 3 of the script. There is a variable called "RadiusOfGaussian" The first two lines in the script are used to setup the matlab toolbox. We can't save Matlab paths on CSL machines, so the first two lines need to be written every time before using the toolbox. Credits ------- We use Piotr's Matlab toolbox. This can be found here http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html