mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 03:30:34 +08:00
added implementation of CvHaarFeatureParams::read() in traincascade application (#1061)
This commit is contained in:
parent
5ca3bd502c
commit
96f69b160c
@ -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…
Reference in New Issue
Block a user