MCPcopy Create free account
hub / github.com/biometrics/openbr / storeRecursive

Function storeRecursive

openbr/plugins/classification/boostedforest.cpp:65–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65static void storeRecursive(QDataStream &stream, const Node *node, int maxCatCount)
66{
67 bool hasChildren = node->left ? true : false;
68 stream << hasChildren;
69
70 if (!hasChildren)
71 stream << node->value;
72 else {
73 if (maxCatCount > 0)
74 for (int i = 0; i < (maxCatCount + 31)/32; i++)
75 stream << node->subset[i];
76 else
77 stream << node->threshold;
78
79 stream << node->featureIdx;
80
81 storeRecursive(stream, node->left, maxCatCount);
82 storeRecursive(stream, node->right, maxCatCount);
83 }
84}
85
86/*!
87 * \brief A classification wrapper on OpenCV's CvBoost class. It uses CvBoost for training a boosted forest and then performs classification using the trained nodes.

Callers 1

boostedforest.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected