Artifact [046063cc30]

Artifact 046063cc30c05d1f56969abf6363e7127beffcb7:

Wiki page [ConvolutionMatrix] by user 2013-09-01 15:48:26.
D 2013-09-01T15:48:26.918
L ConvolutionMatrix
P 7beaaa3db5f7291ec92685ad78e896523dbad911
U user
W 1453
<h1>Convolution Matrix</h1>

It's classical image processing method: applying of 2D filter on each pixel. More about convolution matrix read [http://docs.gimp.org/en/plug-in-convmatrix.html|this]. Main idea is the same as in other filters: each original samples gives some value to common result but all of thees values has different amount which depend of filter formula.

There are 2 main notes on this filter. First: no recursion, so original pixels (samples) - are real original and temporary clean copy of original image should be allocated and used for calculation. Second: normalization of result is need. Result is divided by special value (<b>div</b>) and shifted by another (<b>shift</b> or <b>bias</b>). And if now it's lesser then 0, 0 should be used instead of, if bigger then 255, 255 should be placed as result.

See test4.scm, test6.scm, test7.scm. Different predefined convolution matrix with div and shift are available in [/doc/tip/conv.scm|conv.scm].
 
Some examples are here:

Edge detection matrix after black and white conversion:

<br/><img src="/doc/tip/out/bwedge.jpg" width="40%"/><br/>

Dilation matrix application after conversion to black and white:

<br/><img src="/doc/tip/out/dilat2.jpg" width="40%"/><br/>

Edge detection matrix with div=3 and shift=60:

<br/><img src="/doc/tip/out/edge.jpg" width="40%"/><br/>

Emboss matrix applied:

<br/><img src="/doc/tip/out/emboss.jpg" width="40%"/><br/>
Z 91cd2b910b143e3f176e7acf68b0ecfd