VectorFeature.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * @file VectorFeature.h
  3. * @brief feature class to use in Examples stored features
  4. * @author Erik Rodner
  5. * @date 05/07/2008
  6. */
  7. #ifndef VectorFeatureINCLUDE
  8. #define VectorFeatureINCLUDE
  9. #include "core/basics/Config.h"
  10. #include "vislearning/cbaselib/Feature.h"
  11. namespace OBJREC {
  12. /** feature class to use in Examples stored features */
  13. class VectorFeature : public Feature
  14. {
  15. protected:
  16. int dimension;
  17. public:
  18. int feature_index;
  19. /** internally used by VectorFeature::explode */
  20. VectorFeature ( int _dimension, int _feature_index = 0 ) { dimension = _dimension; feature_index = _feature_index; };
  21. /** simple destructor */
  22. virtual ~VectorFeature();
  23. double val( const Example *example ) const;
  24. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  25. Feature *clone() const;
  26. Feature *generateFirstParameter () const;
  27. void restore (std::istream & is, int format = 0);
  28. void store (std::ostream & os, int format = 0) const;
  29. void clear ();
  30. void getStump ( int & feature_index, int & dimension ) const;
  31. };
  32. } // namespace
  33. #endif