12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /**
- * @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 <string>
- #include <core/vector/Distance.h>
- #include <core/vector/VVector.h>
- #include <vislearning/cbaselib/MultiDataset.h>
- #include <vislearning/features/localfeatures/GenericLocalFeatureSelection.h>
- #include <vislearning/math/cluster/ClusterAlgorithm.h>
- 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<double> * 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
|