code: public static <T extends ImageGray<T>> T checkReshape(T target , ImageGray testImage , Class<T> targetType )
  	{
  		if( target == null ) {
  			return GeneralizedImageOps.createSingleBand(targetType, testImage.width, testImage.height);
  		} else if( target.width != testImage.width || target.height != testImage.height ) {
  			target.reshape(testImage.width,testImage.height);
  		}
  		return  target;
  	}
docs: Checks to see if the target image is null or if it is a different size than
  the test image.  If it is null then a new image is returned, otherwise
  target is reshaped and returned.
  
  @param target
  @param testImage
  @param targetType
  @param <T>
  @return