next up previous contents index
Next: Deconvolution and image reconstruction Up: Process menu Previous: Trace curve   Contents   Index


Fourier Transform

Performs a Fast Fourier Transform on the image or selected region. This can use a lot of memory because the frequencies are stored as double-precision complex numbers, which require 16 bytes for each pixel. Thus, an FFT is 4 times as expensive as a 32-bit image. Additionally, the mathematics of the FFT requires that the image be first enlarged so that each dimension is the next higher power of two. For example, if your image is 129 x 67 pixels, imal has to create a new buffer of 256 x 128 pixels (524,288 bytes) to carry out the calculations. Your image is automatically enlarged to that size. Moreover, the sharp discontinuity between the edge of the image and the new black pixels in the buffer can create undesirable artifacts in the Fourier transform.

The FFT result is a matrix which is displayed as a new 128 bit/pixel image. This new image can be saved, unloaded, annotated, filtered, and manipulated like any other image. Any changes made to this image (such as adding text) are also converted to the appropriate floating point numbers and inserted at the appropriate position into the displayed component (real or imaginary) of the FFT matrix. Therefore, changing pixels by typing on the displayed image could change the real component of the FFT, the imaginary component, or both. After editing the image to enhance or eliminate specific spatial frequencies, perform a reverse FFT to obtain the filtered result.


Forward/Reverse/Change display only

Selects whether to carry out a forward or reverse FFT, or to merely change which component (original image, imaginary, real, or power spectrum) is being displayed. No actual change is made to the FFT data. The display can also be changed by typing fftdisplay mode in the command editor, where mode is 0=original, 1=real, 2=imaginary, and 3=power spectrum.


Real/Imaginary/Power spectrum

Selects whether to display the real, imaginary, or power spectrum component of the transformed image, or only the original image.

NOTE: If you select ``imaginary'' or ``power spectrum'', the displayed image will appear black if you perform a FFT followed by a reverse FFT. This is because the original data do not have an imaginary component. The original data are not lost!


Although a complete description of the many applications of FFTs and deconvolution is beyond the scope of the manual, there are a few imal- specific points worth remembering:

  1. Regardless of the screen mode or color depth of the image, the FFT and deconvolution algorithms treat all pixels as monochrome. Thus, a 24-bit/pixel image is treated as a 24 bit deep grayscale image. In other words, the colors are not deconvoluted separately in the current version of imal.
  2. The grayscale mapping algorithm sets the most negative FFT result to black and the most positive FFT result to white. Thus, zero will be some shade of gray.
  3. Editing power spectra will lead to unpredictable results in your image.
  4. Select ``About...About the image'' to view some of the FFT parameters. These include:

    These numbers can be used to calculate the color values needed to edit the image in the frequency domain to remove or accentuate specific frequencies. The filtered image can then be reverse- transformed to obtain the result.

  5. When an image is set to display the real or imaginary frequency components of an image, operations that only affect the original image (such as ``flip image'', ``change contrast'', etc. will appear to have no effect. Before performing these operations, select ``Process..FFT...Change display only'' to switch the display to the original image.
  6. FFTs are displayed in the conventional manner, i.e. with lowest positive frequencies at the top and left, lowest negative frequencies on the right and bottom, and Nyquist in the center, with the exception that only the real or imaginary components are shown, as illustrated in the diagram below:


    \begin{picture}( 100,100 )(0,220)
\put(0, 0){ \line(1,1){ 30 }} % diagonal line...
..._n$ }
\put( 155,310){ $f_{-n}$ }
\put( 290,310){ $f_{-1/N}$ }
\end{picture}

    In this diagram, the shaded area marks portions of the FFT extending beyond the lower right corner of the original image. The 0,0 frequency is in the upper left corner, and the f=0 frequencies run vertically along the left and top edge, from f=0, f=1/N, ... f=n, f=-n, ... f= -1/N.

    If the x or y size of the image is not a power of 2, the image is enlarged to the next power of 2 in each dimension.

  7. FFTs should be done with as few other images present as possible. Because an FFT is extremely memory-intensive, if imal is forced to use virtual memory, the FFT may take a very, very long time.
  8. When deconvoluting or convoluting, the two images should be approximately the same size for optimal results.
  9. Avoid image sizes that are just larger than a power of 2, such as 129 x 129 pixels. This will cause the complex array for FFT to be allocated as the next higher power of 2 (i.e., 256 x 256). The additional pixels will also be set to solid black, which will create artifacts in the FFT.
  10. The screen mappings of FFT intensity values are automatically rescaled whenever the FFT image is redrawn. Thus, changing the contrast of an FFT'd image will have no effect on the appearance of the real or imaginary components. To change the brightness of a FFT'd image, use ``Color...Grayscale map''.

Example: Removing periodic noise from an image.

Periodic noise, such as the circular dots and moiré patterns that appear when a newspaper photo is scanned in a scanner, are ideal candidates for removal by Fourier transform.

  1. Make sure the image is close to a power of two in both x and y dimensions.
  2. Select ``Process..FFT'' and click ``Operation = Forward'' and ``Display = Real FFT''. (The ``Data'' and ``Display scale factors'' are used only for deconvolution and can be ignored).
  3. Click OK. The FFT'd image should show white dots or lines near the middle of the image. These represent the spatial frequencies of the periodic noise.
  4. Select the areas to be erased with the mouse and press Del, or erase them by setting the Fcolor to 0 and drawing over them. Do not erase along the edges or in the upper left corner.
  5. Select ``Process..FFT'' and click "Display = Imaginary FFT'', and repeat the erasing process on the imaginary components.
  6. Select ``Process..FFT'' and click ``Operation = Reverse''. The new image should have most of the noise removed.
  7. Repeat if necessary.

Convolution

View the image DECONVOL.TIF for a quick tutorial on convolution and deconvolution.

Convolution - Convolutes two images. Convolution is the same as multiplication in the frequency domain. Therefore, the resultant image will have the characteristics of both images. In the simplest possible example, a sharp image convolved with an image of a blurred point will become blurry. An image convolved with a single point is unchanged.



Subsections
next up previous contents index
Next: Deconvolution and image reconstruction Up: Process menu Previous: Trace curve   Contents   Index
root 2008-10-10