PANDORE Version 6 GREYC-IMAGE

pconvolution



Convolves image with kernel.



Synopsis

pconvolution filename [-m mask] [im_in|-] [im_out|-]

Description

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

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

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

See also

Arithmetic

C++ prototype

Errc PConvolution( const Img2duc &im_in1, Img2dsf &im_in2, char* filename );

Version française

Convolution d'une image par un noyau.


Author: Régis Clouard