TextonFeature.h 1.4 KB

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