VC6.0+opencv1.0
为了修复opencv1.0 关于 svm.save不能保存的问题:
打开D:\Program Files\OpenCV\ml\src\mlsvm.cpp
修改write和read两个函数:
1、
void CvSVM::write( CvFileStorage* fs, const char* name )
{
……
cvEndWriteStruct( fs );
cvEndWriteStruct( fs );
__END__;
}
应该改为:
void CvSVM::write( CvFileStorage* fs, const char* name )
{
……
cvEndWriteStruct( fs );
}
cvEndWriteStruct( fs );
__END__;
还有就是:
void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
{
……
else
df.sv_index = 0;
}
create_kernel();
__END__;
}
void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
{
……
else
df.sv_index = 0;
CV_NEXT_SEQ_ELEM( sv_node->data.seq->elem_size, reader );
}
create_kernel();
__END__;
}
用户377235 2014-8-24 16:15