123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /**
- * @file FCFPFeature.cpp
- * @author Erik Rodner
- * @date 11/15/2007
- */
- #include <iostream>
- #include <core/imagedisplay/ImageDisplay.h>
- #include "FCFPFeature.h"
- #include "vislearning/cbaselib/FeaturePool.h"
- #include "vislearning/baselib/ICETools.h"
- using namespace OBJREC;
- using namespace std;
- using namespace NICE;
- FCFPFeature::FCFPFeature( const Config * conf ) :
- FeatureFactory ( conf ), imgf (conf, "FCFPFeature" )
- {
- }
- FCFPFeature::~FCFPFeature()
- {
- }
- int FCFPFeature::convertRGB ( const NICE::ColorImage & img, NICE::Vector & vec )
- {
- FeaturePool fpool;
- imgf.fillFeaturePool ( fpool, false );
- vec.resize ( fpool.size() );
- CachedExample ce ( img );
- Example example ( &ce );
- imgf.fillExample ( example.ce );
- fprintf (stderr, "Total size of feature vector will be: %d\n", fpool.size() );
- uint index = 0;
- for ( FeaturePool::const_iterator i = fpool.begin();
- i != fpool.end();
- i++, index++ )
- {
- Feature *f = i->second;
- vec[index] = f->val ( &example );
- }
- example.clean();
- fpool.destroy();
- return 0;
- }
- int FCFPFeature::convert ( const NICE::Image & img, NICE::Vector & vec )
- {
- FeaturePool fpool;
- imgf.fillFeaturePool ( fpool, false );
-
- vec.resize ( fpool.size() );
- CachedExample ce ( img );
- Example example ( &ce );
- imgf.fillExample ( example.ce );
- fprintf (stderr, "Total size of feature std::vector will be: %d\n", fpool.size() );
- uint index = 0;
- for ( FeaturePool::const_iterator i = fpool.begin();
- i != fpool.end();
- i++, index++ )
- {
- Feature *f = i->second;
- vec[index] = f->val ( &example );
- }
- // do not clean this stuff: example.clean();
- fpool.destroy();
- return 0;
- }
|