1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #ifndef _NICE_OBJREC_PHOGFEATUREINCLUDE
- #define _NICE_OBJREC_PHOGFEATUREINCLUDE
- #include "core/basics/Config.h"
- #include "Image_tools.h"
- namespace OBJREC {
-
- class PHOGFeature
- {
- public:
- enum Histrogram_concatenation{NONE=0, LEVELWISE=1, ALL=2};
- protected:
-
- Image_tools image_tool;
- int number_Of_Bins;
- bool unsignedBins;
- int number_of_Levels;
- bool like_AnnaBosch;
- bool distances_only_between_levels;
- Histrogram_concatenation histrogram_concatenation;
- bool verbose;
-
- void calculate_PHOG_Pyramide(const NICE::Image & gradient_orientations, const NICE::ImageT<float> & gradient_magnitudes,std::vector< std::vector<float> > & PHOG_descriptor);
-
- std::vector< std::vector<float> > calculate_PHOG_Features(const NICE::Image & orig_Image, const NICE::Rect & roi);
- public:
- PHOGFeature();
-
- PHOGFeature( const NICE::Config *conf, std::string section = "PHOGFeature");
-
- virtual ~PHOGFeature();
- std::vector< std::vector<float> > createOneFeatureVector(const std::string & imgfilename, const NICE::Rect & ROI);
- std::vector< std::vector<float> > createOneFeatureVector(const NICE::Image img, const NICE::Rect & ROI);
- std::vector< std::vector<float> > createOneFeatureVector(const std::string & imgfilename);
- std::vector< std::vector<float> > createOneFeatureVector(const NICE::Image img);
-
- std::vector< std::vector<float> > createOneFeatureVectorDirect(NICE::Image & gradient_orientations, NICE::ImageT<float> & gradient_magnitudes, const NICE::Rect & ROI);
- std::vector< std::vector<float> > createOneFeatureVectorDirect(NICE::Image & gradient_orientations, NICE::ImageT<float> & gradient_magnitudes);
- NICE::Image calculate_gradient_orientations(const std::string & imgfilename);
- NICE::ImageT<float> calculate_gradient_magnitudes(const std::string & imgfilename);
-
- void calculate_Kernel_from_Features(const std::vector<std::vector< std::vector<float> > > & PHoG_Features, NICE::Matrix & PHoG_Kernel);
- virtual double measureDistance ( const std::vector< std::vector<float> > & a, const std::vector< std::vector<float> > & b );
- virtual void sayYourName() {std::cerr << "I'm the PHOG-Feature." << std::endl;};
- void set_verbose(const bool & new_verbose);
- void set_histrogram_concatenation(const Histrogram_concatenation & _histrogram_concatenation){histrogram_concatenation = _histrogram_concatenation;};
- };
- }
- #endif
|