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:
find the best parameters for your problem, it can be done with SVM::trainAuto. */
CV_WRAP static Ptr<SVM> create();
CV_WRAP virtual void read( const FileNode& fn ) = 0;
CV_WRAP static Ptr<SVM> load(const String& fs);
/** @brief Loads and creates a serialized svm from a file
*
* 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()
return makePtr<SVMImpl>();
}
Ptr<SVM> SVM::load(const String& filename)
Ptr<SVM> SVM::load(const String& filepath)
{
FileStorage fs;
fs.open(filename, FileStorage::READ);
fs.open(filepath, FileStorage::READ);
Ptr<SVM> svm = makePtr<SVMImpl>();
svm->read(fs.getFirstTopLevelNode());
((SVMImpl*)svm.get())->read(fs.getFirstTopLevelNode());
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