提交 606a5fd5 编写于 作者: L LaurentBerger

Try to solve issue 10166

上级 f8ad2893
......@@ -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();
......
......@@ -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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册