1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /**
- * @file LFPatches.h
- * @brief simple patch based approach
- * @author Erik Rodner
- * @date 02/06/2008
- */
- #ifndef LFPATCHESINCLUDE
- #define LFPATCHESINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/image/ImageT.h"
- #include "core/basics/Config.h"
- #include "vislearning/image/ImagePyramid.h"
- #include "LocalFeatureRepresentation.h"
- #include "vislearning/features/localfeatures/InterestDetector.h"
- namespace OBJREC
- {
- /** simple patch based approach */
- class LFPatches: public LocalFeatureRepresentation
- {
- protected:
- enum
- {
- NORMALIZE_N01 = 0, NORMALIZE_NONE, NORMALIZE_STDDEV, NORMALIZE_MEAN
- };
- int xsize;
- int ysize;
- int normalization;
- std::auto_ptr<InterestDetector> id;
- int maxLevels;
- double scaleSpacing;
- int detectormode;
- int numPatches;
- void calcDescriptors(const ImagePyramid & imp, NICE::VVector & positions,
- NICE::VVector & features) const;
- public:
- /** simple constructor */
- LFPatches(const NICE::Config *conf, int numPatches);
- /** simple destructor */
- virtual ~LFPatches();
- int getDescSize() const;
- int extractFeatures(const NICE::Image & img, NICE::VVector & features,
- NICE::VVector & positions) const;
- void correctPositions(const ImagePyramid & imp, NICE::VVector & positions,
- NICE::VVector & positions_corrected) const;
- void visualize(NICE::Image & img, const NICE::Vector & feature) const;
- void visualizeFeatures(NICE::Image & mark, const NICE::VVector & positions,
- size_t color) const;
- //DIRTY for bofCreationSingleImage
- int calcDescriptor(const ImagePyramid & imp, const NICE::Vector & position,
- NICE::Vector & desc) const;
-
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- // interface specific methods for store and restore
- ///////////////////// INTERFACE PERSISTENT /////////////////////
-
- /**
- * @brief Load object from external file (stream)
- * @author Alexander Freytag
- * @date 10-02-2014 ( dd-mmyyyy)
- */
- virtual void restore ( std::istream & is, int format = 0 );
-
- /**
- * @brief Save object to external file (stream)
- * @author Alexander Freytag
- * @date 10-02-2014 ( dd-mmyyyy)
- */
- virtual void store( std::ostream & os, int format = 0 ) const;
-
- /**
- * @brief Clear object
- * @author Alexander Freytag
- * @date 10-02-2014 ( dd-mmyyyy)
- */
- virtual void clear ();
- };
- } // namespace
- #endif
|