FCSet.cpp 1.3 KB

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