code: public static <T extends ImageBase<T>>
  	void performSegmentation( ImageSuperpixels<T> alg , T color )
  	{
  		// Segmentation often works better after blurring the image.  Reduces high frequency image components which
  		// can cause over segmentation
  		GBlurImageOps.gaussian(color, color, 0.5, -1, null);
  
  		// Storage for segmented image.  Each pixel will be assigned a label from 0 to N-1, where N is the number
  		// of segments in the image
  		GrayS32 pixelToSegment = new GrayS32(color.width,color.height);
  
  		// Segmentation magic happens here
  		alg.segment(color,pixelToSegment);
  
  		// Displays the results
  		visualize(pixelToSegment,color,alg.getTotalSuperpixels());
  	}
docs: Segments and visualizes the image