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

pull/13383/head
Maria Dimashova 14 years ago
parent 5ca3bd502c
commit 96f69b160c
  1. 16
      modules/traincascade/haarfeatures.cpp
  2. 1
      modules/traincascade/haarfeatures.h

@ -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();

@ -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;

Loading…
Cancel
Save