| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /**
- * @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
- #ifdef NOVISUAL
- #include <vislearning/nice_nonvis.h>
- #else
- #include <vislearning/nice.h>
- #endif
- #include "vislearning/math/mathbase/VVector.h"
- #include "LocalFeature.h"
- #include "vislearning/baselib/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, OBJREC::VVector & positions, OBJREC::VVector & descriptors );
- void computeDesc( const NICE::ColorImage & img, OBJREC::VVector & positions, OBJREC::VVector & descriptors );
- public:
-
- /** simple constructor */
- Centrist();
- /** default constructor */
- Centrist(const 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, ...)
- int getDescSize(){return 256;};
- int getDescriptors ( const NICE::Image & img, OBJREC::VVector & positions, OBJREC::VVector & descriptors);
-
- int getDescriptors ( const NICE::ColorImage & img, OBJREC::VVector & positions, OBJREC::VVector & descriptors);
-
- void visualizeFeatures ( NICE::Image & mark,
- const VVector & positions,
- size_t color ) const;
-
- };
- } // namespace
- #endif
|