matlabimage-processingoctavesvmvlfeat

Vlfeat Matlab SVM


I'm trying to build an application for image processing, the purpose is to get thermal image and to decide if the image contains a human object or no.

My thoughts were to try Matlab (actually Octave), for that mission i'm trying to use Vlfeat package and i'm really confuse on how should i use this library.

I'm trying to use the SVM trainer after extracting HOG features but couldn't figure out how to test the data.

After I have trained the SVM, how to test a new image?

*If there are better solutions I'm open for suggestions.


Solution

  • From the first paragraph of the link you provided

    (...) Y W'*X(:,i)+B has the same sign of LABELS(i) for all i.

    Then Y W'*X(:,i)+B is the value assigned to some feature vector X(:,i), so for any given feature vector x you want to test, just evaluate W.' * x+B.

    EDIT: A feature vector x for some test data is generated the same as for the training data using your feature extractio method. To classify this vector you evaluate the linear function given by the svm to get the classification "value" c=W.' * x+B Then you just need to consider the sign of c as the classification to one or the other class.