title: Android Median Filter using Convolution
body: <p>I've implemented a basic Sharpen filter using Android convolution as shown (code is Xamarin C#, but java is almost identical):</p>
  
  <pre><code>        private Bitmap Sharpen(Bitmap src, float weight)
      {
          var counter = (weight - 1)/4f*-1f;
          float[] matrixSharpen =
          {
              0, counter, 0,
              counter, weight, counter,
              0, counter, 0
          };
          return CreateBitmapConvolve(src, matrixSharpen);
      }
  </code></pre>
  
  <p>How can I do something similar, except produce a median (or mean) filter instead of sharpen? I can't seem to find what the matrix configuration should be...</p>