/** * @file LFonHSG.h * @brief This class can be used to calculate the positions of keyfeatures in a Honeyrate Structure Grid (HSG). Also the class call the normal getDescriptors methode from a given type of SIFT. * @author Eric Bach * @date 26.10.2011 */ #ifndef LFonHSGINCLUDE #define LFonHSGINCLUDE /** standard includes **/ #include #include #include #include /** NICE includes **/ #include #include "core/vector/VectorT.h" #include "core/vector/MatrixT.h" #include "core/image/ImageT.h" #include #include /** LocalFeature*-header includes **/ #include "LocalFeatureRepresentation.h" #include "GenericLocalFeatureSelection.h" /** STRINGTOOLS **/ /** 1) boost **/ #ifdef NICE_USELIB_BOOST #include /** 2) NICE (standard) **/ #else #include #endif namespace OBJREC { class LFonHSG : public LocalFeatureRepresentation { /* private member */ private: /* parameter for the grid */ //! stepwidhts of the grid int sampleScaling; //! which scales should be used std::string scales; //! vector which save the different scales std::vector scalesV; /** Calculate the keypoint-positions by given imagesize, sample-spacing and scales. @brief The methode returns the calculated positions on a honeyrate-grid. This positions starts with (0;0). @param[in] unsigned int imageWidth - width (x) of the given image @param[in] unsigned int imageHeight - heigth (y) of the given image @param[in,out] NICE::VVector positions - destination for the calculated positions **/ void getPositionsOnHSG ( const unsigned int imageWidth, const unsigned int imageHeight, NICE::VVector& positions ) const; //! simple methode to convert a string into float float strToFloat ( const std::string str ) const; //! if true, print some log-output bool debug; //! the descritor instanz LocalFeature* lf; /* public member */ public: //! simple contructor LFonHSG ( const NICE::Config *conf, const std::string section = "HSG" ); //! simple desctructor ~LFonHSG(); //! Returns the descriptorsize int getDescSize() const { return lf->getDescSize(); }; //! Extract the descriptor-Values from a given grayscale-Image. int extractFeatures ( const NICE::Image & img, NICE::VVector & features, NICE::VVector & positions ) const; //! Extract the descriptor-Values from a given color-Image. int extractFeatures ( const NICE::ColorImage & cimg, NICE::VVector & features, NICE::VVector & positions ) const; //! Visualisierung void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const; }; } #endif