12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /**
- * @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 <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- /** NICE includes **/
- #include <core/image/Convert.h>
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/image/ImageT.h"
- #include <core/basics/Config.h>
- #include <core/vector/VVector.h>
- /** LocalFeature*-header includes **/
- #include "LocalFeatureRepresentation.h"
- #include "GenericLocalFeatureSelection.h"
- /** STRINGTOOLS **/
- /** 1) boost **/
- #ifdef NICE_USELIB_BOOST
- #include <boost/tokenizer.hpp>
- /** 2) NICE (standard) **/
- #else
- #include <core/basics/StringTools.h>
- #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 <float> 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
|