SumitBirla.com

Home » Software » Image Processing II » Use of Fourier Tranforms

Assignment 3: Use of Fourier Transforms

The purpose of this assignment was to use Fourier Transform to implement high-pass and low-pass filters. The result of low pass filtering is equivalent to smooothing and the high pass filter picks up the edges where the frequencies are high.

Source Code:

Fourier Transform

The Discrete Fourier transform was implemented using the FFTW library available from MIT. The source code was compiled into a win32 dll and was called from the image_shell at runtime. The output of the transform function had to be scaled appropriately to make the frequency domain image visible to the human eye.

Examples of Fourier Transforms:


lines.pgm (original image)

Fourier Transform

lines2.pgm (original image)

Fourier Transform

dot.pgm (original image)

Fourier Transform

lenna.pgm

Fourier Transform


High Pass Filter

The affect of High Pass filtering is that it makes the edges more prominent. Since the higher frequencies are at the center of the Fourier image, the frequencies that are less than threshold pixels away from the corners are set to zero. The inverse tranform is then called to retrieve the image in the spatial domain. Note how just the outline of the dot is preserved in the image below. This is because the frequency is high at the edges where the pixel intensity transitions from black (0) to white (255) and vice versa. The High Pass filter preserves these values and discards the rest (the areas where there is virtually no change in the intensity value).


dot.pgm

High Pass filter

lenna.pgm

High Pass filter


Low Pass Filter

Low Pass filtering is equivalent to the smoothing operation in the spatial domain. Low Pass filter keeps the pixels that are less than threshold distance away from the corners and sets the rest to 0.0. The inverse Fourier Transform of this pixel array then gives the image in the spatial domain.


dot.pgm

Low Pass filter

lenna.pgm

Low Pass filter


Local Filtering

The techniques described above can be applied to a part of the image. The images below show local high pass and low pass filters applied to bf.pgm. This can be useful when we need to extract edges or smooth only certain areas of the image.


bf.pgm - Local High Pass

Local Low Pass