1 | initial version |
you can retrieve the size of your train samples with getVarCount() like this:
Mat td(20,13,CV_32F);
Mat tl(20,1,CV_32S);
Ptr<ml::StatModel> mdl = ml::SVM::create();
mdl->train(td,0,tl);
cout << mdl->getVarCount() << endl;
// result: 13
and if you found a missing size check somewhere, it should go to : https://github.com/opencv/opencv/issues/new