LFWriteCache.h 1.5 KB

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