123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /**
- * @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 <segmentation/RegionSegmentationMethod.h>
- #include <segmentation/RSMarkovCluster.h>
- #include <segmentation/RSMeanShift.h>
- #include <segmentation/RSSlic.h>
- #include <segmentation/RSGraphBased.h>
- #include <segmentation/RSCache.h>
- 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
|