1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /**
- * @file FCBagSift.cpp
- * @brief Feature Factory for Bag of SIFT Features
- * @author Erik Rodner
- * @date 10/25/2007
- */
- #include <iostream>
- #include "vislearning/math/cluster/GSCluster.h"
- #include "vislearning/features/simplefeatures/FCBagSift.h"
- using namespace OBJREC;
- using namespace std;
- // refactor-nice.pl: check this substitution
- // old: using namespace ice;
- using namespace NICE;
- #define DEBUG_SIFTLOCATIONS
- FCBagSift::FCBagSift( const Config * conf,
- const LocalFeatureRepresentation *_lfrep )
- : FeatureFactory ( conf ), lfrep(_lfrep)
- {
- gs = new GSCluster ( conf );
- }
- FCBagSift::~FCBagSift()
- {
- delete gs;
- }
- int FCBagSift::convert ( const NICE::Image & img, NICE::Vector & vec )
- {
- VVector features;
- VVector positions;
- lfrep->extractFeatures ( img, features, positions );
- if ( features.size() <= 0 ) return -1;
-
- gs->signature ( features, vec );
- return 0;
- }
|