cvRound(modelWinSize.width * octave), cvRound(modelWinSize.height * octave));
}
+ string resPath(ivector::const_iterator it) const
+ {
+ char s[65];
+ sprintf(s, "%d", *it);
+ return std::string(cascadeName) + s + ".xml";
+ }
+
// Paths to a rescaled data
string trainPath;
string testPath;
virtual ~Octave();
virtual bool train(const Dataset& dataset, const FeaturePool& pool, int weaks, int treeDepth);
+ virtual void write( CvFileStorage* fs, string name) const;
int logScale;
}
+void sft::Octave::write( CvFileStorage* fs, string name) const
+{
+ CvBoost::write(fs, name.c_str());
+}
+
// ========= FeaturePool ========= //
sft::FeaturePool::FeaturePool(cv::Size m, int n) : model(m), nfeatures(n)
{
#include <sft/octave.hpp>
#include <sft/config.hpp>
+#include <opencv2/core/core_c.h>
+
int main(int argc, char** argv)
{
using namespace sft;
if (boost.train(dataset, pool, cfg.weaks, cfg.treeDepth))
{
std::cout << "Octave " << *it << " was successfully trained..." << std::endl;
- // strong.push_back(octave);
+ CvFileStorage* fout = cvOpenFileStorage(cfg.resPath(it).c_str(), 0, CV_STORAGE_WRITE);
+ boost.write(fout, cfg.cascadeName);
+ // strong.push_back(octave);
+ cvReleaseFileStorage( &fout);
}
}