SemanticFeature.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #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. /** texton feature similar to jamie shottons idea */
  18. class SemanticFeature : public Feature
  19. {
  20. protected:
  21. /** @{ feature parameter */
  22. int window_size_x;
  23. int window_size_y;
  24. int shiftx;
  25. int shifty;
  26. int classno;
  27. /** @} */
  28. /** @{ parameter for feature generation */
  29. int numScales;
  30. double scaleStep;
  31. int maxdepth;
  32. int end_shiftx;
  33. int end_shifty;
  34. int step_shiftx;
  35. int step_shifty;
  36. /** @} */
  37. const std::set<int> *possibleClassNos;
  38. public:
  39. /** simple constructor */
  40. SemanticFeature( const NICE::Config *conf,
  41. const std::set<int> *_possibleClassNos );
  42. /** simple constructor */
  43. SemanticFeature( const NICE::Config *conf );
  44. /** internally used by SemanticFeature::explode */
  45. SemanticFeature () {};
  46. /** simple destructor */
  47. virtual ~SemanticFeature();
  48. double val( const Example *example ) const;
  49. void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
  50. Feature *clone() const;
  51. Feature *generateFirstParameter () const;
  52. void restore (std::istream & is, int format = 0);
  53. void store (std::ostream & os, int format = 0) const;
  54. void clear ();
  55. };
  56. } // namespace
  57. #endif