NDCodebookLevelImagePooling.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * @file NDCodebookLevelImagePooling.h
  3. * @brief Compute novelty of images based on relations between extracted features and current codebook, pool novelty scores over the whole image without considering spatial information
  4. * @author Alexander Freytag
  5. * @date 02-05-2013 (dd-mm-yyyy)
  6. */
  7. #ifndef _NDCODEBOOKLEVELIMAGEPOOLING
  8. #define _NDCODEBOOKLEVELIMAGEPOOLING
  9. #include "NoveltyDetectorCodebookLevel.h"
  10. //core
  11. #include <core/vector/Distance.h>
  12. #include <core/vector/VVector.h>
  13. // vislearning
  14. #include <vislearning/cbaselib/MultiDataset.h>
  15. //
  16. #include <vislearning/features/localfeatures/GenericLocalFeatureSelection.h>
  17. //
  18. #include <vislearning/math/cluster/ClusterAlgorithm.h>
  19. namespace OBJREC
  20. {
  21. /**
  22. * @class NDCodebookLevelImagePooling
  23. * @brief Compute novelty of images based on relations between extracted features and current codebook, pool novelty scores over the whole image without considering spatial information
  24. * @author Alexander Freytag
  25. * @date 02-05-2013 (dd-mm-yyyy)
  26. */
  27. class NDCodebookLevelImagePooling : public NoveltyDetectorCodebookLevel
  28. {
  29. protected:
  30. /************************
  31. *
  32. * protected variables
  33. *
  34. **************************/
  35. //TODO ENUM HOW TO POOL
  36. //! this is the (stupid) global threshold for novelty within an image (i.e., if novelty scores summed over all pixels and divided by image size is larger than this score, the image is considered as "novel")
  37. double d_noveltyThreshold;
  38. /************************
  39. *
  40. * protected methods
  41. *
  42. **************************/
  43. public:
  44. /** constructor
  45. * @param _conf needs a configfile
  46. * @param _md and a MultiDataset (contains images and other things)
  47. * @param _section section information for parsing config files
  48. */
  49. NDCodebookLevelImagePooling ( const NICE::Config *_conf, const OBJREC::MultiDataset *_md , const std::string & _section = "noveltyDetector");
  50. /** simple destructor */
  51. virtual ~NDCodebookLevelImagePooling();
  52. /**
  53. * @brief Evaluate whether or not the image of the specified filename is novel with respect to the current known examples or not
  54. * @author Alexander Freytag
  55. * @date 02-05-2013 (dd-mm-yyyy)
  56. * @param _filename of the new image
  57. * @return bool (true: class/content/... of image is novel, false: class/content/... of image is known)
  58. * @note This function has to be overloaded by all subclasses!
  59. */
  60. virtual bool evaluateNoveltyOfImage ( const std::string & _filename );
  61. /**
  62. * @brief Evaluate whether or not the image of the specified filename is novel with respect to the current known examples or not
  63. * @author Alexander Freytag
  64. * @date 02-05-2013 (dd-mm-yyyy)
  65. * @param _noveltyImage contains min distances of features to the current codebook
  66. * @return bool (true: class/content/... of image is novel, false: class/content/... of image is known)
  67. */
  68. virtual bool evaluateNoveltyOfImage ( const NICE::FloatImage & _noveltyImage ) ;
  69. };
  70. } // namespace
  71. #endif