1 | initial version |
SVM::load() is a static function, which returns a new instance.
you have to use it like:
Ptr<SVM> svm = Algorithm::load<SVM>("trained-svm.xml");
in your case, the new instance was simply discarded, and you're querying an uninitialized svm instance for var_count, etc.