LFGenericLocal.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. }
  42. ///////////////////// INTERFACE PERSISTENT /////////////////////
  43. // interface specific methods for store and restore
  44. ///////////////////// INTERFACE PERSISTENT /////////////////////
  45. void LFGenericLocal::restore ( std::istream & is, int format )
  46. {
  47. fthrow ( Exception, "LFGenericLocal::restore not implemented yet." );
  48. //TODO
  49. }
  50. void LFGenericLocal::store ( std::ostream & os, int format ) const
  51. {
  52. fthrow ( Exception, "LFGenericLocal::store not implemented yet." );
  53. //TODO
  54. }
  55. void LFGenericLocal::clear ()
  56. {
  57. fthrow ( Exception, "LFGenericLocal::clear not implemented yet." );
  58. //TODO
  59. }