NegativeFactory.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * @file NegativeFactory.h
  3. * @brief obtain negative examples from some images
  4. * @author Erik Rodner
  5. * @date 11/13/2008
  6. */
  7. #ifndef NEGATIVEFACTORYINCLUDE
  8. #define NEGATIVEFACTORYINCLUDE
  9. #ifdef NOVISUAL
  10. #include <vislearning/nice_nonvis.h>
  11. #else
  12. #include <vislearning/nice.h>
  13. #endif
  14. #include <vector>
  15. #include <string>
  16. #include "vislearning/cbaselib/LabeledSet.h"
  17. #include "core/vector/VVector.h"
  18. #include "vislearning/features/fpfeatures/ImageFeatures.h"
  19. #include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h"
  20. namespace OBJREC {
  21. /** obtain negative examples from some images */
  22. class NegativeFactory
  23. {
  24. protected:
  25. public:
  26. /** simple constructor */
  27. NegativeFactory();
  28. /** simple destructor */
  29. virtual ~NegativeFactory();
  30. void createNegatives ( Examples & examples,
  31. std::vector<CachedExample *> & cexamples,
  32. const LabeledSet *ls,
  33. ImageFeatures & imgf,
  34. int noImages,
  35. int examplesPerImage,
  36. int negativeClassSRC,
  37. int negativeClassDST,
  38. FeaturePoolClassifier *fpc,
  39. double & falsePositiveEstimate,
  40. const NICE::VVector & bb);
  41. void createNegativesFromText ( Examples & examples,
  42. std::vector<CachedExample *> & cexamples,
  43. const std::string & filename,
  44. ImageFeatures & imgf,
  45. int negativeClassDST );
  46. void createNegativesExhaustiveSearch ( Examples & examples,
  47. std::vector<CachedExample *> & cexamples,
  48. const LabeledSet *ls,
  49. ImageFeatures & imgf,
  50. int examplesPerImage,
  51. int negativeClassSRC,
  52. int negativeClassDST,
  53. FeaturePoolClassifier *fpc,
  54. double & falsePositiveEstimate,
  55. const NICE::VVector & bb,
  56. int subsample );
  57. };
  58. } // namespace
  59. #endif