code: public static <T extends ImageBase<T>>
  	ComputeRegionMeanColor<T> regionMeanColor(ImageType<T> imageType) {
  		if( imageType.getFamily() == ImageType.Family.GRAY) {
  			switch( imageType.getDataType() ) {
  				case U8:
  					return (ComputeRegionMeanColor)new ComputeRegionMeanColor.U8();
  				case F32:
  					return (ComputeRegionMeanColor)new ComputeRegionMeanColor.F32();
  			}
  		} else if( imageType.getFamily() == ImageType.Family.PLANAR) {
  			int N = imageType.getNumBands();
  			switch( imageType.getDataType() ) {
  				case U8:
  					return (ComputeRegionMeanColor)new ComputeRegionMeanColor.PL_U8(N);
  				case F32:
  					return (ComputeRegionMeanColor)new ComputeRegionMeanColor.PL_F32(N);
  			}
  		}
  
  		throw new IllegalArgumentException("Unknown imageType");
  	}
docs: Creates an instance of {@link boofcv.alg.segmentation.ComputeRegionMeanColor} for the specified image type.
  
  @param imageType image type
  @return ComputeRegionMeanColor