void _writeFeatures( const std::vector<Feature> features, FileStorage &fs, const Mat& featureMap ) { fs << FEATURES << "["; const Mat_<int>& featureMap_ = (const Mat_<int>&) featureMap; for ( int fi = 0; fi < featureMap.cols; fi++ ) if( featureMap_( 0, fi ) >= 0 ) { fs << "{"; features[fi].write( fs ); fs << "}"; } fs << "]"; }
void CvHOGEvaluator::writeFeatures( FileStorage &fs, const Mat& featureMap ) const { int featIdx; int componentIdx; const Mat_<int>& featureMap_ = (const Mat_<int>&) featureMap; fs << FEATURES << "["; for ( int fi = 0; fi < featureMap.cols; fi++ ) if( featureMap_( 0, fi ) >= 0 ) { fs << "{"; featIdx = fi / getFeatureSize(); componentIdx = fi % getFeatureSize(); features[featIdx].write( fs, componentIdx ); fs << "}"; } fs << "]"; }