/** * @file Centrist.h * @brief Implementation of the Centrist feature published in "CENTRIST: A Visual Descriptor for Scene Categorization" (PAMI 2011) * @author Alexander Lütz * @date 12/06/2011 */ #ifndef CENTRISTINCLUDE #define CENTRISTINCLUDE #include "core/vector/VectorT.h" #include "core/vector/MatrixT.h" #include "core/image/ImageT.h" #include "core/vector/VVector.h" #include "LocalFeature.h" #include "core/basics/Config.h" namespace OBJREC { /** interface to CENTRIST implementation*/ class Centrist : public LocalFeature { protected: int sizeNeighborhood; int CensusTransform(const NICE::Image & img, const int & x, const int & y); int CensusTransform(const NICE::ColorImage & img, const int & x, const int & y, const int & channel); void GenerateHistForOneRect(const NICE::Image & img, const int & xi, const int & xa, const int & yi, const int & ya, NICE::Vector & feature); void GenerateHistForOneRect(const NICE::ColorImage & img, const int & xi, const int & xa, const int & yi, const int & ya, NICE::Vector & feature); void computeDesc( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ); void computeDesc( const NICE::ColorImage & img, NICE::VVector & positions, NICE::VVector & descriptors ); public: /** simple constructor */ Centrist(); /** default constructor */ Centrist(const NICE::Config *conf, const std::string & section="CENTRIST"); /** simple destructor */ virtual ~Centrist(); // we have 8 neighbors, so the size is always 256 with the given implementation (without spatial levels, ...) /** Beware: multiply this number by the number of channels you use in your color image*/ int getDescSize(){return 256;}; int getDescriptors ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors); int getDescriptors ( const NICE::ColorImage & img, NICE::VVector & positions, NICE::VVector & descriptors); void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const; }; } // namespace #endif