Quantization1DAequiDist0ToMax.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * @file Quantization1DAequiDist0ToMax.h
  3. * @brief Quantization of one-dimensional signals with selectable interval [0, vMax] (Interface)
  4. * @author Alexander Freytag
  5. * @date 13-10-2015 ( dd-mm-yyyy )
  6. */
  7. #ifndef _NICE_QUANTIZATION1DAEQUIDIST0TOMAXINCLUDE
  8. #define _NICE_QUANTIZATION1DAEQUIDIST0TOMAXINCLUDE
  9. // NICE-core includes
  10. #include <core/basics/types.h>
  11. #include <core/basics/Persistent.h>
  12. #include "gp-hik-core/quantization/Quantization.h"
  13. namespace NICE {
  14. /** Quantization1DAequiDist0ToMax
  15. * @class Quantization
  16. * @brief Quantization of one-dimensional signals with selectable interval [0, vMax]
  17. * @author Alexander Freytag
  18. */
  19. class Quantization1DAequiDist0ToMax : public NICE::Quantization
  20. {
  21. /** TODO
  22. * The current implementation only provides uniform quantization. We could extend this
  23. * by giving a ParameterizedFunction object to the constructor, which would allow us to inverse transform function values
  24. * before performing the binning.
  25. */
  26. protected:
  27. public:
  28. /**
  29. * @brief default constructor
  30. * @author Alexander Freytag
  31. * @date 06-02-2014
  32. */
  33. Quantization1DAequiDist0ToMax( );
  34. /**
  35. * @brief simple constructor
  36. * @author Erik Rodner
  37. * @date
  38. */
  39. Quantization1DAequiDist0ToMax( uint _numBins,
  40. NICE::Vector * v_upperBounds = NULL
  41. );
  42. /** simple destructor */
  43. virtual ~Quantization1DAequiDist0ToMax();
  44. /**
  45. * @brief get specific word or prototype element of the quantization
  46. *
  47. * @param bin the index of the bin
  48. *
  49. * @return value of the prototype
  50. */
  51. virtual double getPrototype ( uint _bin,
  52. const uint & _dim = 0
  53. ) const;
  54. /**
  55. * @brief Determine for a given signal value the bin in the vocabulary. This is not the corresponding prototype, which
  56. * has to be requested with getPrototype afterwards
  57. *
  58. * @param value signal function value
  59. *
  60. * @return index of the bin entry corresponding to the given signal value
  61. */
  62. virtual uint quantize ( double _value,
  63. const uint & _dim = 0
  64. ) const;
  65. virtual void computeParametersFromData ( const NICE::FeatureMatrix * _fm ) ;
  66. ///////////////////// INTERFACE PERSISTENT /////////////////////
  67. // interface specific methods for store and restore
  68. ///////////////////// INTERFACE PERSISTENT /////////////////////
  69. virtual void restore ( std::istream & _is,
  70. int _format = 0
  71. );
  72. virtual void store ( std::ostream & _os,
  73. int _format = 0
  74. ) const;
  75. virtual void clear () {};
  76. };
  77. }
  78. #endif