How is a convolution calculated on an image with three (RGB) channels?
<p>Say we have a single channel image (5x5)</p>

<pre><code>A = [ 1 2 3 4 5
      6 7 8 9 2
      1 4 5 6 3
      4 5 6 7 4
      3 4 5 6 2 ]
</code></pre>

<p>And a filter K (2x2)</p>

<pre><code>K = [ 1 1
      1 1 ]
</code></pre>

<p>An example of applying convolution (let us take the first 2x2 from A) would be</p>

<pre><code>1*1 + 2*1 + 6*1 + 7*1 = 16
</code></pre>

<p>This is very straightforward. But let  us introduce a depth factor to matrix A i.e., RGB image with 3 channels or even conv layers in a deep network (with depth = 512 maybe). How would the convolution operation be done with the same filter ? <strong>A similiar work out will be really helpful for an RGB case.</strong></p>