12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /**
- * @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 "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
|