PANDORE Version 6 | GREYC-IMAGE |
pconvolution convolves an image im_in by the kernel given in the filename.
Convolution at point (x,y) consists in:
im_out[y][x]= SUM_k,l {im_in[y+l][x+k] * mask[l][k]} / norm
The result is normalized by the sum of each kernel coefficients (norm) or by 1 if the sum is null.
The filename is a text file which contains several lines formated as follows:
nprof*nrow*ncol c1 c2 c3 ...
For example, the following kernel is used to approximate the 2D laplacian filtering:
3*3 -1.0 -1.0 -1.0 -1.0 8 -1 -1 -1 -1
Returns SUCCESS or FAILURE.
The followings kernel can be used to perform mean filter on tangram.pan:
kernel.txt: 3*3 1 1 1 1 1 1 1 1 1 pconvolution kernel.txt tangram.pan a.pan
Convolution d'une image par un noyau.
Author: Régis Clouard