EOHFeature.h 1.5 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. #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. /** edge orientation feature of Levi and Weiss */
  15. class EOHFeature : public Feature
  16. {
  17. protected:
  18. enum {
  19. EOH_VALUE = 0,
  20. EOH_RATIO,
  21. EOH_DOMINANT_ORIENTATION,
  22. EOH_NUMTYPES
  23. };
  24. /** @{ feature parameter */
  25. int window_size_x;
  26. int window_size_y;
  27. int bin;
  28. int bin2; // used for EOH_RATIO
  29. int type;
  30. /** @} */
  31. /** @{ parameter for feature generation */
  32. int numScales;
  33. int numBins;
  34. double scaleStep;
  35. int maxdepth;
  36. /** @} */
  37. public:
  38. /** simple constructor */
  39. EOHFeature ( const NICE::Config *conf );
  40. /** internally used by EOHFeature::explode */
  41. EOHFeature () {
  42. bin = bin2 = 0;
  43. type = EOH_VALUE;
  44. };
  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