Bag of Visual Words: the number of words is equal to the number of k-means centroids? I was reading these slides about Bag of Features (BoF), in particular at slide 23:

A visual vocabulary of 1M words is generated using an approximate
  K-means clustering method based on randomized trees.

By "words" they means the centroids obtained by k-means? Otherwise what they mean?  
 A: The "centroid" really refers to the coordinates.
The concept of "word" means it's simply a symbol, not something meaningful like coordinates.
Every SIFT vector is mapped to a word (e.g. "42"); the image is represented as a bag of such words ("42 13 17 42 17"), not as a string of centroid coordinates.
The "dictionary" translates coordinates to words.
Yes, there may be a million words (although most appear to only use a few thousand?). But most will be 0, and you don't need to store these zero values. Just as with text.
A: Once you created the vocabulary, you have a list of all possible words in the training set(dictionary). Let's do an easy example. The training set contains an 'eye', a 'mouth' and a 'nose'. When a new test image comes, then you are going to extract features and you are going to try to detect these three features. Then, what you do is you create a histogram, having as index these three. 1.eye 2. mouth. 3.nose. For every feature that is similar to an eye, you are going to add a +1. Say that now you test with an image where there are 100 eyes. Then your histogram for that image is going to be [100 0 0] (no mouth and no nose.) Therefore, in this case, this image is represented with 3 components.
100   |       0   |           0 
e  | m | n
I hope it is clearer now. An image, will kind of have a 'signature' which will be a kind of summary of your features. In this case, the histogram would define perfectly the image as 
100 eyes! And it is precisely what the image would be, right?
Let me know if something is not clear!
