Discrete Gaussian Filter Help

The discrete guassian filter takes a field with one component (representing a grayscale image) and produces a smoothed output field with one component (representing a filtered grayscale image). This filter is useful for removing noise from an image before applying other filters.

The smoothing effect is controlled by two parameters: the variance and the maximum kernel width. Practially speaking the effect of applying a discrete Gaussian image filter is that a pixel value is based on a weighted average of surrounding pixel values, where the closer the pixel the more weight its value is given. By increasing the variance we increase the number of pixels used to calculate the weighted average. By limiting the kernel width we ensure the process does not get out of hand.

To understand what the variance and maximum kernel width values relate to requires some explanation of how the discrete Gaussian filter actually works. The discrete Gaussian filter is implemented using convolution. Convolution is a simple mathematical operation which provides a way of multiplying together two arrays of numbers to obtain a scalar value. In the context of image processing one of the arrays is usually a 2D grayscale image and the other is a much smaller 2D array known as the Kernel. To calculate the convolution for an entry in an array the kernel is placed over the image and corresponding values are multiplied together, with the resulting list of values summed. Each kernel position corresponds to a single output pixel. An entire image is convoluted by sliding the kernel over all positions in the entire image. Edges present a problem but there are a number of methods for dealing with them. By using kernels with different values and sizes various image processing effects are produced.

The kernel used by the discrete Gaussian filter is a discrete approximation to the Gaussian distribution function. For 2D images a 2D Gaussian distribution is used. The variance of the distribution governs the spread of the distribution. In theory a Gaussian distribution extends to infinity in all directions. The discrete approximation must have a finite width. The width to use is determined by the function in order to give an approximation within a certain error tolerance. The width is determined based on the variance and is hence not known ahead of time. For this reason we impose an upper limit on the kernel width, to ensure that the kernel width will be no bigger than a known maximum. Most points lie within 3 standard deviations either side of the mean. These means the kernel width need be no more than 6 times the square root of the variance.

Variance
Sets the variance (and hence the spread) of the Gaussian distribution used as a Kernel. Increasing the variance increases the area of surrounding pixels used to determine a pixel value.
Maximum Kernel Width
The maximum permissible width of the kernel. As a Gaussian distribution is in theory infinite this value imposes a physical limit on how large the kernel can be. This limit is not always reached as it is possible to have a reasonable discrete approximation to the distribution without reaching the maximum width.

Click the "Apply filter" button to update the discrete Gaussian filter using the appropriate values.


Last modified: Thu Mar 15 07:46:39 NZDT 2007