1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * @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>
- namespace OBJREC
- {
- class GenericRegionSegmentationMethodSelection
- {
- public:
- /**
- * @brief Return a instanz of the segmentationmethode which has defined in [segmenatation]:methode within conf.
- * @return RegionSegmentationMethod*, if methode is defined; NULL, else
- */
-
- static RegionSegmentationMethod*
- selectRegionSegmentationMethod(const 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(Exception, "Region Segmentation Method not found: " << methode );
- return segmentationAlgo;
- }
- return segmentationAlgo;
- };
- };
- }
- #endif
|