title: Cuda Image average filter
body: <p><strong>Average filter</strong> is windowed filter of linear class, that smooths signal (image). The filter works as low-pass one. The basic idea behind filter is for any element of the signal (image) take an average across its neighborhood.</p>
  <hr />
  <p>If we've an <code>m x n</code> matrix and we want to apply average filter with size <code>k</code> on it,then for each point in the matrix  <code>p:(i,j)</code> the value of the point would be the average of all points in the square</p>
  <p><img src="https://i.stack.imgur.com/CrXhj.png" alt="Square Kernel" /></p>
  <p>This figure is for Square kernel of filtering with size <code>2</code>, that the yellow box is the pixel to be averaged, and all the grid is the square of neighbor pixels, that the pixel's new value will be the average of them.</p>
  <p>The problem is that this algorithm is very slow, specially on large images, so I thought about using <code>GPGPU</code>.</p>
  <p><strong>The question now is</strong>, How Can this be implemented in cuda, if it's possible ?</p>