next up previous contents index
Next: Wavelet transform Up: Fourier Transform Previous: Deconvolution and image reconstruction   Contents   Index

Digital Filtering of images using the FFT

Digital filtering can be easily done while the FFT spectrum is being displayed, by changing the pixels which correspond to the frequencies you wish to change. This is most conveniently done by setting the background color to ``black'' and using delete or backspace to erase the frequencies you wish to remove; or by selecting ``sketch'' ( F2 ) and adding points at the desired frequencies by drawing with the mouse. It is necessary to change both the real and imaginary components as well as the positive and negative frequencies to achieve good filtering.

Example: High-pass filtering.

  1. Make sure the original image size is a power of 2.
  2. Set background color to black by right-clicking on ``black'' in the colormap palette.
  3. Forward-FFT the image.
  4. Delete the low-frequency regions (as shown with a 'L') with the 'delete' key.
  5. Alternatively, use the mouse to select these regions and use ``paint region'', ``change contrast'' or ``color/intensity'' to make them darker.
  6. Optionally, the higher frequencies can be enhanced by using ``enhance contrast'' in the high-frequency region (shown by 'H'.
  7. Drawing on a FFT'd image only affects the component being displayed (``real'' by default). Apply the same filtering procedure to the imaginary component by selecting ``FFT... change display...imaginary'' and repeat the changes.
                    0LLLL---------------------LLLLL   
                    LLLLL          |          LLLLL   
                    |              |              |   
                    |          HHHHHHHHH          |   
                    |----------HHHHHHHHH----------|   
                    |          HHHHHHHHH          |   
                    |              |              |   
                    LLLLL          |          LLLLL   
                    LLLLL---------------------LLLLL
    
  8. Reverse-FFT to obtain the filtered image. Note: Changing the zero-frequency pixel (at the upper left corner of the FFT) will have drastic effects on the image.

Open FFT

Reads a Fourier-transformed image stored in ASCII format. The file format is as follows:

This format differs from the format used in tnimage prior to version 2.18. The header in these earlier files must be changed before they can be opened.

Save FFT

Saves the currently-selected FFT matrix to disk in ASCII format. This makes it possible to precisely change any desired frequencies with a text editor, then reload the FFT and reverse-transform. Warning:These files can be quite large.

Erase FFT

Erases the matrix used in storing the FFT, if a Fourier transform has been performed on the image, thus freeing up a considerable amount of memory. It will not erase the Fourier transformed image that appears on the screen. If no FFTs have been performed, this option has no effect.

Copying FFT into image

Occasionally, it is desired to copy the Fourier frequencies into an image (for example, to illustrate the appearance of a FFT). This can be done by clicking on ``Copy FFT into image buff''. A copy of the whatever is being displayed will be put into the image. It is a good idea to immediately press Ctrl-B or select ``Image..Backup'' to prevent accidentally overwriting the image buffer on subsequent FFT operations. The image now contains a representation of the FFT display which can be saved on disk.

Notes:

  1. If the FFT coefficients are not copied, saving the image will save the original untransformed image data regardless of what is being displayed.
  2. Because this is a copy of the screen and does not contain any Fourier coefficients, it cannot be used to recover the original untransformed image.
  3. To save the Fourier coefficients, use ``Other functions..Save FFT''.


next up previous contents index
Next: Wavelet transform Up: Fourier Transform Previous: Deconvolution and image reconstruction   Contents   Index
root 2006-11-13