aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Spörk2016-01-07 01:00:01 -0600
committerChristoph Spörk2016-01-07 01:00:01 -0600
commit6c8bc6a25b1fb433a198520455a5a5c27a03cc5f (patch)
tree5dc282eaf50323033227d919c00015c931cb74cc
parenta7aa198b4caa07895b41593fdd9adf480a40c5c8 (diff)
downloadtiopencv-6c8bc6a25b1fb433a198520455a5a5c27a03cc5f.tar.gz
tiopencv-6c8bc6a25b1fb433a198520455a5a5c27a03cc5f.tar.xz
tiopencv-6c8bc6a25b1fb433a198520455a5a5c27a03cc5f.zip
fixed ABI incompatibilities as proposed by alalek
related to issue 4969 fixes issue 5891 fixes issue 5922
-rw-r--r--modules/ml/include/opencv2/ml.hpp11
-rw-r--r--modules/ml/src/svm.cpp6
2 files changed, 11 insertions, 6 deletions
diff --git a/modules/ml/include/opencv2/ml.hpp b/modules/ml/include/opencv2/ml.hpp
index 013d9187f..cfd95a524 100644
--- a/modules/ml/include/opencv2/ml.hpp
+++ b/modules/ml/include/opencv2/ml.hpp
@@ -720,9 +720,14 @@ public:
720 find the best parameters for your problem, it can be done with SVM::trainAuto. */ 720 find the best parameters for your problem, it can be done with SVM::trainAuto. */
721 CV_WRAP static Ptr<SVM> create(); 721 CV_WRAP static Ptr<SVM> create();
722 722
723 CV_WRAP virtual void read( const FileNode& fn ) = 0; 723 /** @brief Loads and creates a serialized svm from a file
724 724 *
725 CV_WRAP static Ptr<SVM> load(const String& fs); 725 * Use SVM::save to serialize and store an SVM to disk.
726 * Load the SVM from this file again, by calling this function with the path to the file.
727 *
728 * @param fs Filename
729 */
730 CV_WRAP static Ptr<SVM> load(const String& filepath);
726}; 731};
727 732
728/****************************************************************************************\ 733/****************************************************************************************\
diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp
index 639f6e216..34acebb99 100644
--- a/modules/ml/src/svm.cpp
+++ b/modules/ml/src/svm.cpp
@@ -2261,14 +2261,14 @@ Ptr<SVM> SVM::create()
2261 return makePtr<SVMImpl>(); 2261 return makePtr<SVMImpl>();
2262} 2262}
2263 2263
2264Ptr<SVM> SVM::load(const String& filename) 2264Ptr<SVM> SVM::load(const String& filepath)
2265{ 2265{
2266 FileStorage fs; 2266 FileStorage fs;
2267 fs.open(filename, FileStorage::READ); 2267 fs.open(filepath, FileStorage::READ);
2268 2268
2269 Ptr<SVM> svm = makePtr<SVMImpl>(); 2269 Ptr<SVM> svm = makePtr<SVMImpl>();
2270 2270
2271 svm->read(fs.getFirstTopLevelNode()); 2271 ((SVMImpl*)svm.get())->read(fs.getFirstTopLevelNode());
2272 return svm; 2272 return svm;
2273} 2273}
2274 2274