LFPatches.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * @file LFPatches.h
  3. * @brief simple patch based approach
  4. * @author Erik Rodner
  5. * @date 02/06/2008
  6. */
  7. #ifndef LFPATCHESINCLUDE
  8. #define LFPATCHESINCLUDE
  9. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "core/image/ImageT.h"
  12. #include "core/basics/Config.h"
  13. #include "vislearning/image/ImagePyramid.h"
  14. #include "LocalFeatureRepresentation.h"
  15. #include "vislearning/features/localfeatures/InterestDetector.h"
  16. namespace OBJREC
  17. {
  18. /** simple patch based approach */
  19. class LFPatches: public LocalFeatureRepresentation
  20. {
  21. protected:
  22. enum
  23. {
  24. NORMALIZE_N01 = 0, NORMALIZE_NONE, NORMALIZE_STDDEV, NORMALIZE_MEAN
  25. };
  26. int xsize;
  27. int ysize;
  28. int normalization;
  29. std::auto_ptr<InterestDetector> id;
  30. int maxLevels;
  31. double scaleSpacing;
  32. int detectormode;
  33. int numPatches;
  34. void calcDescriptors(const ImagePyramid & imp, NICE::VVector & positions,
  35. NICE::VVector & features) const;
  36. public:
  37. /** simple constructor */
  38. LFPatches(const NICE::Config *conf, int numPatches);
  39. /** simple destructor */
  40. virtual ~LFPatches();
  41. int getDescSize() const;
  42. int extractFeatures(const NICE::Image & img, NICE::VVector & features,
  43. NICE::VVector & positions) const;
  44. void correctPositions(const ImagePyramid & imp, NICE::VVector & positions,
  45. NICE::VVector & positions_corrected) const;
  46. void visualize(NICE::Image & img, const NICE::Vector & feature) const;
  47. void visualizeFeatures(NICE::Image & mark, const NICE::VVector & positions,
  48. size_t color) const;
  49. //DIRTY for bofCreationSingleImage
  50. int calcDescriptor(const ImagePyramid & imp, const NICE::Vector & position,
  51. NICE::Vector & desc) const;
  52. };
  53. } // namespace
  54. #endif