Quantization.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @file Quantization.h
  3. * @brief Quantization of one-dimensional signals with a standard range of [0,1] (Interface)
  4. * @author Erik Rodner
  5. * @date 01/09/2012
  6. */
  7. #ifndef _NICE_QUANTIZATIONINCLUDE
  8. #define _NICE_QUANTIZATIONINCLUDE
  9. #include <core/basics/types.h>
  10. namespace NICE {
  11. /**
  12. * @class Quantization
  13. * @brief Quantization of one-dimensional signals with a standard range of [0,1]
  14. * @author Erik Rodner
  15. */
  16. class Quantization
  17. {
  18. /** TODO
  19. * The current implementation only provides uniform quantization. We could extend this
  20. * by giving a ParameterizedFunction object to the constructor, which would allow us to inverse transform function values
  21. * before performing the binning.
  22. */
  23. protected:
  24. uint numBins;
  25. public:
  26. /** simple constructor */
  27. Quantization( uint numBins );
  28. /** simple destructor */
  29. virtual ~Quantization();
  30. /**
  31. * @brief get the size of the vocabulary, i.e. the number of bins
  32. */
  33. virtual uint size() const;
  34. /**
  35. * @brief get specific word or prototype element of the quantization
  36. *
  37. * @param bin the index of the bin
  38. *
  39. * @return value of the prototype
  40. */
  41. virtual double getPrototype (uint bin) const;
  42. /**
  43. * @brief Determine for a given signal value the bin in the vocabulary. This is not the corresponding prototype, which
  44. * has to be requested with getPrototype afterwards
  45. *
  46. * @param value signal function value
  47. *
  48. * @return index of the bin entry corresponding to the given signal value
  49. */
  50. virtual uint quantize (double value) const;
  51. };
  52. }
  53. #endif