/** * @brief Class which represents a generic RS selection. * @author Eric Bach * @date 03/05/12 */ #ifndef _NICE_OBJREC_SEGMENTATIONSELECTION_INCLUDE #define _NICE_OBJREC_SEGMENTATIONSELECTION_INCLUDE #include #include #include #include #include #include namespace OBJREC { class GenericRegionSegmentationMethodSelection { public: /** * @brief Return an instance of the segmentation method which has been defined in [segmenatation]:methode using conf. * @return RegionSegmentationMethod*, if methode is defined; NULL, else */ static RegionSegmentationMethod* selectRegionSegmentationMethod(const NICE::Config* conf, const std::string& methode) { RegionSegmentationMethod* segmentationAlgo = NULL; if (methode == "MarkovCluster") { segmentationAlgo = new RSMarkovCluster(conf); } else if (methode == "GraphBased") { segmentationAlgo = new RSGraphBased(conf); } else if (methode == "MeanShift") { segmentationAlgo = new RSMeanShift(conf); } else if (methode == "SLIC") { segmentationAlgo = new RSSlic(conf); } if ( segmentationAlgo == NULL ) { fthrow(NICE::Exception, "Region Segmentation Method not found: " << methode ); return segmentationAlgo; } return segmentationAlgo; }; }; } #endif