TextonFeature.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @file TextonFeature.h
  3. * @brief texton feature similar to jamie shottons idea
  4. * @author Erik Rodner
  5. * @date 05/07/2008
  6. */
  7. #ifndef TEXTONFEATUREINCLUDE
  8. #define TEXTONFEATUREINCLUDE
  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. #include "vislearning/classifier/fpclassifier/randomforest/DecisionNode.h"
  14. namespace OBJREC {
  15. /** texton feature similar to jamie shottons idea */
  16. class TextonFeature : public Feature
  17. {
  18. protected:
  19. int window_size_x;
  20. int window_size_y;
  21. int node_index;
  22. std::map<DecisionNode *, std::pair<long, int> > *nodeList;
  23. int numScales;
  24. double scaleStep;
  25. int maxdepth;
  26. public:
  27. /** simple constructor */
  28. TextonFeature( const NICE::Config *conf,
  29. std::map<DecisionNode *, std::pair<long, int> > *_nodeList,
  30. int maxdepth );
  31. /** internally used by TextonFeature::explode */
  32. TextonFeature () {};
  33. /** simple destructor */
  34. virtual ~TextonFeature();
  35. double val( const Example *example ) const;
  36. void explode ( std::vector<Feature *> & featurePool, bool variableWindow = true ) const;
  37. Feature *clone() const;
  38. Feature *generateFirstParameter () const;
  39. void restore (std::istream & is, int format = 0);
  40. void store (std::ostream & os, int format = 0) const;
  41. void clear ();
  42. };
  43. } // namespace
  44. #endif