/** * @file Feature.cpp * @brief abstraction of a feature * @author Erik Rodner * @date 04/21/2008 */ #include "core/image/ImageT.h" #include "core/vector/VectorT.h" #include "core/vector/MatrixT.h" #include #include "Feature.h" #include "FeaturePool.h" using namespace OBJREC; using namespace std; // refactor-nice.pl: check this substitution // old: using namespace ice; using namespace NICE; Feature::Feature() { } Feature::~Feature() { } void Feature::calcFeatureValues ( const Examples & examples, vector & examples_selection, FeatureValues & values ) const { for ( vector::const_iterator si = examples_selection.begin(); si != examples_selection.end(); si++ ) { int index = *si; const pair & p = examples[index]; int classno = p.first; const Example & ce = p.second; double value = val ( &ce ); values.insert ( quadruplet ( value, classno, index, ce.weight ) ); } } void Feature::calcFeatureValues ( const Examples & examples, vector & examples_selection, FeatureValuesUnsorted & values ) const { for ( vector::const_iterator si = examples_selection.begin(); si != examples_selection.end(); si++ ) { int index = *si; const pair & p = examples[index]; int classno = p.first; const Example & ce = p.second; double value = val ( &ce ); values.push_back ( quadruplet ( value, classno, index, ce.weight ) ); } }