LFWriteCache.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * @file LFWriteCache.h
  3. * @brief write local features to file
  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. /** write local features to file */
  16. class LFWriteCache : public LocalFeatureRepresentation
  17. {
  18. protected:
  19. const LocalFeatureRepresentation *lfrep;
  20. std::string cachedir;
  21. int descFormat;
  22. int cachemode;
  23. public:
  24. /** simple constructor */
  25. LFWriteCache( const NICE::Config *conf,
  26. const LocalFeatureRepresentation *lfrep );
  27. /** simple destructor */
  28. virtual ~LFWriteCache();
  29. int getDescSize () const;
  30. /**
  31. * extract features for gray images
  32. * @param img input image
  33. * @param features output features
  34. * @param positions position of the features
  35. * @return
  36. */
  37. int extractFeatures ( const NICE::Image & img,
  38. NICE::VVector & features,
  39. NICE::VVector & positions ) const;
  40. /**
  41. * extract features for color images
  42. * @param img input image
  43. * @param features output features
  44. * @param positions position of the features
  45. * @return
  46. */
  47. int extractFeatures ( const NICE::ColorImage & img,
  48. NICE::VVector & features,
  49. NICE::VVector & positions ) const;
  50. void visualize ( NICE::Image & img,
  51. const NICE::Vector & feature ) const;
  52. void visualizeFeatures ( NICE::Image & mark,
  53. const NICE::VVector & positions,
  54. size_t color ) const;
  55. };
  56. } // namespace
  57. #endif