Calculate bag of words feature vector In visual bag of words model, I have been able to construct the visual codebook through kmeans clustering of SIFT descriptors. How to calculate the feature vector for an image then?

P/S:

For each image, we can find interesting SIFT points, and for each points we have a SIFT descriptor (which is usually a 128 length vector).

im1 ==> SIFT feature f1 (10 by 128) (here 10 is an abitrary number)
im2 ==> SIFT feature f2 (20 by 128)
...

If we combine all SIFT features, f=[f1; f2; ..] and perform kmeans clustering we will get the codebook c=[c1; c2; .. c10] which is bow codebooks.

From the codebook how can we find the feature vectore, represent image im1?
The feature vector is just the histogram of how many times a feature from each cluster appeared in the image.