From 6c8bc6a25b1fb433a198520455a5a5c27a03cc5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Sp=C3=B6rk?= Date: Thu, 7 Jan 2016 08:00:01 +0100 Subject: [PATCH] fixed ABI incompatibilities as proposed by alalek related to issue 4969 fixes issue 5891 fixes issue 5922 --- modules/ml/include/opencv2/ml.hpp | 11 ++++++++--- modules/ml/src/svm.cpp | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/ml/include/opencv2/ml.hpp b/modules/ml/include/opencv2/ml.hpp index 013d9187fe..cfd95a5240 100644 --- a/modules/ml/include/opencv2/ml.hpp +++ b/modules/ml/include/opencv2/ml.hpp @@ -720,9 +720,14 @@ public: find the best parameters for your problem, it can be done with SVM::trainAuto. */ CV_WRAP static Ptr create(); - CV_WRAP virtual void read( const FileNode& fn ) = 0; - - CV_WRAP static Ptr 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 load(const String& filepath); }; /****************************************************************************************\ diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index 639f6e2168..34acebb991 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -2261,14 +2261,14 @@ Ptr SVM::create() return makePtr(); } -Ptr SVM::load(const String& filename) +Ptr SVM::load(const String& filepath) { FileStorage fs; - fs.open(filename, FileStorage::READ); + fs.open(filepath, FileStorage::READ); Ptr svm = makePtr(); - svm->read(fs.getFirstTopLevelNode()); + ((SVMImpl*)svm.get())->read(fs.getFirstTopLevelNode()); return svm; }