code: public static <T extends ImageGray<T>> T convert(ImageGray<?> src , T dst , Class<T> typeDst  )
  	{
  		if (dst == null) {
  			dst =(T) GeneralizedImageOps.createSingleBand(typeDst, src.width, src.height);
  		} else {
  			InputSanityCheck.checkSameShape(src, dst);
  		}
  		convert(src,dst);
  
  		return dst;
  	}
docs: Converts an image from one type to another type.  Creates a new image instance if
  an output is not provided.
  
  @param src Input image. Not modified.
  @param dst Converted output image. If null a new one will be declared. Modified.
  @param typeDst The type of output image.
  @return Converted image.