Matrix Convolution Algorithms

Matrix Convolution permit to create custom filters. The mechanism of Matrix Convolution is very simple: you have to get a block of pixels from your input image and multiply it with your custom matrix for matrix convolution. The result represent new value of color for the central pixel of your block.
An example can help to understand:

Image (Channel R)

Matrix

New Image (Channel R)

4501223191
3255654147
9253063185
250262532180
240252233216232

X

010
1-41
010

 = 

     
     
  49  
     
     
In the example you can see without problems that the Matrix Convolution must calculate this product for every pixel of image and for every channel (R,G,B). This method cut the edge of the image because around there isn't 9 pixels.