InterestDetector.cpp 701 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @file InterestDetector.cpp
  3. * @brief interest detector interface
  4. * @author Erik Rodner
  5. * @date 02/05/2008
  6. */
  7. #ifdef NOVISUAL
  8. #include <vislearning/nice_nonvis.h>
  9. #else
  10. #include <vislearning/nice.h>
  11. #endif
  12. #include <iostream>
  13. #include "vislearning/features/localfeatures/InterestDetector.h"
  14. using namespace OBJREC;
  15. using namespace std;
  16. using namespace NICE;
  17. InterestDetector::InterestDetector()
  18. {
  19. }
  20. InterestDetector::~InterestDetector()
  21. {
  22. }
  23. void InterestDetector::reducePositionsRandom(
  24. std::vector<NICE::Vector> & positions, size_t numsamples) const
  25. {
  26. while(positions.size()> numsamples)
  27. {
  28. size_t pos = rand() % positions.size();
  29. positions.erase(positions.begin()+pos);
  30. }
  31. }