1 | initial version |
no, it's not your fault, it simply does not exist.
(there's a push_back but no pop_back in java, currently, but if at all, it would be probably: void trainingImages.pop_back(int num_rows);
)
then, please do not push 2d images, but "flattened", 1d versions of it, like:
trainingImages.push_back(img.resize(1,1));
(push_back() actually pushes rows, not images. if you don't flatten them, the context, that they belong to a certain image, will be lost, and you end up adding nrows independant samples)
also don't forget to convert your images to float for both SVM training and testing. (just saying)