/** * @file RSMeanShift.h * @brief implementation of the MeanShift algorithm (uses EDISON) * @author Björn Fröhlich, Alexander Freytag * @date 05/05/2009 */ #ifndef RSMEANSHIFT #define RSMEANSHIFT #include "core/basics/Config.h" #include "RegionSegmentationMethod.h" #include #include namespace OBJREC { class RSMeanShift: public RegionSegmentationMethod { protected: ///////////////////////// ///////////////////////// // PROTECTED VARIABLES // ///////////////////////// ///////////////////////// //! Specifies the minimum allowable region area (in pixels) contained in the segmented image int minimumRegionArea; //! Specifies the bandwidth of the search window in the range subspace during the computation of mean shift double rangeBandwidth; //! Specifies a spatial search window of size (2r+1)x (2r+1) during the mean shift computation, where r is the spatial bandwidth int spatialBandwidth; //! Specifies the SpeedUpLevel. See EDISON Manual for details. std::string speedUpLvlString; SpeedUpLevel speedUpLevel; //! EDISON - ImageProcessor msImageProcessor *imageProc; void setSpeedUpLevel ( const std::string & _speedUpLevelString ); public: ///////////////////// ///////////////////// ///////////////////// // CONSTRUCTORS / DESTRUCTORS ///////////////////// ///////////////////// ///////////////////// /** simple constructor */ RSMeanShift(); /** * @brief standard constructor, calls this->initFromConfig * @param conf config file * @author Bjoern Froehlich, Alexander Freytag */ RSMeanShift(const NICE::Config * _conf ); /** simple destructor */ virtual ~RSMeanShift(); /** * @brief Setup internal variables and objects used * @author Alexander Freytag * @param conf Config file to specify variable settings * @param s_confSection * @date 07-02-2014 ( dd-mm-yyyy ) */ virtual void initFromConfig ( const NICE::Config * _conf, const std::string & _confSection = "RSMeanShift" ); ///////////////////// ///////////////////// ///////////////////// // 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 */ int segRegions ( const NICE::Image & img, NICE::Matrix & mask ) const; /** * 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 */ 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 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