本文整理汇总了C++中CvDTree::write方法的典型用法代码示例。如果您正苦于以下问题:C++ CvDTree::write方法的具体用法?C++ CvDTree::write怎么用?C++ CvDTree::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvDTree
的用法示例。
在下文中一共展示了CvDTree::write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
void CvGBTrees::write( CvFileStorage* fs, const char* name ) const
{
CV_FUNCNAME( "CvGBTrees::write" );
__BEGIN__;
CvSeqReader reader;
int i;
std::string s;
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_GBT );
if( !weak )
CV_ERROR( CV_StsBadArg, "The model has not been trained yet" );
write_params( fs );
cvWriteReal( fs, "base_value", base_value);
cvWriteInt( fs, "class_count", class_count);
for ( int j=0; j < class_count; ++j )
{
s = "trees_";
s += ToString(j);
cvStartWriteStruct( fs, s.c_str(), CV_NODE_SEQ );
cvStartReadSeq( weak[j], &reader );
for( i = 0; i < weak[j]->total; i++ )
{
CvDTree* tree;
CV_READ_SEQ_ELEM( tree, reader );
cvStartWriteStruct( fs, 0, CV_NODE_MAP );
tree->write( fs );
cvEndWriteStruct( fs );
}
cvEndWriteStruct( fs );
}
cvEndWriteStruct( fs );
__END__;
}