| image = | convolution2dImg (inImg,inKnlXY,inNormalize) |
| image = | convolution2dImg (inImg,inKnlXY,inNormalize,inOptConvolBorder2d) |
Compute convolution of an input 2d image with a kernel.
See Kernels for a detailled documentation of kernels creation and management tools.
Given an input 2d kernel :
Where :
defines "negative" part of kernel elements along x axis (elements before central element)
defines "positive" part of kernel elements along x axis (elements after central element)
defines "negative" part of kernel elements along y axis (elements before central element)
defines "positive" part of kernel elements along y axis (elements after central element)
defines kernel size along x axis
defines kernel size along y axisExample of square kernel with
(unsharp making kernel) :
Example of square kernel with
and
(linear box filter kernel) :
On output image values are given by:
Input kernel coefficients can be normalized during processing if
value is set to
. In this case previous formula is modified into :
with :
Case of
is handled forcing its value to
to avoid null division.
Neighborhood border policy is controlled by
parameter. This parameter allows to control starting and ending rows/columns provided data during processing (see Border policy for more details).
Here is an example of a normalized convolution operation applied to an 8-bits grey levels input image with input kernel given by :