Object Recognition using bag of features using matlab I want to write a MATLAB program for simple object recognition using bag of features. In short, I want to first extract the features from an image, create a visual library using those features, then cluster up the features belonging to one part together, hence creating different parts. now use these parts for matching. i have the basic idea but i don't know much math behind this, also i don't know how i can go about implementing it. can anyone help me with the matlab code for this?
The, for now free available computer vision book, by Richard Szeliski contains an excellent introduction to this algorithm. Page 612. 

EDIT:

I answered a similar question here on DSP with some example code.