Commit 6c8bc6a2 authored by Christoph Spörk's avatar Christoph Spörk

fixed ABI incompatibilities as proposed by alalek

related to issue 4969
fixes issue 5891
fixes issue 5922
parent a7aa198b
...@@ -720,9 +720,14 @@ public: ...@@ -720,9 +720,14 @@ public:
find the best parameters for your problem, it can be done with SVM::trainAuto. */ find the best parameters for your problem, it can be done with SVM::trainAuto. */
CV_WRAP static Ptr<SVM> create(); CV_WRAP static Ptr<SVM> create();
CV_WRAP virtual void read( const FileNode& fn ) = 0; /** @brief Loads and creates a serialized svm from a file
*
CV_WRAP static Ptr<SVM> load(const String& fs); * Use SVM::save to serialize and store an SVM to disk.
* Load the SVM from this file again, by calling this function with the path to the file.
*
* @param fs Filename
*/
CV_WRAP static Ptr<SVM> load(const String& filepath);
}; };
/****************************************************************************************\ /****************************************************************************************\
......
...@@ -2261,14 +2261,14 @@ Ptr<SVM> SVM::create() ...@@ -2261,14 +2261,14 @@ Ptr<SVM> SVM::create()
return makePtr<SVMImpl>(); return makePtr<SVMImpl>();
} }
Ptr<SVM> SVM::load(const String& filename) Ptr<SVM> SVM::load(const String& filepath)
{ {
FileStorage fs; FileStorage fs;
fs.open(filename, FileStorage::READ); fs.open(filepath, FileStorage::READ);
Ptr<SVM> svm = makePtr<SVMImpl>(); Ptr<SVM> svm = makePtr<SVMImpl>();
svm->read(fs.getFirstTopLevelNode()); ((SVMImpl*)svm.get())->read(fs.getFirstTopLevelNode());
return svm; return svm;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment