LocalFeatureSift.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * @file LocalFeatureSift.h
  3. * @brief local feature with sift (without detector)
  4. * @author Erik Rodner
  5. * @date 02/05/2008
  6. */
  7. #ifndef LOCALFEATURESIFTINCLUDE
  8. #define LOCALFEATURESIFTINCLUDE
  9. #include "core/vector/VectorT.h"
  10. #include "core/vector/MatrixT.h"
  11. #include "core/image/ImageT.h"
  12. #include "core/imagedisplay/ImageDisplay.h"
  13. #include "core/basics/Config.h"
  14. #include "LocalFeature.h"
  15. namespace OBJREC {
  16. /** local feature with sift */
  17. class LocalFeatureSift : public LocalFeature
  18. {
  19. protected:
  20. int octaves;
  21. int levels;
  22. bool normalizeFeature;
  23. int first_octave;
  24. double magnif;
  25. bool deletemode;
  26. bool integerValues;
  27. float threshold;
  28. float edgeThreshold;
  29. public:
  30. /** simple constructor */
  31. LocalFeatureSift ( const NICE::Config *conf );
  32. /** simple destructor */
  33. virtual ~LocalFeatureSift();
  34. /**
  35. * returns the size of each the SIFT-Feature
  36. * @return 128
  37. */
  38. int getDescSize() const { return 128; };
  39. /**
  40. * get the descriptor
  41. * @param img input image
  42. * @param positions positions for the SIFT features
  43. * @param descriptors output
  44. * @return 0
  45. */
  46. virtual int getDescriptors ( const NICE::Image & img,
  47. NICE::VVector & positions,
  48. NICE::VVector & descriptors ) const;
  49. /**
  50. * computes the descriptor for a single image
  51. * @param img
  52. * @param positions
  53. * @param descriptors
  54. */
  55. void computeDesc( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
  56. /**
  57. * sort positions by scales for faster computing of the Keypoint orientation
  58. * @param positions
  59. */
  60. void sortPositions(NICE::VVector & positions) const;
  61. void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const;
  62. };
  63. } // namespace
  64. #endif