Commit d22df8c4 authored by chrizandr's avatar chrizandr

Add wrappers for load functions for DTrees and Boost classifiers

parent aa5caf83
...@@ -1115,6 +1115,17 @@ public: ...@@ -1115,6 +1115,17 @@ public:
file using Algorithm::load\<DTrees\>(filename). file using Algorithm::load\<DTrees\>(filename).
*/ */
CV_WRAP static Ptr<DTrees> create(); CV_WRAP static Ptr<DTrees> create();
/** @brief Loads and creates a serialized DTrees from a file
*
* Use DTree::save to serialize and store an DTree to disk.
* Load the DTree from this file again, by calling this function with the path to the file.
* Optionally specify the node for the file containing the classifier
*
* @param filepath path to serialized DTree
* @param nodeName name of node containing the classifier
*/
CV_WRAP static Ptr<DTrees> load(const String& filepath , const String& nodeName = String());
}; };
/****************************************************************************************\ /****************************************************************************************\
...@@ -1229,6 +1240,17 @@ public: ...@@ -1229,6 +1240,17 @@ public:
/** Creates the empty model. /** Creates the empty model.
Use StatModel::train to train the model, Algorithm::load\<Boost\>(filename) to load the pre-trained model. */ Use StatModel::train to train the model, Algorithm::load\<Boost\>(filename) to load the pre-trained model. */
CV_WRAP static Ptr<Boost> create(); CV_WRAP static Ptr<Boost> create();
/** @brief Loads and creates a serialized Boost from a file
*
* Use Boost::save to serialize and store an RTree to disk.
* Load the Boost from this file again, by calling this function with the path to the file.
* Optionally specify the node for the file containing the classifier
*
* @param filepath path to serialized Boost
* @param nodeName name of node containing the classifier
*/
CV_WRAP static Ptr<Boost> load(const String& filepath , const String& nodeName = String());
}; };
/****************************************************************************************\ /****************************************************************************************\
......
...@@ -507,6 +507,11 @@ Ptr<Boost> Boost::create() ...@@ -507,6 +507,11 @@ Ptr<Boost> Boost::create()
return makePtr<BoostImpl>(); return makePtr<BoostImpl>();
} }
Ptr<Boost> Boost::load(const String& filepath, const String& nodeName)
{
return Algorithm::load<Boost>(filepath, nodeName);
}
}} }}
/* End of file. */ /* End of file. */
...@@ -1941,6 +1941,12 @@ Ptr<DTrees> DTrees::create() ...@@ -1941,6 +1941,12 @@ Ptr<DTrees> DTrees::create()
return makePtr<DTreesImpl>(); return makePtr<DTreesImpl>();
} }
Ptr<DTrees> DTrees::load(const String& filepath, const String& nodeName)
{
return Algorithm::load<DTrees>(filepath, nodeName);
}
} }
} }
......
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