Ask Your Question

Revision history [back]

click to hide/show revision 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.