LocalFeatureRepresentation.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * @file LocalFeatureRepresentation.h
  3. * @brief Absract class for Local Feature Representations (Detector + Descriptor)
  4. * @author Erik Rodner, Alexander Freytag
  5. * @date 11/19/2007
  6. */
  7. #ifndef LOCALFEATUREREPRESENTATIONINCLUDE
  8. #define LOCALFEATUREREPRESENTATIONINCLUDE
  9. // STL includes
  10. #include <vector>
  11. // nice-core includes
  12. #include <core/basics/Exception.h>
  13. #include <core/basics/Persistent.h>
  14. //
  15. #include <core/image/ImageT.h>
  16. #include <core/imagedisplay/ImageDisplay.h>
  17. //
  18. #include <core/vector/VectorT.h>
  19. #include <core/vector/MatrixT.h>
  20. #include <core/vector/VVector.h>
  21. namespace OBJREC {
  22. /** absract class for the representation of an image with local feature descriptors */
  23. /** NOTE: This class returns Descriptors, which DO NOT need any given positions. All Descriptors calculate there own positions, on DIFFERENT ways. **/
  24. /** @class LocalFeatureRepresentation
  25. * @brief Absract class for Local Feature Representations (Detector + Descriptor)
  26. *
  27. */
  28. class LocalFeatureRepresentation : public NICE::Persistent
  29. {
  30. protected:
  31. public:
  32. ///////////////////// ///////////////////// /////////////////////
  33. // CONSTRUCTORS / DESTRUCTORS
  34. ///////////////////// ///////////////////// /////////////////////
  35. /** simple constructor */
  36. LocalFeatureRepresentation();
  37. /** simple destructor */
  38. virtual ~LocalFeatureRepresentation();
  39. ///////////////////// ///////////////////// /////////////////////
  40. // FEATURE STUFF
  41. ///////////////////// ///////////////////// //////////////////
  42. virtual int getDescSize () const = 0;
  43. virtual int extractFeatures ( const NICE::Image & img,
  44. NICE::VVector & features,
  45. NICE::VVector & positions ) const = 0;
  46. virtual int extractFeatures ( const NICE::ColorImage & img,
  47. NICE::VVector & features,
  48. NICE::VVector & positions ) const;
  49. virtual void visualizeFeatures ( NICE::Image & mark,
  50. const NICE::VVector & positions,
  51. size_t color ) const;
  52. virtual void visualize ( NICE::Image & img,
  53. const NICE::Vector & feature ) const;
  54. ///////////////////// INTERFACE PERSISTENT /////////////////////
  55. // interface specific methods for store and restore
  56. ///////////////////// INTERFACE PERSISTENT /////////////////////
  57. /**
  58. * @brief Load object from external file (stream)
  59. * @author Alexander Freytag
  60. * @date 09-02-2014 ( dd-mm-yyyy )
  61. */
  62. void restore ( std::istream & is, int format = 0 ) = 0;
  63. /**
  64. * @brief Save object to external file (stream)
  65. * @author Alexander Freytag
  66. * @date 09-02-2014 ( dd-mm-yyyy )
  67. */
  68. void store ( std::ostream & os, int format = 0 ) const = 0;
  69. /**
  70. * @brief Clear object
  71. * @author Alexander Freytag
  72. * @date 09-02-2014 ( dd-mm-yyyy )
  73. */
  74. void clear () = 0;
  75. };
  76. } // namespace
  77. #endif