LFSiftPP.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. * @file LFSiftPP.h
  3. * @brief Sift++ interface (with detector!)
  4. * @author Erik Rodner, Alexander Freytag
  5. * @date 11/19/2007
  6. */
  7. #ifndef LFSIFTPPINCLUDE
  8. #define LFSIFTPPINCLUDE
  9. // nice-core includes
  10. #include <core/basics/Config.h>
  11. //
  12. #include <core/image/ImageT.h>
  13. //
  14. #include <core/imagedisplay/ImageDisplay.h>
  15. //
  16. #include <core/vector/VectorT.h>
  17. #include <core/vector/MatrixT.h>
  18. // nice-vislearning includes
  19. #include "LocalFeatureRepresentation.h"
  20. namespace OBJREC {
  21. /** Sift++ interface */
  22. class LFSiftPP : public LocalFeatureRepresentation
  23. {
  24. protected:
  25. /////////////////////////
  26. /////////////////////////
  27. // PROTECTED VARIABLES //
  28. /////////////////////////
  29. /////////////////////////
  30. enum DESCRIPTORALIGNMENT{
  31. DALGIN_DETECTOR = 0,
  32. DALIGN_MULTIPLE
  33. };
  34. DESCRIPTORALIGNMENT descriptorAlignment;
  35. double minScale;
  36. double maxScale;
  37. int numScales;
  38. int numAngles;
  39. float threshold;
  40. float edgeThreshold;
  41. int levels;
  42. int octaves;
  43. int first_octave;
  44. bool normalizeFeature;
  45. public:
  46. ///////////////////// ///////////////////// /////////////////////
  47. // CONSTRUCTORS / DESTRUCTORS
  48. ///////////////////// ///////////////////// /////////////////////
  49. /**
  50. * @brief default constructor
  51. * @date 10-02-2014 (dd-mm-yyyy )
  52. * @author Alexander Freytag
  53. */
  54. LFSiftPP ( );
  55. /**
  56. * @brief simple constructor
  57. */
  58. LFSiftPP( const NICE::Config *conf );
  59. /**
  60. * @brief simple destructor
  61. */
  62. virtual ~LFSiftPP();
  63. /**
  64. * @brief Jobs previously performed in the config-version of the constructor, read settings etc.
  65. * @author Alexander Freytag
  66. * @date 10-02-2014 ( dd-mm-yyyy )
  67. */
  68. void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "LFSiftPP");
  69. ///////////////////// ///////////////////// /////////////////////
  70. // FEATURE STUFF
  71. ///////////////////// ///////////////////// //////////////////
  72. int getDescSize () const;
  73. int extractFeatures ( const NICE::Image & img, NICE::VVector & features,
  74. NICE::VVector & positions ) const;
  75. void visualizeFeatures ( NICE::Image & mark,
  76. const NICE::VVector & positions,
  77. size_t color ) const;
  78. ///////////////////// INTERFACE PERSISTENT /////////////////////
  79. // interface specific methods for store and restore
  80. ///////////////////// INTERFACE PERSISTENT /////////////////////
  81. /**
  82. * @brief Load object from external file (stream)
  83. * @author Alexander Freytag
  84. * @date 09-02-2014 ( dd-mmyyyy)
  85. */
  86. virtual void restore ( std::istream & is, int format = 0 );
  87. /**
  88. * @brief Save object to external file (stream)
  89. * @author Alexander Freytag
  90. * @date 09-02-2014 ( dd-mmyyyy)
  91. */
  92. virtual void store( std::ostream & os, int format = 0 ) const;
  93. /**
  94. * @brief Clear object
  95. * @author Alexander Freytag
  96. * @date 09-02-2014 ( dd-mmyyyy)
  97. */
  98. virtual void clear ();
  99. };
  100. } // namespace
  101. #endif