mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
Merge pull request #10170 from LaurentBerger:Issue10166
This commit is contained in:
commit
614e254331
@ -3139,6 +3139,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();
|
||||
|
@ -1399,7 +1399,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());
|
||||
|
Loading…
Reference in New Issue
Block a user