Kernel Shape and Size

Convolution filters are based around a kernel, which represents the shape and size of the neighborhood that will be sampled when calculating the pixel values to be modified. Convolution filters, as the name implies, perform a convolution of the filter coefficients with the input data. The basic idea is that a window of some finite size and shape — the kernel — is scanned across the image. The output pixel value is the weighted sum of the input pixels within the window where the weights are the values of the filter assigned to every pixel of the window itself. The window with its weights is called the convolution kernel.

Various standard kernels are provided for convolution-based image filters and the size and the form of the kernel determine the characteristics of the operation. A simple 5x5 structuring element and the shapes available for 2D interpretation are shown below.

Simple structuring elements

Simple structuring elements

SHAPES FOR 2D AND 3 INTERPRETATION?

2D - Square, Circle, Cross

3D - Cube, Sphere, Cross

You should note that the size of the neighborhood controls the amount of filtering. A larger neighborhood, corresponding to a larger convolution mask, will result in a greater degree of filtering. You should also note that as a trade-off for greater amounts of smoothing, for example, larger neighborhoods may also result in a loss of image detail.

An important issue that arises within the convolution process centers on the fact that the convolution kernel will extend beyond the borders of the image when it is applied to border pixels. A common approach to dealing with border effects is to pad the original image with extra rows and columns based on the filter size. The technique used in Dragonfly to remedy border effects is to reflect the image at the borders. For example, column[-1] = column [1], column [-2] = column [2], and so on.

For more information, go to http://homepages.inf.ed.ac.uk/rbf/HIPR2/convolve.htm and http://homepages.inf.ed.ac.uk/rbf/HIPR2/kernel.htm.

 

Dragonfly Help Live Version