Try to solve issue 10166

This commit is contained in:
LaurentBerger
2017-11-27 13:13:05 +01:00
parent f8ad289311
commit 606a5fd537
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -3134,6 +3134,7 @@ public:
template<typename _Tp> static Ptr<_Tp> load(const String& filename, const String& objname=String())
{
FileStorage fs(filename, FileStorage::READ);
CV_Assert(fs.isOpened());
FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
if (fn.empty()) return Ptr<_Tp>();
Ptr<_Tp> obj = _Tp::create();
+1 -1
View File
@@ -1329,7 +1329,7 @@ Ptr<ANN_MLP> ANN_MLP::load(const String& filepath)
{
FileStorage fs;
fs.open(filepath, FileStorage::READ);
CV_Assert(fs.isOpened());
Ptr<ANN_MLP> ann = makePtr<ANN_MLPImpl>();
((ANN_MLPImpl*)ann.get())->read(fs.getFirstTopLevelNode());