code: public static <T extends ImageGray<T>>
  	T convolve( T integral ,
  				IntegralKernel kernel,
  				T output ) {
  		if( integral instanceof GrayF32) {
  			return (T)IntegralImageOps.convolve((GrayF32)integral,kernel,(GrayF32)output);
  		} else if( integral instanceof GrayF64) {
  			return (T)IntegralImageOps.convolve((GrayF64)integral,kernel,(GrayF64)output);
  		} else if( integral instanceof GrayS32) {
  			return (T)IntegralImageOps.convolve((GrayS32)integral,kernel,(GrayS32)output);
  		} else if( integral instanceof GrayS64) {
  			return (T)IntegralImageOps.convolve((GrayS64)integral,kernel,(GrayS64)output);
  		} else {
  			throw new IllegalArgumentException("Unknown input type: "+integral.getClass().getSimpleName());
  		}
  	}
docs: General code for convolving a box filter across an image using the integral image.
  
  @param integral Integral image.
  @param kernel Convolution kernel.
  @param output The convolved image. If null a new image will be declared and returned. Modified.
  @return Convolved image.