I am using C++ and OpenCV 3.3.1
I try to train a SVM with OpenCV my steps are:
- Preprocess the Image
- Feature Extraction with SURF
- creating the DataSet for learning positiv and negative Images
- reshape the Images 1 row 1 feature
- creating the labelsmat with -1 for negativ and +1 for positiv
- learning the SVM
- predict
And now my problem: Lets say my Images are 128 x 128 and after feature extraction i got a Mat with 16 rows and 128 columns after reshape I got 1 row and 2048 columns, now is the SVM trained with this size of rows and columns. And when I try to predict with my SVM I got the problem that the SVM wants the same size of feature Mat ( 1 row and 2048 colum) but my image for prediciton got more features as the learning images so the Mat for prediction is a way bigger as needed.
The prediction with the same Image as I used for learning works well so i guess the SVM works.
How can I use the SVM for bigger Images?