Commit fe4366bcfb8c4b464e6ec450dd70d1548abc9502

Authored by Jordan Cheney
1 parent 3f516c6d

Train, store, and load representations as necessary

openbr/plugins/classification/boostedforest.cpp
... ... @@ -106,6 +106,8 @@ class BoostedForestClassifier : public Classifier
106 106  
107 107 void train(const QList<Mat> &images, const QList<float> &labels)
108 108 {
  109 + representation->train(images, labels);
  110 +
109 111 CascadeBoostParams params(CvBoost::GENTLE, minTAR, maxFAR, trimRate, maxDepth, maxWeakCount);
110 112  
111 113 FeatureEvaluator featureEvaluator;
... ... @@ -180,6 +182,8 @@ class BoostedForestClassifier : public Classifier
180 182  
181 183 void load(QDataStream &stream)
182 184 {
  185 + representation->load(stream);
  186 +
183 187 stream >> threshold;
184 188 int numClassifiers; stream >> numClassifiers;
185 189 for (int i = 0; i < numClassifiers; i++) {
... ... @@ -191,6 +195,8 @@ class BoostedForestClassifier : public Classifier
191 195  
192 196 void store(QDataStream &stream) const
193 197 {
  198 + representation->store(stream);
  199 +
194 200 stream << threshold;
195 201 stream << classifiers.size();
196 202 foreach (const Node *classifier, classifiers)
... ...