SemSegSTF.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * @file SemSegSTF.h
  3. * @brief Localization system
  4. * @author Erik Rodner
  5. * @date 02/11/2008
  6. */
  7. #ifndef SemSegSTFINCLUDE
  8. #define SemSegSTFINCLUDE
  9. #ifdef NOVISUAL
  10. #include <objrec/nice_nonvis.h>
  11. #else
  12. #include <objrec/nice.h>
  13. #endif
  14. #include "SemanticSegmentation.h"
  15. #include "objrec/classifier/fpclassifier/randomforest/DecisionNode.h"
  16. #include "objrec/classifier/fpclassifier/randomforest/FPCRandomForests.h"
  17. namespace OBJREC {
  18. /** Localization system */
  19. class SemSegSTF : public SemanticSegmentation
  20. {
  21. protected:
  22. int numClasses;
  23. int maxdepthSegmentationForest;
  24. int maxdepthSegmentationForestScores;
  25. bool use_semantic_features;
  26. bool use_pixelpair_features;
  27. int subsamplex;
  28. int subsampley;
  29. bool read_seg_cache;
  30. bool read_pixel_cache;
  31. // refactor-nice.pl: check this substitution
  32. // old: string cacheseg;
  33. std::string cacheseg;
  34. // refactor-nice.pl: check this substitution
  35. // old: string cachepixel;
  36. std::string cachepixel;
  37. // refactor-nice.pl: check this substitution
  38. // old: string resultsdatadir;
  39. std::string resultsdatadir;
  40. double alphaDetectionPrior;
  41. double alphaImagePrior;
  42. int imagePriorMethod;
  43. int priorK;
  44. int detectionPriorMethod;
  45. /**
  46. assign all pixels with
  47. normalized entropy $E/log(n)$ above
  48. this threshold to the
  49. background class
  50. */
  51. double entropyThreshold;
  52. int backgroundModelType;
  53. map<DecisionNode *, pair<long, int> > index;
  54. FPCRandomForests *fpcSeg;
  55. FPCRandomForests *fpcPixel;
  56. map<string, LocalizationResult *> detresults;
  57. void fillCachePixel ( CachedExample *ce );
  58. void fillCacheSegmentation ( CachedExample *ce );
  59. public:
  60. /** simple constructor */
  61. SemSegSTF( const Config *conf,
  62. const MultiDataset *md );
  63. /** simple destructor */
  64. virtual ~SemSegSTF();
  65. void semanticseg ( CachedExample *ce,
  66. // refactor-nice.pl: check this substitution
  67. // old: Image & segresult,
  68. NICE::Image & segresult,
  69. GenericImage<double> & probabilities );
  70. };
  71. } // namespace
  72. #endif