Ask Your Question

r3xus's profile - activity

2017-05-28 14:32:30 -0600 received badge  Popular Question (source)
2013-11-18 07:56:03 -0600 received badge  Supporter (source)
2013-11-18 07:55:26 -0600 commented answer K-Nearest Neighbors, SURF and classifying images.

Thank you very much for your wonderful answer! I now have a grasp on how knn is working, I'm, just for the sake of it, trying to extract the number of straight lines in each image, the numbers of corners and the histogram mean and classify with that feature vector. If I get that implemented, I'm going to move on to what you suggest (BoW). Thanks again, dude!

2013-11-18 07:53:41 -0600 received badge  Scholar (source)
2013-11-17 12:52:38 -0600 asked a question K-Nearest Neighbors, SURF and classifying images.

Hello,

I've been tasked with the problem of creating a system capable of classifying two sets of images. These images are going to be either natural (landscapes) or man-made (buildings). Initially I'm supplied with a set of N images from one class and N from the other - the training set.

The way I imagine this system to work is to extract features with something like SURF and classify them using KNN. Thing is I don't quite get how to combine these two algorithms.

What I understand is that I can detect features with the detect function of the SurfFeatureDetector. I can also extract descriptors of these features with SurfDescriptorExtractor and compute. What I don't understand is how to send these features to KNN.

I presume that when one wants to use KNN in OpenCV the extracted feature descriptors are the trainData parameter of KNN, but what is the responses parameter, what do I pass there.

Also if my approach of using SURF is not optimal I would be very grateful if somebody suggests something different, just bare in mind I'm very new to the field of Computer Vision so anything terribly complex probably wouldn't suit me.

Thanks.