|
1. Specify a number of possible clusters, let's say, 10.
2. Run K-Means with k=10 in all feature points collected from all images. You will obtain 10 centroids, or clusters. Let each of those clusters represent a label.
3. Now, for each image, classify all its feature points using K-Means. You will end up with a set of labels for each image. Use those labels to form a feature vector with 10 positions, each of them 1 or 0, in which 1 indicates the presence of a label in the image, and 0 indicates its absence. This will effectively map each image to a feature vector of fixed length (by the way, perhaps you could, instead of 0 and 1, use the number of occurrences for each feature).
4. Now, run SVM on those fixed length vectors.
Hi Mr.César
I’ve did what you told me on two classes (cat & flower)
but I’m getting the same result after training the machine with svm
I used 10 images for each category , and when I test it on one of the training examples it gave a right result (0 or 1 ) but with external image it gives false result (always 0)
I don't know what's wrong !! :(
Best regards ,
Safii
bow.Surf.ComputeDescriptors = SpeededUpRobustFeatureDescriptorType.Extended;