VCSimpleGaussian.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @file VCSimpleGaussian.h
  3. * @brief Simple Gaussian Classifier
  4. * @author Erik Rodner
  5. * @date 12/05/2007
  6. */
  7. #ifdef NICE_USELIB_ICE
  8. #ifndef VCSIMPLEGAUSSIANINCLUDE
  9. #define VCSIMPLEGAUSSIANINCLUDE
  10. #include "vislearning/classifier/classifierbase/VecClassifier.h"
  11. #include "vislearning/math/pdf/PDF.h"
  12. #include <image_nonvis.h>
  13. namespace OBJREC {
  14. /** Simple Gaussian Classifier */
  15. class VCSimpleGaussian : public VecClassifier
  16. {
  17. public:
  18. std::map<int, ice::Statistics *> statistics;
  19. std::map<int, PDF *> pdfs;
  20. double calcNLogDensity ( int classno, const NICE::Vector & x ) const;
  21. public:
  22. /** simple constructor */
  23. VCSimpleGaussian( const NICE::Config *conf);
  24. /** simple destructor */
  25. virtual ~VCSimpleGaussian();
  26. /** classify using simple vector */
  27. ClassificationResult classify ( const NICE::Vector & x ) const;
  28. /** classify using a simple vector */
  29. void teach ( const LabeledSetVector & teachSet );
  30. void teach ( int classno, const NICE::Vector & x );
  31. void finishTeaching();
  32. void clear ();
  33. void store ( std::ostream & os, int format = 0 ) const;
  34. void restore ( std::istream & is, int format = 0 );
  35. void getVotings ( const NICE::Vector & x, std::map<int, double> & votings ) const;
  36. PDF *getPDF(int classno) const;
  37. };
  38. } // namespace
  39. #endif
  40. #endif