12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- /**
- * @file LFGenericLocal.cpp
- * @brief generic local features
- * @author Erik Rodner
- * @date 02/05/2008
- */
- #include <iostream>
- #include <sstream>
- #include "vislearning/features/localfeatures/LFGenericLocal.h"
- #include "vislearning/features/localfeatures/LocalFeatureSift.h"
- #include "vislearning/features/localfeatures/IDRandomSampling.h"
- using namespace OBJREC;
- using namespace std;
- using namespace NICE;
- LFGenericLocal::LFGenericLocal( const Config *conf, int numFeatures )
- {
- lf = new LocalFeatureSift(conf);
- id = new IDRandomSampling(conf, numFeatures);
- }
- LFGenericLocal::~LFGenericLocal()
- {
- delete lf;
- }
- int LFGenericLocal::getDescSize () const
- {
- return lf->getDescSize();
- }
- int LFGenericLocal::extractFeatures ( const NICE::Image & img,
- VVector & features,
- VVector & positions ) const
- {
- id->getInterests ( img, positions );
- lf->getDescriptors ( img, positions, features );
- return 0;
- }
- void LFGenericLocal::visualizeFeatures ( NICE::Image & mark,
- const VVector & positions,
- size_t color ) const
- {
- lf->visualizeFeatures ( mark, positions, color );
- }
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- // interface specific methods for store and restore
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- void LFGenericLocal::restore ( std::istream & is, int format )
- {
- fthrow ( Exception, "LFGenericLocal::restore not implemented yet." );
- //TODO
- }
- void LFGenericLocal::store ( std::ostream & os, int format ) const
- {
- fthrow ( Exception, "LFGenericLocal::store not implemented yet." );
- //TODO
- }
- void LFGenericLocal::clear ()
- {
- fthrow ( Exception, "LFGenericLocal::clear not implemented yet." );
- //TODO
- }
|