/** * @file RSSlic.h * @brief SLIC Superpixels from "SLIC Superpixels Compared to State-of-the-art Superpixel Methods," * @author Björn Fröhlich, Alexander Freytag * @date 02/02/2013 */ #ifndef RSSlicINCLUDE #define RSSlicINCLUDE #include "core/basics/Config.h" #include "RegionSegmentationMethod.h" namespace OBJREC { class RSSlic: public RegionSegmentationMethod { protected: ///////////////////////// ///////////////////////// // PROTECTED VARIABLES // ///////////////////////// ///////////////////////// //!number of regions int spcount; //!value between 0 and 40 double compactness; //!average size of each region int regionsize; //!use lab space or not bool b_lab; public: ///////////////////// ///////////////////// ///////////////////// // CONSTRUCTORS / DESTRUCTORS ///////////////////// ///////////////////// ///////////////////// /** simple constructor */ RSSlic(); /** * standard constructor * @param conf config file */ RSSlic( const NICE::Config * _conf ); /** simple destructor */ virtual ~RSSlic(); /** * @brief Setup internal variables and objects used * @author Alexander Freytag * @param conf Config file to specify variable settings * @param s_confSection * @date 08-02-2014 ( dd-mm-yyyy ) */ virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "RSSlic" ); ///////////////////// ///////////////////// ///////////////////// // SEGMENTATION STUFF ///////////////////// ///////////////////// ////////////////// /** * 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 color image * @param mask output regions, each region has it own number * @return count of region */ virtual int segRegions ( const NICE::ColorImage & img, 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 08-02-2014 ( dd-mm-yyyy ) */ void restore ( std::istream & is, int format = 0 ); /** * @brief Save object to external file (stream) * @author Alexander Freytag * @date 08-02-2014 ( dd-mm-yyyy ) */ void store ( std::ostream & os, int format = 0 ) const; /** * @brief Clear object * @author Alexander Freytag * @date 08-02-2014 ( dd-mm-yyyy ) */ void clear (); }; } //namespace #endif