public static<T extends ImageBase<T>>
	SegmentMeanShift<T> meanShift(@Nullable ConfigSegmentMeanShift config, ImageType<T> imageType )
	{
		if( config == null )
			config = new ConfigSegmentMeanShift();

		int spacialRadius = config.spacialRadius;
		float colorRadius = config.colorRadius;

		int maxIterations = 20;
		float convergenceTol = 0.1f;

		SegmentMeanShiftSearch<T> search;

		if( imageType.getFamily() == ImageType.Family.GRAY) {
			InterpolatePixelS interp = FactoryInterpolation.bilinearPixelS(imageType.getImageClass(), BorderType.EXTENDED);
			search = new SegmentMeanShiftSearchGray(maxIterations,convergenceTol,interp,
					spacialRadius,spacialRadius,colorRadius,config.fast);
		} else {
			InterpolatePixelMB interp = FactoryInterpolation.createPixelMB(0,255,
					InterpolationType.BILINEAR, BorderType.EXTENDED,(ImageType)imageType);
			search = new SegmentMeanShiftSearchColor(maxIterations,convergenceTol,interp,
					spacialRadius,spacialRadius,colorRadius,config.fast,imageType);
		}

		ComputeRegionMeanColor<T> regionColor = regionMeanColor(imageType);
		MergeRegionMeanShift merge = new MergeRegionMeanShift(spacialRadius/2+1,Math.max(1,colorRadius/2));

		MergeSmallRegions<T> prune = config.minimumRegionSize >= 2 ?
				new MergeSmallRegions<>(config.minimumRegionSize, config.connectRule, regionColor) : null;

		return new SegmentMeanShift<>(search, merge, prune, config.connectRule);
	}
public static < T extends ImageBase < T > > SegmentMeanShift < T > meanShift ( @ Nullable ConfigSegmentMeanShift config , ImageType < T > imageType ) { if ( config == null ) config = new ConfigSegmentMeanShift ( ) ; int spacialRadius = config . spacialRadius ; float colorRadius = config . colorRadius ; int maxIterations = 20 ; float convergenceTol = 0.1f ; SegmentMeanShiftSearch < T > search ; if ( imageType . getFamily ( ) == ImageType . Family . GRAY ) { InterpolatePixelS interp = FactoryInterpolation . bilinearPixelS ( imageType . getImageClass ( ) , BorderType . EXTENDED ) ; search = new SegmentMeanShiftSearchGray ( maxIterations , convergenceTol , interp , spacialRadius , spacialRadius , colorRadius , config . fast ) ; } else { InterpolatePixelMB interp = FactoryInterpolation . createPixelMB ( 0 , 255 , InterpolationType . BILINEAR , BorderType . EXTENDED , ( ImageType ) imageType ) ; search = new SegmentMeanShiftSearchColor ( maxIterations , convergenceTol , interp , spacialRadius , spacialRadius , colorRadius , config . fast , imageType ) ; } ComputeRegionMeanColor < T > regionColor = regionMeanColor ( imageType ) ; MergeRegionMeanShift merge = new MergeRegionMeanShift ( spacialRadius / 2 + 1 , Math . max ( 1 , colorRadius / 2 ) ) ; MergeSmallRegions < T > prune = config . minimumRegionSize >= 2 ? new MergeSmallRegions < > ( config . minimumRegionSize , config . connectRule , regionColor ) : null ; return new SegmentMeanShift < > ( search , merge , prune , config . connectRule ) ; }
Creates an instance of {@link boofcv.alg.segmentation.ms.SegmentMeanShift}.  Uniform distributions are used for spacial and color
weights.

@param config Specify configuration for mean-shift
@param imageType Type of input image
@return SegmentMeanShift