/** * @file FCCodebookHistBin.h * @brief create features with codebook * @author Erik Rodner * @date 02/05/2008 */ #ifndef FCCODEBOOKHISTBININCLUDE #define FCCODEBOOKHISTBININCLUDE #ifdef NOVISUAL #include #else #include #endif #include "core/basics/Config.h" #include "vislearning/features/fbase/FeatureFactory.h" #include "vislearning/features/localfeatures/LocalFeatureRepresentation.h" #include "Codebook.h" namespace OBJREC { /** create features with codebook */ class FCCodebookHistBin : public FeatureFactory { protected: int n_method; const LocalFeatureRepresentation *lfrep; const Codebook *codebook; void calcHistogram ( const NICE::VVector & features, NICE::Vector & histogram ); void calcHistogram ( const NICE::VVector & features, NICE::Vector & histogram, NICE::Matrix & assignments); void normalizeHistogram ( NICE::Vector & histogram ); public: enum { NORMALIZE_RAW = 0, NORMALIZE_BINZERO, NORMALIZE_SUM, NORMALIZE_THRESH }; /** simple constructor */ FCCodebookHistBin( const NICE::Config *conf, const LocalFeatureRepresentation *lfrep, const std::string & normalizationMethod, const Codebook *codebook ); /** simple destructor */ virtual ~FCCodebookHistBin(); int convert ( const NICE::Image & img, NICE::Vector & vec ); int calcAssignments ( const NICE::VVector & features, NICE::Vector & vec, NICE::Matrix & assignments ); void setNormalizationMethod ( int normalizationMethod ); int getNormalizationMethod () const; }; } // namespace #endif