LFGenericLocal.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @file LFGenericLocal.cpp
  3. * @brief generic local features
  4. * @author Erik Rodner
  5. * @date 02/05/2008
  6. */
  7. #include <iostream>
  8. #include <sstream>
  9. #include "vislearning/features/localfeatures/LFGenericLocal.h"
  10. #include "vislearning/features/localfeatures/LocalFeatureSift.h"
  11. #include "vislearning/features/localfeatures/IDRandomSampling.h"
  12. using namespace OBJREC;
  13. using namespace std;
  14. using namespace NICE;
  15. LFGenericLocal::LFGenericLocal( const Config *conf, int numFeatures )
  16. {
  17. lf = new LocalFeatureSift(conf);
  18. id = new IDRandomSampling(conf, numFeatures);
  19. }
  20. LFGenericLocal::~LFGenericLocal()
  21. {
  22. delete lf;
  23. }
  24. int LFGenericLocal::getDescSize () const
  25. {
  26. return lf->getDescSize();
  27. }
  28. int LFGenericLocal::extractFeatures ( const NICE::Image & img,
  29. VVector & features,
  30. VVector & positions ) const
  31. {
  32. id->getInterests ( img, positions );
  33. lf->getDescriptors ( img, positions, features );
  34. return 0;
  35. }
  36. void LFGenericLocal::visualizeFeatures ( NICE::Image & mark,
  37. const VVector & positions,
  38. size_t color ) const
  39. {
  40. lf->visualizeFeatures ( mark, positions, color );
  41. }