EOHFeature.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * @file EOHFeature.h
  3. * @brief edge orientation histogram (Levi and Weiss, 2004)
  4. * @author Erik Rodner
  5. * @date 05/07/2008
  6. */
  7. #ifndef EOHFeatureINCLUDE
  8. #define EOHFeatureINCLUDE
  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. /** edge orientation feature of Levi and Weiss */
  18. class EOHFeature : public Feature
  19. {
  20. protected:
  21. enum {
  22. EOH_VALUE = 0,
  23. EOH_RATIO,
  24. EOH_DOMINANT_ORIENTATION,
  25. EOH_NUMTYPES
  26. };
  27. /** @{ feature parameter */
  28. int window_size_x;
  29. int window_size_y;
  30. int bin;
  31. int bin2; // used for EOH_RATIO
  32. int type;
  33. /** @} */
  34. /** @{ parameter for feature generation */
  35. int numScales;
  36. int numBins;
  37. double scaleStep;
  38. int maxdepth;
  39. /** @} */
  40. public:
  41. /** simple constructor */
  42. EOHFeature( const NICE::Config *conf );
  43. /** internally used by EOHFeature::explode */
  44. EOHFeature () { bin = bin2 = 0; type = EOH_VALUE; };
  45. /** simple destructor */
  46. virtual ~EOHFeature();
  47. double val( const Example *example ) const;
  48. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  49. Feature *clone() const;
  50. Feature *generateFirstParameter () const;
  51. void restore (std::istream & is, int format = 0);
  52. void store (std::ostream & os, int format = 0) const;
  53. void clear ();
  54. };
  55. } // namespace
  56. #endif