Kernel Filters

For an introduction to this command please see Filtering Tutorial.

Kernel filters provide low- and high-pass filtering (smoothing and sharpening, respectively) using a kernel. Several default filters are available, and the user can supply up to twelve different User filters defined using a subsidiary dialog called up by clicking the Set button, and described below.

In addition to standard High-Pass and Low-Pass filters of two strengths, several special-purpose kernels are available. These include Gaussian Blur, Dead Pixel and Hot Pixel removal, Median filter, Dilation, and Erosion. For these filters, you can adjust the size of the kernel using the Kernel Size control.

The Average filter is simply a "boxcar" low-pass filter which takes the average of the surrounding pixels.

Dead pixel removal is useful for removing the effects of unresponsive pixels in the sensor. The filter removes any pixels that are darker than a certain fraction of the darkest neighboring pixel. The fraction is determined by entering a Threshold level in percent. If a pixel is to be replaced, the median of the surrounding pixels is used.

Hot pixel removal is useful for removing CCD image defects caused by cosmic rays or pixels that have very high dark current. This filter replaces any pixels that exceed the level of the brightest neighboring pixel by more than a percentage of its brightness. The desired percentage is entered in the Threshold field. If a pixel is to be replaced, the median of the surrounding pixels is used.

The Erosion filter replaces pixels with the darkest of the surrounding pixels, while the Dilation filter replaces pixels with the brightest of the surrounding pixels.

The Gaussian Blur filter removes fine detail and noise by convolving the image with a circularly symmetric Gaussian curve, whose standard deviation you specify in the Radius field (which replaces Threshold when this filter type is picked). In effect, each pixel's energy is redistributed into a three-dimensional "bell curve", and the resulting values added at every pixel in the destination image. The effect is to blur the image as if through an out-of-focus lens. In common with other kernel filters, points within half the kernel size of the edge of the image are not processed. Bear in mind that due to the bell-shaped Gaussian Blur kernel, pixels will be affected out to size times the specified radius.

Pixel Range Restriction

The Kernel Filters dialog supports an advanced feature called "pixel range restriction", which allows you to apply the filter to a subset of the image. One example of its use is to apply a low-pass filter only to the darker areas of an image, so as to reduce the effect of noise there, yet not soften the edges of stars. Some care is required in its use, and a little experimentation and experience will teach you how and when to apply it.

Click the otherwise unlabeled "unfold" button to expand the Kernel Filters dialog, revealing the Apply filter only to pixels restriction:

Enter the minimum and maximum values of pixels to be affected into the two With values between fields. Pixels within Reduce radius by pixels of a pixel whose value is outside this range are completely protected against the operation of the filter. The filtered values of qualifying pixels that lie within Feather distance of a protected pixel are blended with the original value using a weight that varies with the distance; for example, with Feather distance equal to 3, pixels adjacent to a protected pixel receive only one-quarter the effect of the full filter, those two pixels away receive half the effect, and those three pixels away receive three-quarters. When Feather distance is zero, 100% filtered pixels can be adjacent to completely unaffected ones.

When not using pixel range restriction, it is advisable to keep the  Apply filter only to pixels restriction "folded up" and inapplicable. When it is displayed, it is possible for inappropriate minimum and maximum pixel range values to silently prevent a filter from having any effect at all.

User Filter Definition

The user can specify one of three Kernel Sizes for each of twelve kernels. Once a kernel is defined it is automatically stored for future use. A user-supplied name can be applied to each kernel to allow quick selection. The kernel is automatically normalized to unity by the filtering algorithm; i.e. the weights are adjusted so that their sum is one (1).