Commit e3ec3566 authored by chrizandr's avatar chrizandr

RTrees: Add wrapper for RTrees_load method to enable loading trained RTrees

parent 45f0cf0d
...@@ -1169,6 +1169,17 @@ public: ...@@ -1169,6 +1169,17 @@ public:
Algorithm::load to load the pre-trained model. Algorithm::load to load the pre-trained model.
*/ */
CV_WRAP static Ptr<RTrees> create(); CV_WRAP static Ptr<RTrees> create();
/** @brief Loads and creates a serialized RTree from a file
*
* Use RTree::save to serialize and store an RTree to disk.
* Load the RTree 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 RTree
* @param nodeName name of node containing the classifier
*/
CV_WRAP static Ptr<RTrees> load(const String& filepath , const String& nodeName = String());
}; };
/****************************************************************************************\ /****************************************************************************************\
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
//M*/ //M*/
#include "precomp.hpp" #include "precomp.hpp"
namespace cv { namespace cv {
namespace ml { namespace ml {
...@@ -422,6 +421,12 @@ Ptr<RTrees> RTrees::create() ...@@ -422,6 +421,12 @@ Ptr<RTrees> RTrees::create()
return makePtr<RTreesImpl>(); return makePtr<RTreesImpl>();
} }
//Function needed for Python and Java wrappers
Ptr<RTrees> RTrees::load(const String& filepath, const String& nodeName)
{
return Algorithm::load<RTrees>(filepath, nodeName);
}
}} }}
// End of file. // End of file.
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