1

Back in openCV2.x, cvBoost model can be saved/loaded as described in this stackoverflow post

In openCV3.0, I manage to train an adaboost model (cv::ml::boost Model1) and save it into a yml file with

    Model1.save("model.yml");

But it seems that the following load function is not implemented:

    Model1.load("model.yml");
Community
  • 1
  • 1
Eminemya
  • 379
  • 1
  • 6
  • 15

1 Answers1

4

From the 3.0 doc we can see that StatModel::load is a static template method:

C++: Ptr<_Tp> StatModel::load(const String& filename)

Also see here:

StatModel::load<Boost>(filename) to load the pre-trained model

So you can load the model like

Ptr<Boost> mdl = StatModel::load<Boost>("model.yml");
yangjie
  • 6,619
  • 1
  • 33
  • 40