/** * @file FeatureLearningClusterBased.h * @brief compute new histogram entries by clustering new features and take centers of clusters which are relevant and novel * @author Alexander Freytag * @date 16-04-2013 (dd-mm-yyyy) */ #ifndef _INCLUDEFEATURELEARNINGCLUSTERBASED #define _INCLUDEFEATURELEARNINGCLUSTERBASED #include "FeatureLearningGeneric.h" #include #include #include #include #include #include namespace OBJREC { /** abstract interface for feature learning algorithms */ class FeatureLearningClusterBased : public FeatureLearningGeneric { protected: std::string section; bool showTrainingImages; //! define the initial number of clusters our codebook shall contain int initialNumberOfClusters; OBJREC::ClusterAlgorithm * clusterAlgo; NICE::VectorDistance * distFunction; LocalFeatureRepresentation * featureExtractor; NICE::VVector prototypes; /************************ * * protected methods * **************************/ void extractFeaturesFromTrainingImages( const OBJREC::MultiDataset *_md, NICE::VVector & examplesTraining ); void train ( const OBJREC::MultiDataset *_md ); public: /** constructor * @param conf needs a configfile * @param md and a MultiDataset (contains images and other things) */ FeatureLearningClusterBased ( const NICE::Config *_conf, const OBJREC::MultiDataset *_md , const std::string & _section = "featureLearning"); /** simple destructor */ virtual ~FeatureLearningClusterBased(); /** this function has to be overloaded by all subclasses @param imgWithNovelContent */ virtual void learnNewFeatures ( OBJREC::CachedExample *_ce ) ; virtual void evaluateCurrentCodebook ( const std::string & filename ); }; } // namespace #endif