InterestDetector.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifdef NOVISUAL
  10. #include <vislearning/nice_nonvis.h>
  11. #else
  12. #include <vislearning/nice.h>
  13. #endif
  14. #include "vislearning/image/ImagePyramid.h"
  15. namespace OBJREC
  16. {
  17. /** interest detector interface */
  18. class InterestDetector
  19. {
  20. protected:
  21. public:
  22. /** simple constructor */
  23. InterestDetector();
  24. /** simple destructor */
  25. virtual ~InterestDetector();
  26. virtual int getInterests(const NICE::Image & img,
  27. std::vector<NICE::Vector> & positions) const = 0;
  28. virtual int getInterests(const ImagePyramid & imp,
  29. std::vector<NICE::Vector> & positions) const = 0;
  30. inline void getRandomInterests(const NICE::Image & img, std::vector<
  31. NICE::Vector> & positions, size_t numsamples) const
  32. {
  33. getInterests(img, positions);
  34. reducePositionsRandom(positions, numsamples);
  35. }
  36. inline void getRandomInterests(const ImagePyramid & imp, std::vector<
  37. NICE::Vector> & positions, size_t numsamples) const
  38. {
  39. getInterests(imp, positions);
  40. reducePositionsRandom(positions, numsamples);
  41. }
  42. private:
  43. void reducePositionsRandom(std::vector<NICE::Vector> & positions,
  44. size_t numsamples) const;
  45. };
  46. } // namespace
  47. #endif