QGis Image Classification Tutorial: 2.3- The spatial filters

The spatial filters represent another method of digital processing used for the enhancement of an image. These filters are designed to bring out or remove specific features of an image based on their spatial frequency. The spatial frequency is related to the concept of texture. It refers to the frequency of variation of the different tones that appear in an image. The regions of an image where the texture is “rough” are the regions where the changes in different shades are steep; these regions have a high Spatial frequency. The “smooth”regions have a variation of tones that is more gradual over several pixels;these regions have a weak Spatial frequency Space. The spatial filtering method implies moving a “window” the size of a few pixels (eg. 3 of 3, 5 out of 5,etc.) above each image pixel. Then, we apply a mathematical processing using the values of the pixels under the window and replace the value of the central pixel by the result obtained. The window is moved along the columns and lines of the image, one pixel at a time, repeating the calculation until the whole image has been filtered. By modifying the calculation performed within the window, is possible to enhance or remove different types of features present in an image.

A low-pass filter is designed in  order to put in evidence the regions large and homogeneous enough with pixels of similar intensity. This filter reduces the smaller details of an image. Therefore,it is used to straighten an image. The average and median filters, often used with radar images, are low-pass filter examples. The high-pass filters are the opposite: they are used to enhance the little details of an image. A high-pass filter can be defined by applying firstly a low-pass filter to an image and then subtract the result from the original image, producing a new image where details having a high Spatial frequency are enhanced. The directional filters or the filters that detect contours are used to enhance the linear features of an image such as roads or field boundaries. These filters can, also, be designed to enhance the characteristics that have a certain orientation in the image.

The enhancement of images is, basically, anything that facilitates the visual interpretation of an image. In certain cases ( as low-pass filters), the result can result disappointing but it empowers the interpreter to discern the low frequency spatial elements among the clutter of the high frequencies of the image . The enhancements are, often, applied for specific reasons. Therefore,for a given image, if dealing with different applications, strong differences are possible.

Unlike enhancement, filtering can take place in two different ways: by modifying the visualization of the image or the values of the image. If you decide to apply a definitely filtering when working on the classification of the modified image, you will have to create a new image at the end of the filtering process .

Filtering with QGis

You have a processing tool in the SAGA GIS library for performing filtering Image SAGA -> Raster Filter -> Simple Filter :

The available filters relate to three main types of filters :

The low pass filters (Smoothing)

Smoothing filters (low – pass) straighten data by reducing local variations and removing the noise. The low pass filter calculates the average value for each neighbouring pixel. The result is that the average of the high and low values of each neighbour will be reduced, which will reduce the data extreme values.

The high pass filters (Sharpening)

The Sharpness filter accentuates the values comparative difference among neighbours. A high pass filter calculates the sum of Statistics focal length for each cell of the input using a weighted neighbourhood of the core. It highlights the boundaries among features (for example, when a body of water meets the forest), accentuating, thus, the contours among the objects. The high pass filter is called contour improvement filter. The core high pass filter identifies which cells to use in the neighbourhood and their weights.

Edge detection filters

The third type of filters relates to the detection of edges of the geographical objects.

In the following image, there is an example of each type of filters application:

Original image without filtering

Image with ”   smooth   ”  filter

Image with ”   sharpen   ” filter

Image with ”  smooth   ”  filter

Leave a Reply

Your e-mail address will not be published. Required fields are marked *