code: public static GrayU8 median(GrayU8 input, @Nullable GrayU8 output, int radius,
  								@Nullable IWorkArrays work) {
  		if( radius <= 0 )
  			throw new IllegalArgumentException("Radius must be > 0");
  
  		output = InputSanityCheck.checkDeclare(input,output);
  
  		boolean processed = BOverrideBlurImageOps.invokeNativeMedian(input, output, radius);
  
  		if( !processed ) {
  			int w = radius * 2 + 1;
  			int offset[] = new int[w * w];
  
  			if( BoofConcurrency.USE_CONCURRENT ) {
  				ImplMedianHistogramInner_MT.process(input, output, radius, work);
  			} else {
  				ImplMedianHistogramInner.process(input, output, radius, work);
  			}
  			// TODO Optimize this algorithm. It is taking up a large percentage of the CPU time
  			ImplMedianSortEdgeNaive.process(input, output, radius, offset);
  		}
  
  		return output;
  	}
docs: Applies a median filter.
  
  @param input Input image.  Not modified.
  @param output (Optional) Storage for output image, Can be null.  Modified.
  @param radius Radius of the median blur function.
  @return Output blurred image.