LocalFeature.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * @file LocalFeature.h
  3. * @brief Abstract class for Local Features ( ONLY DESCRIPTORS, NO DETECTORS )
  4. * @author Erik Rodner, Alexander Freytag
  5. * @date 02/05/2008
  6. */
  7. #ifndef LOCALFEATUREINCLUDE
  8. #define LOCALFEATUREINCLUDE
  9. // nice-core includes
  10. #include <core/basics/Config.h>
  11. #include <core/basics/Persistent.h>
  12. //
  13. #include <core/image/ImageT.h>
  14. //
  15. #include <core/vector/MatrixT.h>
  16. #include <core/vector/VectorT.h>
  17. #include <core/vector/VVector.h>
  18. namespace OBJREC {
  19. /** @class LocalFeature
  20. * @brief Abstract class for Local Features ( ONLY DESCRIPTORS, NO DETECTORS )
  21. *
  22. */
  23. class LocalFeature : public NICE::Persistent
  24. {
  25. protected:
  26. public:
  27. ///////////////////// ///////////////////// /////////////////////
  28. // CONSTRUCTORS / DESTRUCTORS
  29. ///////////////////// ///////////////////// /////////////////////
  30. /** simple constructor */
  31. LocalFeature();
  32. /** simple destructor */
  33. virtual ~LocalFeature();
  34. /**
  35. * @brief Jobs previously performed in the config-version of the constructor, read settings etc.
  36. * @author Alexander Freytag
  37. * @date 09-02-2014 ( dd-mm-yyyy )
  38. */
  39. virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "LocalFeature") = 0;
  40. ///////////////////// ///////////////////// /////////////////////
  41. // FEATURE STUFF
  42. ///////////////////// ///////////////////// //////////////////
  43. virtual int getDescSize() const = 0;
  44. virtual int getDescriptors ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors) const = 0;
  45. virtual int getDescriptors ( const NICE::ColorImage & img, NICE::VVector & positions, NICE::VVector & descriptors) const;
  46. virtual void visualizeFeatures ( NICE::Image & mark,
  47. const NICE::VVector & positions,
  48. size_t color ) const;
  49. ///////////////////// INTERFACE PERSISTENT /////////////////////
  50. // interface specific methods for store and restore
  51. ///////////////////// INTERFACE PERSISTENT /////////////////////
  52. /**
  53. * @brief Load object from external file (stream)
  54. * @author Alexander Freytag
  55. * @date 09-02-2014 ( dd-mm-yyyy )
  56. */
  57. void restore ( std::istream & is, int format = 0 ) = 0;
  58. /**
  59. * @brief Save object to external file (stream)
  60. * @author Alexander Freytag
  61. * @date 09-02-2014 ( dd-mm-yyyy )
  62. */
  63. void store ( std::ostream & os, int format = 0 ) const = 0;
  64. /**
  65. * @brief Clear object
  66. * @author Alexander Freytag
  67. * @date 09-02-2014 ( dd-mm-yyyy )
  68. */
  69. void clear () = 0;
  70. };
  71. } // namespace
  72. #endif