ColorHistogramFeature.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @file ColorHistogramFeature.h
  3. * @brief simple color histograms
  4. * @author Erik Rodner
  5. * @date 26/08/2008
  6. */
  7. #ifndef ColorHistogramFeatureINCLUDE
  8. #define ColorHistogramFeatureINCLUDE
  9. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "core/basics/Config.h"
  12. #include "vislearning/cbaselib/Feature.h"
  13. namespace OBJREC {
  14. /** simple color histograms */
  15. class ColorHistogramFeature : public Feature
  16. {
  17. protected:
  18. /** @{ feature parameter */
  19. int window_size_x;
  20. int window_size_y;
  21. int bin;
  22. /** @} */
  23. /** @{ parameter for feature generation */
  24. int numScales;
  25. int numBins;
  26. double scaleStep;
  27. /** @} */
  28. public:
  29. /** simple constructor */
  30. ColorHistogramFeature ( const NICE::Config *conf );
  31. /** internally used by ColorHistogramFeature::explode */
  32. ColorHistogramFeature () {};
  33. /** simple destructor */
  34. virtual ~ColorHistogramFeature();
  35. double val ( const Example *example ) const;
  36. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  37. Feature *clone() const;
  38. Feature *generateFirstParameter () const;
  39. void restore ( std::istream & is, int format = 0 );
  40. void store ( std::ostream & os, int format = 0 ) const;
  41. void clear ();
  42. };
  43. } // namespace
  44. #endif