HOGFeature.h 1.3 KB

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