InterestDetector.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @file InterestDetector.h
  3. * @brief interest detector interface
  4. * @author Erik Rodner
  5. * @date 02/05/2008
  6. */
  7. #ifndef INTERESTDETECTORINCLUDE
  8. #define INTERESTDETECTORINCLUDE
  9. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "core/image/ImageT.h"
  12. #include "vislearning/image/ImagePyramid.h"
  13. namespace OBJREC
  14. {
  15. /** interest detector interface */
  16. class InterestDetector
  17. {
  18. protected:
  19. public:
  20. /** simple constructor */
  21. InterestDetector();
  22. /** simple destructor */
  23. virtual ~InterestDetector();
  24. virtual int getInterests(const NICE::Image & img,
  25. std::vector<NICE::Vector> & positions) const = 0;
  26. virtual int getInterests(const ImagePyramid & imp,
  27. std::vector<NICE::Vector> & positions) const = 0;
  28. inline void getRandomInterests(const NICE::Image & img, std::vector<
  29. NICE::Vector> & positions, size_t numsamples) const
  30. {
  31. getInterests(img, positions);
  32. reducePositionsRandom(positions, numsamples);
  33. }
  34. inline void getRandomInterests(const ImagePyramid & imp, std::vector<
  35. NICE::Vector> & positions, size_t numsamples) const
  36. {
  37. getInterests(imp, positions);
  38. reducePositionsRandom(positions, numsamples);
  39. }
  40. private:
  41. void reducePositionsRandom(std::vector<NICE::Vector> & positions,
  42. size_t numsamples) const;
  43. };
  44. } // namespace
  45. #endif