6.4

Image Enhancement: Spatial Filtering for Enhancement of Low and High Frequency Detail and Edges

Nickolas Faust
The Electro-Optics, Environment, and Materials Laboratory
Georgia Tech Research Institute
Georgia Institute of Technology
Atlanta, GA 30332

Direct comments to: diana@bismarck.gtri.gatech.edu
                                 jairo@bismarck.gtri.gatech.edu
 
 
 


Image Enhancement - Spatial Techniques

Definition
Objectives or Purposes

Methods


Definition


   
(a) A high frequency image  (b) A low frequency image 
Figure1


  Return to table of contents 


Objectives or Purposes

There are three main purposes that underlie spatial enhancement techniques:

Return to table of contents 


Definition


Return to table of contents 


Examples

 
1/9 * 
If we have a sample image, given below:
20  20  20 
20  20  20 
20  20  20 
 

where the image normally has a low smoothly varying gray scale, except for the bottom right region, which exhibits a sharp brightness change, we can see the effects of the convolution filter on a pixel-by-pixel basis.

Because we do not wish to consider edge effects, we will start the overlay of the moving window on the x=2, y=2 pixel of the input image and end at the x=6, y=5 position of the original image.

The first p(x,y) (x=1, y=1), pixel of the output image would then be

p(1,1) = 1/9 * 
(3*1 + 
3*1 + 
4*1 
= 21/9 = 2.333 
+ 1*1 + 
2*1 + 
2*1 
+ 1*1 + 
1*1 + 
4*1) 
 

Because the output image, as well as the input image, is normally a whole number (integer) quantity, we will round the values to the nearest integer,

p(1,1) = 3.
 

Similarly,

p(1,2) = 1/9 * 
(3*1 + 
4*1 + 
4*1 
= 28/9 = 3.111 
+ 3*1 + 
3*1 + 
4*1 
+ 2*1 + 
2*1 + 
3*1) 
p(1,2) = 3.

and

p(1,3) = 1/9 * 
(4*1 + 
4*1 + 
5*1 
= 32/9 = 3.555 
+ 3*1 + 
4*1 + 
4*1 
+ 2*1 + 
3*1 + 
3*1) 
p(1,3) = 4.
 

Continued application of the same window (or filter kernel) will result in an output image given by:
 

11 
15 
14 
20 
 

This should be compared to the original data values for those pixel locations of

20 
20 
20 
20 
 

where there is a sharp discontinuity in the image.

The moving window filter, in effect, smoothed out the sharp discontinuity in the original pixel imagery.

A sample edge detection mask might be given as

-1  -1  -1 
-1    8  -1 
-1  -1  -1 
and a value for p(1,1) would be
p(1,1) = 
( -1*3)
+ (-1*3)  + (-1*4) 
= 4
+ (-1*2)
+ ( 8*3 )  + (-1*3) 
+ (-1*1)  + (-1*2)  + (-1*2) 
The resulting image after application of the mask is given by


  4 
 -1 
   4 
 -2 
  1 
 -6 
-2 
-11 
-7 
-22 
-26 
-49 
-4 
-26 
 80 
  45 
  0 
-28 
 46 
   0 
assuming that only positive values are allowed in a image file, all values are offset by the absolute value of the minimum image elements ( in this case +49).

The resultant image would then be:

53 
48 
53 
47 
50 
43 
47 
38 
42 
27 
23 
45 
23 
129 
98 
49 
21 
95 
49 
Values creater than 90 are present in the output image and represent the edge of the bright region in the original image.

Altenartly, the negative values could be set to 0 giving and output image of

80 
45 
46 
Again, the output images maybe compared to the original pixel values
20 
20 
20 
20 
One of the most used convolution kernels for edge enhancement of images was given by Chavez. The kernel is specified as:
1/9 * 
-1 
-1 
-1 
-1 
17 
-1 
-1 
-1 
-1 
Chavez originally derived the above kernel for enhancement of high frequency information in an ERTS MSS image. For a particular image pixel location and channel number, a low pass filter may be used to evaluate the average value in a 3 by 3 window. The convolution kernel would be given by:
avg = 1/9 * 
 

The high frequency (HF) component in any given pixel wil then be given by

HF = pixel - avg
 

Represented in terms of a convolution kernel, this would be

HF
 
 - 1/9 * 
 
 

which means that

HF = 1/9 * 
-1 
-1 
-1 
-1 
-1 
-1 
-1 
-1 
 

By adding the high frequency part, HF, back to the original pixel, a high frequency enhancement will be achieved:

New value = pixel value + HF.
 

This may be accomplished by:

New value = 
 
+ 1/9 * 
-1  -1  -1 
-1     8  -1 
-1  -1  -1 
 
 

or

New Value = 1/9 * 
-1 
-1 
-1 
-1 
17 
-1 
-1 
-1 
-1 
 

Figure 2 (a-b) shows two Landsat Thematic Mapper (TM) images of Downtown Savannah, Georgia. Figure 2(a) shows the area before enhancement, and Figure 2(b) shows the results of applying the above convolution kernel to the areas depicted in the image.


 
 
(a) Raw image of Downtown Savannah
(b) Enhanced image of Downtown Savannah
Figure2


Return to Table of Contents

Fourier Transform Theory

Definition


 
 
(a) A low frequency image
(b) The two-dimensional FFT for the image
Figure 3


Figure 4(a) depicts the same checkerboard image shown in Figure 1(b), and Figure 4(b) shows the two-dimensional FFT for the image.  The magnitude image has high values along 2 lines crossing in the center of the star diagram.  The outside edge of the star diagram also has high values showing an abundance of high frequency information.


 
 
(a) A high frequency image
(b) The two-dimensional FFT for the image
Figure 4


Return to contents 


Fourier Transforms and Image Enhancement

A two-dimensional FFT image may bu useful in itself in developing an understanding of individual images, but Fourier Transform theory lends itself to image enhancement techniques as well. The ability to produce a two-dimensional FFT star diagram is known as the running of a forward FFT. This process can also be thought of as transforming an image from the normal time domain to the frequency domain. The resulting frequency domain image may be transformed back to the time domain by performing an inverse two-dimensional FFT.

If no changes are made to the spatial frequency complex image, the inverse two-dimensional FFT will provide the exact same image that we began with. Fourier theory, however, tells us that we may perform certain operations, called convolutions, in the frequency domain that may enhance the image after the inverse two-dimensional FFT. These frequency convolutions are not to be confused with the kernel convolutions discussed above.

A convolution in the frequency domain is a simple multiplication of an image mask that may be arbitrarily designed by a user, multiplied by the complex frequency domain image. The resultant frequency domain image is then run through the inverse two-dimensional FFT process to yield a transformed image.

This process of convolution in the frequency domain is extremely valuable in the spatial enhancement of image data. We may perform the operations discussed earlier with kernel convolution in a more complete and flexible manner. In addition, there are some functions that may be done by frequency convolution that as yet have not been achieved by kernel convolution, such as noise removal from an image, and image restoration

An example of high-pass filtering is shown below, using the Savannah dataset, in Figure 5(a-d). To create a high-frequency enhanced image, the high spatial frequency components of the image are extracted and added back to the original image. This is easily done using frequency convolution. First, a TM image (Figure 5(a)) is transformed into the frequency domain (Figure 5(b)). Next, a mask is developed in the frequency domain, which is 0 for all spatial frequencies less than the selected value and 1 for all spatial frequencies greater than the value (Figure 5(c)). Thus, only the high frequency parts of the complex spatial frequency image are retained. When the inverse two-dimensional FFT is performed, the resultant image represents a high pass filter of the original image (Figure 5(d)). It is simple to define masks to be used in the frequency domain, but one must be careful to know what types of effects to expect in the time domain.


 
 
(a) Band 1 Landsat TM image of Downtown Savannah
(b) The two-dimensional FFT for the image
 
 
(c) The high pass mask used on the FFT
(d) The resultant image
Figure 5
 


An example of low-pass filtering using Fourier Transforms is shown below, in Figure 6(a-d):


 
 
(a) Band 1 Landsat TM image of Downtown Savannah
(b) The two-dimensional FFT for the image
 
 
(c) The low pass mask used on the FFT
(d) The resultant image
Figure 6
 


Notes

P.S. Chavez, Jr., "Atmospheric, Solar, and MTF Corrections for ERTS Digital Imagery," in Proceedings of the American Society of Photogrammetry Fall Meeting, October 1975, p. 68.


Return to Table of Contents



Back to Module 6 Main Page