LocalFeatureRGBSift.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /**
  2. * @file LocalFeatureRGBSift.h
  3. * @brief local feature with color sift
  4. * @author Björn Fröhlich, Alexander Freytag
  5. * @date 03/10/2012 (Eric Bach)
  6. */
  7. #ifndef LocalFeatureRGBSiftINCLUDE
  8. #define LocalFeatureRGBSiftINCLUDE
  9. // nice-core includes
  10. #include <core/basics/Config.h>
  11. //
  12. #include <core/image/ImageT.h>
  13. //
  14. #include <core/vector/VectorT.h>
  15. #include <core/vector/MatrixT.h>
  16. // nice-vislearning includes
  17. #include "LocalFeatureSift.h"
  18. namespace OBJREC {
  19. /** local feature with sift */
  20. class LocalFeatureRGBSift : public LocalFeatureSift
  21. {
  22. protected:
  23. /////////////////////////
  24. /////////////////////////
  25. // PROTECTED VARIABLES //
  26. /////////////////////////
  27. /////////////////////////
  28. //TODO check why those member variables have been declared here originally. In the source code, they're not used at all...
  29. // int octaves;
  30. //
  31. // int levels;
  32. //
  33. // bool normalizeFeature;
  34. //
  35. // int first_octave;
  36. //
  37. // double magnif;
  38. public:
  39. ///////////////////// ///////////////////// /////////////////////
  40. // CONSTRUCTORS / DESTRUCTORS
  41. ///////////////////// ///////////////////// /////////////////////
  42. /**
  43. * @brief default constructor
  44. * @date 09-02-2014 (dd-mm-yyyy )
  45. * @author Alexander Freytag
  46. */
  47. LocalFeatureRGBSift ( );
  48. /**
  49. * @brief recommended constructor, calls initFromConfig
  50. * @date 09-02-2014 (dd-mm-yyyy )
  51. * @author Alexander Freytag
  52. */
  53. LocalFeatureRGBSift ( const NICE::Config * _conf );
  54. /**
  55. * @brief simple destructor
  56. */
  57. virtual ~LocalFeatureRGBSift();
  58. /**
  59. * @brief Jobs previously performed in the config-version of the constructor, read settings etc.
  60. * @author Alexander Freytag
  61. * @date 09-02-2014 ( dd-mm-yyyy )
  62. */
  63. virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "LocalFeatureRGBSift");
  64. ///////////////////// ///////////////////// /////////////////////
  65. // FEATURE STUFF
  66. ///////////////////// ///////////////////// //////////////////
  67. /**
  68. * returns the size of each the SIFT-Feature
  69. * @return 128
  70. */
  71. int getDescSize() const {
  72. return 384;
  73. };
  74. /**
  75. * get the descriptor
  76. * @param img input color image
  77. * @param positions positions for the SIFT features
  78. * @param descriptors output
  79. * @return 0
  80. */
  81. virtual int getDescriptors ( const NICE::ColorImage & cimg,
  82. NICE::VVector & positions,
  83. NICE::VVector & descriptors ) const;
  84. ///////////////////// INTERFACE PERSISTENT /////////////////////
  85. // interface specific methods for store and restore
  86. ///////////////////// INTERFACE PERSISTENT /////////////////////
  87. /**
  88. * @brief Load object from external file (stream)
  89. * @author Alexander Freytag
  90. * @date 09-02-2014 ( dd-mmyyyy)
  91. */
  92. virtual void restore ( std::istream & is, int format = 0 );
  93. /**
  94. * @brief Save object to external file (stream)
  95. * @author Alexander Freytag
  96. * @date 09-02-2014 ( dd-mmyyyy)
  97. */
  98. virtual void store( std::ostream & os, int format = 0 ) const;
  99. /**
  100. * @brief Clear object
  101. * @author Alexander Freytag
  102. * @date 09-02-2014 ( dd-mmyyyy)
  103. */
  104. virtual void clear ();
  105. };
  106. } // namespace
  107. #endif