PixelPairFeature.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * @file PixelPairFeature.h
  3. * @brief like in Shotton paper
  4. * @author Erik Rodner
  5. * @date 04/21/2008
  6. */
  7. #ifndef PixelPairFeatureINCLUDE
  8. #define PixelPairFeatureINCLUDE
  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. /** simple haar like feature */
  15. class PixelPairFeature : public Feature
  16. {
  17. protected:
  18. enum {
  19. PPTYPE_DIFF = 0,
  20. PPTYPE_ABSDIFF,
  21. PPTYPE_SUM,
  22. PPTYPE_VALUE
  23. };
  24. int type;
  25. int imagetype;
  26. int x1;
  27. int y1;
  28. int b1;
  29. int x2;
  30. int y2;
  31. int b2;
  32. int step_x;
  33. int step_y;
  34. int window_size_x;
  35. int window_size_y;
  36. public:
  37. /** simple constructor */
  38. PixelPairFeature ( const NICE::Config *conf );
  39. /** without memory wasting config */
  40. PixelPairFeature ( int window_size_x,
  41. int window_size_y,
  42. int step_x,
  43. int step_y,
  44. int imagetype );
  45. /** simple destructor */
  46. virtual ~PixelPairFeature();
  47. double val ( const Example *example ) const;
  48. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  49. Feature *clone() const;
  50. void restore ( std::istream & is, int format = 0 );
  51. void store ( std::ostream & os, int format = 0 ) const;
  52. void clear ();
  53. #if 0
  54. void calcFeatureValues ( const Examples & examples,
  55. std::vector<int> & examples_selection,
  56. FeatureValuesUnsorted & values ) const;
  57. #endif
  58. };
  59. } // namespace
  60. #endif