added implementation of CvHaarFeatureParams::read() in traincascade application (#1061)

This commit is contained in:
Maria Dimashova 2011-06-10 13:07:31 +00:00
parent 5ca3bd502c
commit 96f69b160c
2 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,22 @@ void CvHaarFeatureParams::write( FileStorage &fs ) const
fs << CC_MODE << modeStr;
}
bool CvHaarFeatureParams::read( const FileNode &node )
{
if( !CvFeatureParams::read( node ) )
return false;
FileNode rnode = node[CC_MODE];
if( !rnode.isString() )
return false;
String modeStr;
rnode >> modeStr;
mode = !modeStr.compare( CC_MODE_BASIC ) ? BASIC :
!modeStr.compare( CC_MODE_CORE ) ? CORE :
!modeStr.compare( CC_MODE_ALL ) ? ALL : -1;
return (mode >= 0);
}
void CvHaarFeatureParams::printDefaults() const
{
CvFeatureParams::printDefaults();

View File

@ -19,6 +19,7 @@ public:
virtual void init( const CvFeatureParams& fp );
virtual void write( FileStorage &fs ) const;
virtual bool read( const FileNode &node );
virtual void printDefaults() const;
virtual void printAttrs() const;