123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- #ifndef FCCODEBOOKHISTBININCLUDE
- #define FCCODEBOOKHISTBININCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/basics/Config.h"
- #include "vislearning/features/fbase/FeatureFactory.h"
- #include "vislearning/features/localfeatures/LocalFeatureRepresentation.h"
- #include "Codebook.h"
- namespace OBJREC {
- class FCCodebookHistBin : public FeatureFactory
- {
- protected:
-
- int n_method;
-
- const LocalFeatureRepresentation *lfrep;
-
- const Codebook *codebook;
- void calcHistogram ( const NICE::VVector & features,
- NICE::Vector & histogram );
- void calcHistogram ( const NICE::VVector & features,
- NICE::Vector & histogram,
- NICE::Matrix & assignments);
- void normalizeHistogram ( NICE::Vector & histogram );
- public:
-
- enum {
- NORMALIZE_RAW = 0,
- NORMALIZE_BINZERO,
- NORMALIZE_SUM,
- NORMALIZE_THRESH
- };
-
- FCCodebookHistBin( const NICE::Config *conf,
- const LocalFeatureRepresentation *lfrep,
- const std::string & normalizationMethod,
- const Codebook *codebook );
-
-
- virtual ~FCCodebookHistBin();
-
-
- int convert ( const NICE::Image & img, NICE::Vector & vec );
-
-
- int calcAssignments ( const NICE::VVector & features, NICE::Vector & vec, NICE::Matrix & assignments );
-
- void setNormalizationMethod ( int normalizationMethod );
-
- int getNormalizationMethod () const;
-
- };
- }
- #endif
|