HOGFeature.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * @file HOGFeature.h
  3. * @brief histogram of oriented gradients ( dalal and triggs )
  4. * @author Erik Rodner
  5. * @date 05/07/2008
  6. */
  7. #ifndef HOGFeatureINCLUDE
  8. #define HOGFeatureINCLUDE
  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. /** histogram of oriented gradients ( dalal and triggs ) */
  15. class HOGFeature : public Feature
  16. {
  17. protected:
  18. /** @{ feature parameter */
  19. int window_size_x;
  20. int window_size_y;
  21. int bin;
  22. int cellx1;
  23. int celly1;
  24. int cellx2;
  25. int celly2;
  26. int cellcountx;
  27. int cellcounty;
  28. bool flexibleGrid;
  29. /** @} */
  30. /** @{ parameter for feature generation */
  31. int numScales;
  32. int numBins;
  33. double scaleStep;
  34. /** @} */
  35. public:
  36. /** simple constructor */
  37. HOGFeature( const NICE::Config *conf );
  38. /** internally used by HOGFeature::explode */
  39. HOGFeature () {};
  40. /** simple destructor */
  41. virtual ~HOGFeature();
  42. double val( const Example *example ) const;
  43. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  44. Feature *clone() const;
  45. Feature *generateFirstParameter () const;
  46. void restore (std::istream & is, int format = 0);
  47. void store (std::ostream & os, int format = 0) const;
  48. void clear ();
  49. };
  50. } // namespace
  51. #endif