GaussPyramid.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * NICE-Core - efficient algebra and computer vision methods
  3. * - libimage - An image library
  4. * See file License for license information.
  5. */
  6. #ifndef LIMUN_GAUSSSPYRAMID_H
  7. #define LIMUN_GAUSSSPYRAMID_H
  8. #include "core/image/ColorImageT.h"
  9. #include "core/image/ImageT.h"
  10. #include <vector>
  11. namespace NICE {
  12. /**
  13. * This class builds a Gaussian resolution hierarchy (pyramid)
  14. * of an input image.
  15. */
  16. class GaussPyramid
  17. {
  18. private:
  19. float rate;
  20. IppiPyramid *gPyramid;
  21. IppiPyramid *lPyramid;
  22. std::vector<FloatImage> gaussimage;
  23. std::vector<FloatImage> laplaceimage;
  24. void buildGaussPyramid(uint levelin, float rate);
  25. public:
  26. //! Constructor for fixed number of levels
  27. /*! \param src Input gray image, also the toplevel image
  28. * \param levelin number of pyramid levels you wish to add
  29. * \param rate sampling rate {1.5,2.0}
  30. */
  31. GaussPyramid(const Image& src, uint levelin, float rate);
  32. //! Constructor for fixed number of levels
  33. /*! \param src Input float image, also the toplevel image
  34. * \param levelin number of pyramid levels you wish to add
  35. * \param rate sampling rate {1.5,2.0}
  36. */
  37. GaussPyramid(const FloatImage& src, uint levelin, float rate);
  38. //! Constructor for fixed size of the smallest image
  39. /*! \param src Input gray image, also the toplevel image
  40. * \param sizeMinX width of the smallest image
  41. * \param sizeMinY height of the smallest image
  42. * \param rate sampling rate {1.5,2.0}
  43. */
  44. GaussPyramid(const Image& src, uint sizeMinX, uint sizeMinY, float rate);
  45. //! Constructor for fixed size of the smallest image
  46. /*! \param src Input float image, also the toplevel image
  47. * \param sizeMinX width of the smallest image
  48. * \param sizeMinY height of the smallest image
  49. * \param rate sampling rate {1.5,2.0}
  50. */
  51. GaussPyramid(const FloatImage& src, uint sizeMinX, uint sizeMinY, float rate);
  52. //! Destructor of GaussPyramid
  53. ~GaussPyramid();
  54. //! Return const gauss image on level nr as FloatImage
  55. /*! \param nr the level
  56. * \return gauss image on level nr
  57. */
  58. const FloatImage &getGauss(uint nr) const;
  59. //! Return const gauss image on level nr as Image
  60. /*! \param nr the level
  61. * \return gauss image on level nr
  62. */
  63. Image getGaussGray(uint nr) const;
  64. //! Return const laplace image on level nr
  65. /*! \param nr the level
  66. * \return laplace image on level nr
  67. */
  68. const FloatImage &getLaplace(uint nr) const;
  69. //! Return number of levels
  70. /*! \return number of levels
  71. */
  72. int getLevel() const {return gPyramid->level+1;}
  73. //! Translate the coordinates of the gauss level to the original coordinates.
  74. Coord CoordOrig(int level, const Coord &coord);
  75. //! Translate the coordinates of the original coordinates to the gauss level.
  76. Coord CoordLevel(int level, const Coord &coord);
  77. //! Translate the coordinates one level up.
  78. Coord CoordUp(int level, const Coord &coord);
  79. //! Translate the coordinates one level down.
  80. Coord CoordDown(int level, const Coord &coord);
  81. //! Find local minima and maxima
  82. //void FindLocalDOGMaxMin(std::vector<) const
  83. };
  84. }// namespace
  85. #endif //LIMUN_GAUSSSPYRAMID_H