|
@@ -10,6 +10,8 @@
|
|
// NICE-core includes
|
|
// NICE-core includes
|
|
#include <core/basics/types.h>
|
|
#include <core/basics/types.h>
|
|
#include <core/basics/Persistent.h>
|
|
#include <core/basics/Persistent.h>
|
|
|
|
+//
|
|
|
|
+#include <core/vector/VectorT.h>
|
|
|
|
|
|
namespace NICE {
|
|
namespace NICE {
|
|
|
|
|
|
@@ -31,6 +33,12 @@ class Quantization : public NICE::Persistent
|
|
protected:
|
|
protected:
|
|
|
|
|
|
uint ui_numBins;
|
|
uint ui_numBins;
|
|
|
|
+
|
|
|
|
+ // NOTE: we do not need lower bounds,
|
|
|
|
+ // since our features are required to be non-negative
|
|
|
|
+ // (for applying the HIK as kernel function)
|
|
|
|
+ NICE::Vector v_upperBounds;
|
|
|
|
+
|
|
|
|
|
|
public:
|
|
public:
|
|
|
|
|
|
@@ -47,8 +55,10 @@ class Quantization : public NICE::Persistent
|
|
* @author Erik Rodner
|
|
* @author Erik Rodner
|
|
* @date
|
|
* @date
|
|
*/
|
|
*/
|
|
- Quantization( uint _numBins );
|
|
|
|
-
|
|
|
|
|
|
+ Quantization( uint _numBins,
|
|
|
|
+ NICE::Vector * v_upperBounds = NULL
|
|
|
|
+ );
|
|
|
|
+
|
|
/** simple destructor */
|
|
/** simple destructor */
|
|
virtual ~Quantization();
|
|
virtual ~Quantization();
|
|
|
|
|
|
@@ -56,6 +66,7 @@ class Quantization : public NICE::Persistent
|
|
* @brief get the size of the vocabulary, i.e. the number of bins
|
|
* @brief get the size of the vocabulary, i.e. the number of bins
|
|
*/
|
|
*/
|
|
virtual uint size() const;
|
|
virtual uint size() const;
|
|
|
|
+ virtual uint getNumberOfBins() const;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @brief get specific word or prototype element of the quantization
|
|
* @brief get specific word or prototype element of the quantization
|
|
@@ -64,7 +75,7 @@ class Quantization : public NICE::Persistent
|
|
*
|
|
*
|
|
* @return value of the prototype
|
|
* @return value of the prototype
|
|
*/
|
|
*/
|
|
- virtual double getPrototype (uint _bin) const;
|
|
|
|
|
|
+ virtual double getPrototype (uint _bin) const = 0;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @brief Determine for a given signal value the bin in the vocabulary. This is not the corresponding prototype, which
|
|
* @brief Determine for a given signal value the bin in the vocabulary. This is not the corresponding prototype, which
|
|
@@ -74,7 +85,9 @@ class Quantization : public NICE::Persistent
|
|
*
|
|
*
|
|
* @return index of the bin entry corresponding to the given signal value
|
|
* @return index of the bin entry corresponding to the given signal value
|
|
*/
|
|
*/
|
|
- virtual uint quantize (double _value) const;
|
|
|
|
|
|
+ virtual uint quantize ( double _value,
|
|
|
|
+ const uint & _dim
|
|
|
|
+ ) const = 0;
|
|
|
|
|
|
///////////////////// INTERFACE PERSISTENT /////////////////////
|
|
///////////////////// INTERFACE PERSISTENT /////////////////////
|
|
// interface specific methods for store and restore
|
|
// interface specific methods for store and restore
|