12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /**
- * @file FeatureLearningGeneric.h
- * @brief abstract interface for feature learning algorithms
- * @author Alexander Freytag
- * @date 16-04-2013 (dd-mm-yyyy)
- */
- #ifndef _INCLUDEFEATURELEARNING
- #define _INCLUDEFEATURELEARNING
- #define ROADWORKS fthrow(NICE::Exception, "Feature Learning -- not yet implemented!");
- #include <string>
- #include <core/basics/Config.h>
- #include <core/image/ImageT.h>
- #include <vislearning/cbaselib/CachedExample.h>
- namespace OBJREC
- {
- /** abstract interface for feature learning algorithms */
- class FeatureLearningGeneric
- {
- protected:
-
- //! section information for parsing config files
- std::string section;
-
- //! Configuration File
- const NICE::Config *conf;
-
- //! where should an initial codebook be located, i.e., read from and written to?
- std::string cacheInitialCodebook;
- //! was an initial codebook already computed?
- bool b_loadInitialCodebook;
- //!shall the initially computed codebook be stored somewhere?
- bool b_saveInitialCodebook;
-
- //! additional evaluation in the process of feature learning, e.g., visualize the most useful features in the current image
- bool b_evaluationWhileFeatureLearning;
-
- /**
- * @brief Load a previously computed codebook which serves as initial codebook
- * @author Alexander Freytag
- * @date 17-04-2013 (dd-mm-yyyy)
- * @return bool (success of loading)
- * @note This function has to be overloaded by all subclasses!
- */
- virtual bool loadInitialCodebook ( ) = 0;
-
- /**
- * @brief Store the initially computed codebook
- * @author Alexander Freytag
- * @date 17-04-2013 (dd-mm-yyyy)
- * @return bool (success of writing)
- * @note This function has to be overloaded by all subclasses!
- */
- virtual bool writeInitialCodebook ( ) = 0;
-
- public:
- /**
- * @brief simple constructor
- * @author Alexander Freytag
- * @date 16-04-2013 (dd-mm-yyyy)
- * @param _conf global settings
- * @param _section section information for parsing config files
- */
- FeatureLearningGeneric ( const NICE::Config *_conf, const std::string & _section = "featureLearning" );
- /** simple destructor */
- virtual ~FeatureLearningGeneric();
-
- /** this function has to be overloaded by all subclasses
- @param imgWithNovelContent
- */
- virtual void learnNewFeatures ( const std::string & _filename) = 0;
-
- virtual NICE::FloatImage evaluateCurrentCodebook ( const std::string & filename , const bool & beforeComputingNewFeatures = true) = 0;
-
- };
- } // namespace
- #endif
|