RSCache.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @file RSCache.h
  3. * @brief read and save the RegionSegmentation
  4. * @author Björn Fröhlich
  5. * @date 05/07/2009
  6. */
  7. #ifndef RSCACHE
  8. #define RSCACHE
  9. #include "core/basics/Config.h"
  10. #include "RegionSegmentationMethod.h"
  11. namespace OBJREC
  12. {
  13. class RSCache: public RegionSegmentationMethod
  14. {
  15. protected:
  16. //! the RegionSegmentation method
  17. RegionSegmentationMethod *rsmethod;
  18. //! where to save or to load the caches data
  19. std::string cachedir;
  20. //! just write features, don't read them
  21. bool forcedwrite;
  22. public:
  23. /** simple constructor */
  24. RSCache ( const NICE::Config *conf, RegionSegmentationMethod *_rsmethod );
  25. /** simple destructor */
  26. ~RSCache();
  27. /**
  28. * returns the regions of a given image
  29. * @param img input image
  30. * @param mask output regions, each region has it own number
  31. * @return count of region
  32. */
  33. virtual int segRegions ( const NICE::Image & img, NICE::Matrix & mask ) const;
  34. /**
  35. * returns the regions of a given image
  36. * @param img input colorimage
  37. * @param mask output regions, each region has it own number
  38. * @return count of region
  39. */
  40. virtual int segRegions ( const NICE::ColorImage & cimg, NICE::Matrix & mask ) const;
  41. };
  42. } // namespace
  43. #endif