LFWriteCache.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * @file LFWriteCache.h
  3. * @brief Write local features to file (whenever a descriptor is computed, it will be checked whether a corresponding file already exists. If not, we save the descriptor)
  4. * @author Erik Rodner
  5. * @date 02/14/2008
  6. */
  7. #ifndef LFWriteCacheINCLUDE
  8. #define LFWriteCacheINCLUDE
  9. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "core/image/ImageT.h"
  12. #include "LocalFeatureRepresentation.h"
  13. #include "core/basics/Config.h"
  14. namespace OBJREC {
  15. /** @class LFWriteCache
  16. * @brief Write local features to file (whenever a descriptor is computed, it will be checked whether a corresponding file already exists. If not, we save the descriptor)
  17. *
  18. */
  19. class LFWriteCache : public LocalFeatureRepresentation
  20. {
  21. protected:
  22. const LocalFeatureRepresentation *lfrep;
  23. std::string cachedir;
  24. int descFormat;
  25. int cachemode;
  26. public:
  27. /** simple constructor */
  28. LFWriteCache( const NICE::Config *conf,
  29. const LocalFeatureRepresentation *lfrep );
  30. /** simple destructor */
  31. virtual ~LFWriteCache();
  32. int getDescSize () const;
  33. /**
  34. * extract features for gray images
  35. * @param img input image
  36. * @param features output features
  37. * @param positions position of the features
  38. * @return
  39. */
  40. int extractFeatures ( const NICE::Image & img,
  41. NICE::VVector & features,
  42. NICE::VVector & positions ) const;
  43. /**
  44. * extract features for color images
  45. * @param img input image
  46. * @param features output features
  47. * @param positions position of the features
  48. * @return
  49. */
  50. int extractFeatures ( const NICE::ColorImage & img,
  51. NICE::VVector & features,
  52. NICE::VVector & positions ) const;
  53. void visualize ( NICE::Image & img,
  54. const NICE::Vector & feature ) const;
  55. void visualizeFeatures ( NICE::Image & mark,
  56. const NICE::VVector & positions,
  57. size_t color ) const;
  58. };
  59. } // namespace
  60. #endif