to simplify the image a bit so we are more likely to get key features rather than high frequency unimportant feature hits.
cumulatively appended each feature set to a matrix ‘features’
to build (group the features to creat a visual vocabulary) the vocabulary(a set of common features, or vocabulary of visual words), binning them according to the vocabulary size desired (e.g. 200words).
Using this visual vocabulary, we then define a histogram for each scene type (normalize your bag of words histograms, so that image size does not influence histogram counts, e.g.,
histc) and use these histograms coupled with an SVM to classify input scenes into one of several types (suburb, kitchen, industrial, etc.).
pdist2 to Create a distance matrix from the kmean results and a vocabulary words. The minimum corresponding distance value between a point in the kmeans result and a vocabulary point in the distance matrix is the yields the vocab word the feature point is closest to.