参考:http://www.codeproject.com/Articles/619039/Bag-of-Features-Descriptor-on-SIFT-Features-with-O
SIFT - Scale Invariant Feature Transform
Bag-of_Features with SIFT
Let's see how can we build BoF with SIFT features.
- 1. Obtain the set of bags of features.
- Select a large set of images.
- Extract the SIFT feature points of all the images in the set and obtain the SIFT descriptor for each feature point that is extracted from each image.
- Cluster the set of feature descriptors for the amount of bags we defined and train the bags with clustered feature descriptors (we can use the K-Means algorithm).
- Obtain the visual vocabulary.
- 2. Obtain the BoF descriptor for given image/video frame.
- Extract SIFT feature points of the given image.
- Obtain SIFT descriptor for each feature point.
- Match the feature descriptors with the vocabulary we created in the first step
- Build the histogram.
The following image shows the above two steps clearly. (The image taken from http://www.sccs.swarthmore.edu/users/09/btomasi1/tagging-products.html)