LFColorSande.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**
  2. * @file LFColorSande.h
  3. * @brief interface to ColorSande implementation
  4. * @author Erik Rodner, Alexander Freytag
  5. * @date 11/19/2007
  6. */
  7. #ifndef LFColorSandeINCLUDE
  8. #define LFColorSandeINCLUDE
  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 "LocalFeatureRepresentation.h"
  18. namespace OBJREC {
  19. /** interface to ColorSande implementation */
  20. class LFColorSande : public LocalFeatureRepresentation
  21. {
  22. protected:
  23. /////////////////////////
  24. /////////////////////////
  25. // PROTECTED VARIABLES //
  26. /////////////////////////
  27. /////////////////////////
  28. std::string c_binaryExecutable;
  29. std::string c_params;
  30. //! used scales
  31. std::string scales;
  32. //! size of the descriptor
  33. int descriptor_size;
  34. //! use grid for SIFT Positions
  35. bool usegrid;
  36. //! size of the grid
  37. std::string gridsize;
  38. // double c_minScale;
  39. public:
  40. ///////////////////// ///////////////////// /////////////////////
  41. // CONSTRUCTORS / DESTRUCTORS
  42. ///////////////////// ///////////////////// /////////////////////
  43. /**
  44. * @brief default constructor
  45. * @date 10-02-2014 (dd-mm-yyyy )
  46. * @author Alexander Freytag
  47. */
  48. LFColorSande ( );
  49. /**
  50. * @brief simple constructor
  51. */
  52. LFColorSande ( const NICE::Config * _conf, std::string _confSection = "LFColorSande" );
  53. /** simple destructor */
  54. virtual ~LFColorSande();
  55. /**
  56. * @brief Jobs previously performed in the config-version of the constructor, read settings etc.
  57. * @author Alexander Freytag
  58. * @date 10-02-2014 ( dd-mm-yyyy )
  59. */
  60. void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "LFColorSande");
  61. ///////////////////// ///////////////////// /////////////////////
  62. // FEATURE STUFF
  63. ///////////////////// ///////////////////// //////////////////
  64. int getDescSize () const;
  65. /**
  66. * get the colorSIFT features
  67. * @param img grayvalue input image
  68. * @param features features (output)
  69. * @param positions position of the features
  70. * @return
  71. */
  72. int extractFeatures ( const NICE::Image & img, NICE::VVector & features,
  73. NICE::VVector & positions ) const;
  74. /**
  75. * get the colorSIFT features
  76. * @param img color input image
  77. * @param features features (output)
  78. * @param positions position of the features
  79. * @return
  80. */
  81. int extractFeatures ( const NICE::ColorImage & img, NICE::VVector & features,
  82. NICE::VVector & positions ) const;
  83. ///////////////////// INTERFACE PERSISTENT /////////////////////
  84. // interface specific methods for store and restore
  85. ///////////////////// INTERFACE PERSISTENT /////////////////////
  86. /**
  87. * @brief Load object from external file (stream)
  88. * @author Alexander Freytag
  89. * @date 10-02-2014 ( dd-mmyyyy)
  90. */
  91. virtual void restore ( std::istream & is, int format = 0 );
  92. /**
  93. * @brief Save object to external file (stream)
  94. * @author Alexander Freytag
  95. * @date 10-02-2014 ( dd-mmyyyy)
  96. */
  97. virtual void store( std::ostream & os, int format = 0 ) const;
  98. /**
  99. * @brief Clear object
  100. * @author Alexander Freytag
  101. * @date 10-02-2014 ( dd-mmyyyy)
  102. */
  103. virtual void clear ();
  104. };
  105. } // namespace
  106. #endif