12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /**
- * @file RSCache.h
- * @brief read and save the RegionSegmentation
- * @author Björn Fröhlich
- * @date 05/07/2009
- */
- #ifndef RSCACHE
- #define RSCACHE
- #include "core/basics/Config.h"
- #include "RegionSegmentationMethod.h"
- namespace OBJREC
- {
- class RSCache: public RegionSegmentationMethod
- {
- protected:
- //! the RegionSegmentation method
- RegionSegmentationMethod *rsmethod;
- //! where to save or to load the caches data
- std::string cachedir;
- //! just write features, don't read them
- bool forcedwrite;
- public:
- /** simple constructor */
- RSCache ( const NICE::Config *conf, RegionSegmentationMethod *_rsmethod );
- /** simple destructor */
- virtual ~RSCache();
- /**
- * returns the regions of a given image
- * @param img input image
- * @param mask output regions, each region has it own number
- * @return count of region
- */
- virtual int segRegions ( const NICE::Image & img, NICE::Matrix & mask ) const;
- /**
- * returns the regions of a given image
- * @param img input colorimage
- * @param mask output regions, each region has it own number
- * @return count of region
- */
- virtual int segRegions ( const NICE::ColorImage & cimg, NICE::Matrix & mask ) const;
-
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- // interface specific methods for store and restore
- ///////////////////// INTERFACE PERSISTENT /////////////////////
-
- /**
- * @brief Load object from external file (stream)
- * @author Alexander Freytag
- * @date 07-02-2014 ( dd-mm-yyyy )
- */
- void restore ( std::istream & is, int format = 0 );
-
- /**
- * @brief Save object to external file (stream)
- * @author Alexander Freytag
- * @date 07-02-2014 ( dd-mm-yyyy )
- */
- void store ( std::ostream & os, int format = 0 ) const;
-
- /**
- * @brief Clear object
- * @author Alexander Freytag
- * @date 07-02-2014 ( dd-mm-yyyy )
- */
- void clear ();
- };
- } // namespace
- #endif
|