1 | initial version |
IMHO you should
After the train you will get a file that is the SVM classifier. Load it in your application and use it to classify your detections returned by your cascade (be careful, the samples shall be the same size as for training, so resize them first).
As a remark, using descriptors for training (dense features + extract descriptors, otherwise you will not get the same number of descriptors for each image) the SVM will be more accurate than using pixels values.
You can use the HOGDescriptors, too.
2 | No.2 Revision |
IMHO you should
After the train you will get a file that is the SVM classifier. Load it in your application and use it to classify your detections returned by your cascade (be careful, the samples shall be the same size as for training, so resize them first).
As a remark, using descriptors for training (dense features + extract descriptors, otherwise you will not get the same number of descriptors for each image) the SVM will be more accurate than using pixels values.
You can use the HOGDescriptors, too.
Another remark that I shall add is that you need to have a one row Mat per sample, so reshape all the samples (descriptors, or pixels values) to one row. More, you shall do the same way as for training, that is if you used pixels values, then for classifying you shall give the vector (one row Map) containing the pixels values, if you used descriptors, then extract the descriptors the same way as for training and give that as sample for prediction. In any case you shall use a one row Map, so you shall reshape it so it will have the same sample size as for training (or what SVM expects)
3 | No.3 Revision |
IMHO you should
After the train you will get a file that is the SVM classifier. Load it in your application and use it to classify your detections returned by your cascade (be careful, the samples shall be the same size as for training, so resize them first).
As a remark, using descriptors for training (dense features + extract descriptors, otherwise you will not get the same number of descriptors for each image) the SVM will be more accurate than using pixels values.
You can use the HOGDescriptors, too.
Another remark that I shall add is that you need to have a one row Mat per sample, so reshape all the samples (descriptors, or pixels values) to one row. More, for testing (predicting) you shall do the same way as for training, that is if you used pixels values, then for classifying you shall give the vector (one row Map) containing the pixels values, if you used descriptors, then extract the descriptors the same way as for training and give that as sample for prediction. In any case you shall use a one row Map, so you shall reshape it so it will have the same sample size as for training (or what SVM expects)