SemanticFeature.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * @file SemanticFeature.h
  3. * @brief texton feature similar to jamie shottons idea
  4. * @author Erik Rodner
  5. * @date 05/07/2008
  6. */
  7. #ifndef SemanticFeatureINCLUDE
  8. #define SemanticFeatureINCLUDE
  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. /** texton feature similar to jamie shottons idea */
  15. class SemanticFeature : public Feature
  16. {
  17. protected:
  18. /** @{ feature parameter */
  19. int window_size_x;
  20. int window_size_y;
  21. int shiftx;
  22. int shifty;
  23. int classno;
  24. /** @} */
  25. /** @{ parameter for feature generation */
  26. int numScales;
  27. double scaleStep;
  28. int maxdepth;
  29. int end_shiftx;
  30. int end_shifty;
  31. int step_shiftx;
  32. int step_shifty;
  33. /** @} */
  34. const std::set<int> *possibleClassNos;
  35. public:
  36. /** simple constructor */
  37. SemanticFeature ( const NICE::Config *conf,
  38. const std::set<int> *_possibleClassNos );
  39. /** simple constructor */
  40. SemanticFeature ( const NICE::Config *conf );
  41. /** internally used by SemanticFeature::explode */
  42. SemanticFeature () {};
  43. /** simple destructor */
  44. virtual ~SemanticFeature();
  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