本文整理汇总了C++中Forest::makeTrees方法的典型用法代码示例。如果您正苦于以下问题:C++ Forest::makeTrees方法的具体用法?C++ Forest::makeTrees怎么用?C++ Forest::makeTrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forest
的用法示例。
在下文中一共展示了Forest::makeTrees方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trainTree
void trainTree(string treeFile, string trainDir) {
SerializeHelper sHelp = SerializeHelper();
ImageReader imReader = ImageReader();
vector<Mat> depthImages = imReader.readDepthImages(trainDir);
vector<Mat> classifiedImages = imReader.readClassifiedImages(trainDir);
int times = clock();
// 7 classes, 15 deep, 200 features, 50 thresholds, 0.02 subsampling, 1 minnuminnode, 10 background penalty, feature range, threshold range
Forest forest = Forest(6, 15, 500, 100, 0.05, 10, 0, pair<double, double>(150, 150), pair<double, double>(-255,255));
// 500 image per tree. Three made at once.
forest.makeTrees(depthImages, classifiedImages, 150, 3);
int timed = clock();
cout << "Making trees took "<< (timed-times) <<" ticks.\n"<< endl;
//Forest forest = sHelp.loadForest("MediumTree100F1000.txt");
sHelp.serializeForest(forest, treeFile);
string graphvix = forest.getTrees().at(0)->graphvizPrint(-1, NULL);
}