/** 
 * @file FCSet.cpp
 * @brief extract fourier features
 * @author Michael Koch
 * @date 5/27/2008

 */

#include <iostream>
#include <math.h>
#include <vector>
#include "vislearning/features/simplefeatures/FCSet.h"
#include "vislearning/baselib/Gnuplot.h"

using namespace OBJREC;

using namespace std;
// refactor-nice.pl: check this substitution
// old: using namespace ice;
using namespace NICE;



FCSet::FCSet( const Config * conf, int _xsize, int _ysize ) : 
          FeatureFactory ( conf ), xsize(_xsize), ysize(_ysize)
{

}

FCSet::~FCSet()
{
}

void FCSet::add(FeatureFactory *ff)
{
     featurefactoryvector.push_back(ff);
}

// refactor-nice.pl: check this substitution
// old: int FCSet::convert ( const Image & img, Vector & vec )
int FCSet::convert ( const NICE::Image & img, NICE::Vector & vec )
{

     //calculate classification values
     // refactor-nice.pl: check this substitution
     // old: Vector vectmp1,vectmp2;
     NICE::Vector vectmp1,vectmp2;
//      cout<<"s1"<<endl;
     for(uint k=0;k<featurefactoryvector.size();k++)
     {
          featurefactoryvector[k]->convert(img,vectmp2);
//        cout<<vectmp2<<endl;
          vectmp1.append(vectmp2);

//        cout<<vectmp1<<endl;
     }
     
     vec=vectmp1;
    
     return 0;
}
