VCNormalize.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @file VCNormalize.h
  3. // refactor-nice.pl: check this substitution
  4. // old: * @brief interface to Vector Transformation
  5. * @brief interface to NICE::Vector Transformation
  6. * @author Michael Koch
  7. * @date 11/28/2007
  8. */
  9. #ifndef VCNormalizeINCLUDE
  10. #define VCNormalizeINCLUDE
  11. #ifdef NOVISUAL
  12. #include <vislearning/nice_nonvis.h>
  13. #else
  14. #include <vislearning/nice.h>
  15. #endif
  16. #include "vislearning/math/ftransform/FTransform.h"
  17. #include "vislearning/classifier/classifierbase/VecClassifier.h"
  18. namespace OBJREC
  19. {
  20. /** VC with Feature Transformation */
  21. class VCNormalize: public VecClassifier
  22. {
  23. protected:
  24. VecClassifier * classifier;
  25. LabeledSetVector transformedSet;
  26. uint mode;
  27. NICE::Vector vector_max;
  28. NICE::Vector vector_min;
  29. NICE::Vector vector_span;
  30. NICE::Vector getNormalizedVector(const NICE::Vector &x) const;
  31. public:
  32. /** simple constructor */
  33. VCNormalize(const NICE::Config *conf, VecClassifier * classifier);
  34. /** simple destructor */
  35. virtual ~VCNormalize();
  36. /** classify using simple vector */
  37. ClassificationResult classify(const NICE::Vector & x) const;
  38. void teach(const LabeledSetVector & teachSet);
  39. void finishTeaching();
  40. void restore(std::istream & is, int format = 0);
  41. void store(std::ostream & is, int format = 0) const;
  42. void clear();
  43. };
  44. } // namespace
  45. #endif