Commit b35f5d11 authored by TobyWanKenobi's avatar TobyWanKenobi

Removed "FORMAT_XML" to generalize format

Removed the "FileStorage::FORMAT_XML" to generalize format of the String
model.
parent f54b80d2
...@@ -827,15 +827,15 @@ public: ...@@ -827,15 +827,15 @@ public:
return model->isTrained() ? model : Ptr<_Tp>(); return model->isTrained() ? model : Ptr<_Tp>();
} }
/** @brief Loads model from an XML String /** @brief Loads model from a String
@param strModel The string variable containing the model (in an XML format) you want to load. @param strModel The string variable containing the model you want to load.
This is static template method of StatModel. It's usage is following (in the case of SVM): This is static template method of StatModel. It's usage is following (in the case of SVM):
Ptr<SVM> svm = StatModel::loadFromString<SVM>(myXMLStringModel); Ptr<SVM> svm = StatModel::loadFromString<SVM>(myStringModel);
*/ */
template<typename _Tp> static Ptr<_Tp> loadFromString(const String& strModel) template<typename _Tp> static Ptr<_Tp> loadFromString(const String& strModel)
{ {
FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY + FileStorage::FORMAT_XML); FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);
Ptr<_Tp> model = _Tp::create(); Ptr<_Tp> model = _Tp::create();
model->read(fs.getFirstTopLevelNode()); model->read(fs.getFirstTopLevelNode());
return model->isTrained() ? model : Ptr<_Tp>(); return model->isTrained() ? model : Ptr<_Tp>();
......
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