FCSet.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @file FCSet.cpp
  3. * @brief extract fourier features
  4. * @author Michael Koch
  5. * @date 5/27/2008
  6. */
  7. #include <iostream>
  8. #include <math.h>
  9. #include <vector>
  10. #include "vislearning/features/simplefeatures/FCSet.h"
  11. #include "vislearning/baselib/Gnuplot.h"
  12. using namespace OBJREC;
  13. using namespace std;
  14. // refactor-nice.pl: check this substitution
  15. // old: using namespace ice;
  16. using namespace NICE;
  17. FCSet::FCSet( const Config * conf, int _xsize, int _ysize ) :
  18. FeatureFactory ( conf ), xsize(_xsize), ysize(_ysize)
  19. {
  20. }
  21. FCSet::~FCSet()
  22. {
  23. }
  24. void FCSet::add(FeatureFactory *ff)
  25. {
  26. featurefactoryvector.push_back(ff);
  27. }
  28. // refactor-nice.pl: check this substitution
  29. // old: int FCSet::convert ( const Image & img, Vector & vec )
  30. int FCSet::convert ( const NICE::Image & img, NICE::Vector & vec )
  31. {
  32. //calculate classification values
  33. // refactor-nice.pl: check this substitution
  34. // old: Vector vectmp1,vectmp2;
  35. NICE::Vector vectmp1,vectmp2;
  36. // cout<<"s1"<<endl;
  37. for(uint k=0;k<featurefactoryvector.size();k++)
  38. {
  39. featurefactoryvector[k]->convert(img,vectmp2);
  40. // cout<<vectmp2<<endl;
  41. vectmp1.append(vectmp2);
  42. // cout<<vectmp1<<endl;
  43. }
  44. vec=vectmp1;
  45. return 0;
  46. }