ColorHistogramFeature.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifdef NOVISUAL
  10. #include <vislearning/nice_nonvis.h>
  11. #else
  12. #include <vislearning/nice.h>
  13. #endif
  14. #include "core/basics/Config.h"
  15. #include "vislearning/cbaselib/Feature.h"
  16. namespace OBJREC {
  17. /** simple color histograms */
  18. class ColorHistogramFeature : public Feature
  19. {
  20. protected:
  21. /** @{ feature parameter */
  22. int window_size_x;
  23. int window_size_y;
  24. int bin;
  25. /** @} */
  26. /** @{ parameter for feature generation */
  27. int numScales;
  28. int numBins;
  29. double scaleStep;
  30. /** @} */
  31. public:
  32. /** simple constructor */
  33. ColorHistogramFeature( const NICE::Config *conf );
  34. /** internally used by ColorHistogramFeature::explode */
  35. ColorHistogramFeature () {};
  36. /** simple destructor */
  37. virtual ~ColorHistogramFeature();
  38. double val( const Example *example ) const;
  39. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  40. Feature *clone() const;
  41. Feature *generateFirstParameter () const;
  42. void restore (std::istream & is, int format = 0);
  43. void store (std::ostream & os, int format = 0) const;
  44. void clear ();
  45. };
  46. } // namespace
  47. #endif