/** * @file RegionSegmentationMethod.h * @brief abstract interface for region segmantation * @author Björn Fröhlich * @date 05/05/2009 */ #ifndef REGIONSEGMENTATIONMETHOD #define REGIONSEGMENTATIONMETHOD #include "core/basics/Config.h" #undef DEBUGRS #include "RegionGraph.h" namespace OBJREC { class RegionSegmentationMethod { protected: const NICE::Config *conf; public: /** simple constructor */ RegionSegmentationMethod(); /** simple constructor */ RegionSegmentationMethod(const NICE::Config *c ); /** simple destructor */ ~RegionSegmentationMethod(); /** * 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 = 0; /** * 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 & cimg, NICE::Matrix & mask) const; /** * transform a segmented color image in a grayimage, where each region has its own label * @param img input image * @param mask output mask * @return count of regions */ int transformSegmentedImg( const NICE::ColorImage & img, NICE::Matrix & mask) const; /** * get the Graph representation of an segmentationa * @param cimg input color image * @param mask result mask of the regions * @param rg graph representation */ void getGraphRepresentation(const NICE::ColorImage & cimg, NICE::Matrix & mask, RegionGraph & rg); /** * @brief mark contours with given segmentation * * @param cimg input image * @param mask result segmentation * @param color RGB values of marking color * @param marked resultimage * @return void **/ void markContours ( const NICE::ColorImage & cimg, NICE::Matrix & mask, std::vector &color, NICE::ColorImage &marked ); /** * visualize the graph representation * @param cimg input color image * @param mask result mask of the regions */ void visualizeGraphRepresentation(const NICE::ColorImage & cimg, NICE::Matrix & mask); }; } // namespace #endif