Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Maybe the SVM says that the face is more similar to class X then to class Y, and that is why you are getting +1. Because you have 2 classes, you can just try to use the decision function result, and just take in consideration the distances. You can just say that a face is in class X if the distance is greater than 1 (or less than -1, depending on the training, where the distance is positive and where is negative).

For having the distance as result just do mySVM.predic(image.reshape(1, 1), true);