LFonHSG.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. * @file LFonHSG.h
  3. * @brief This class can be used to calculate the positions of keyfeatures in a Honeyrate Structure Grid (HSG). Also the class call the normal getDescriptors methode from a given type of LocalFeature.
  4. * @author Eric Bach, Alexander Freytag
  5. * @date 26-10-2011 (dd-mm-yyyy)
  6. */
  7. #ifndef LFonHSGINCLUDE
  8. #define LFonHSGINCLUDE
  9. /** standard includes **/
  10. #include <iostream>
  11. #include <sstream>
  12. #include <string>
  13. #include <vector>
  14. /** NICE includes **/
  15. #include <core/basics/Config.h>
  16. //
  17. #include <core/image/Convert.h>
  18. #include <core/image/ImageT.h>
  19. //
  20. #include <core/vector/VectorT.h>
  21. #include <core/vector/MatrixT.h>
  22. #include <core/vector/VVector.h>
  23. /** LocalFeature*-header includes **/
  24. #include "LocalFeatureRepresentation.h"
  25. #include "GenericLocalFeatureSelection.h"
  26. /** STRINGTOOLS **/
  27. /** 1) boost **/
  28. #ifdef NICE_USELIB_BOOST
  29. #include <boost/tokenizer.hpp>
  30. /** 2) NICE (standard) **/
  31. #else
  32. #include <core/basics/StringTools.h>
  33. #endif
  34. namespace OBJREC
  35. {
  36. class LFonHSG : public LocalFeatureRepresentation
  37. {
  38. /* private member */
  39. private:
  40. /* parameter for the grid */
  41. //! stepwidhts of the grid
  42. int sampleScaling;
  43. //! which scales should be used
  44. std::string scales;
  45. //! vector which save the different scales
  46. std::vector <float> scalesV;
  47. //! if true, print some log-output
  48. bool debug;
  49. //! the descriptor instance
  50. OBJREC::LocalFeature* lf;
  51. /** Calculate the keypoint-positions by given imagesize, sample-spacing and scales.
  52. @brief The methode returns the calculated positions on a honeyrate-grid. This
  53. positions starts with (0;0).
  54. @param[in] unsigned int imageWidth - width (x) of the given image
  55. @param[in] unsigned int imageHeight - heigth (y) of the given image
  56. @param[in,out] NICE::VVector positions - destination for the calculated positions
  57. **/
  58. void getPositionsOnHSG ( const unsigned int imageWidth,
  59. const unsigned int imageHeight,
  60. NICE::VVector& positions ) const;
  61. /* public member */
  62. public:
  63. //! simple contructor
  64. LFonHSG ( const NICE::Config *conf, const std::string section = "HSG" );
  65. //! simple desctructor
  66. ~LFonHSG();
  67. //! Returns the descriptorsize
  68. int getDescSize() const;
  69. //! Extract the descriptor-Values from a given grayscale-Image.
  70. int extractFeatures ( const NICE::Image & img, NICE::VVector & features, NICE::VVector & positions ) const;
  71. //! Extract the descriptor-Values from a given color-Image.
  72. int extractFeatures ( const NICE::ColorImage & cimg, NICE::VVector & features, NICE::VVector & positions ) const;
  73. //! Visualisierung
  74. void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const;
  75. };
  76. }
  77. #endif