This transformation function is used to convolve an image with a kernel.
Convolution is the process of combining each pixel of an image with its neighboring pixels, weighted by the values in a kernel (filter).
For example, consider two 3 × 3 matrices:
The first matrix is the kernel
The second matrix is a local image patch
Convolution involves flipping the kernel both horizontally and vertically, then multiplying corresponding elements of the kernel and the image patch, and finally summing the results.
The value of the output pixel at position [2, 2] (the center pixel) is therefore a weighted combination of all the values in the image patch, with the weights defined by the kernel.
Parameters of the ImageConvolution Transformation Function
The ImageConvolution transformation function uses the following three parameters:
Image Type
Specifies the image format to be processed.
Supported values are GrayScale and RGB.
Kernel Dimension
Specifies the dimension of the kernel matrix (for example, 3 for a 3 × 3 kernel).
Kernel Values
Specifies the kernel values in the form of a one-dimensional array.
For example, if the kernel dimension is 3, the array is mapped row by row: