June 10, 2004

Lab Contents

FFT of Parallel Lines

in SRM484

The Fast Fourier Transform is useful for blurring, deblurring, removing specific types of features or noise, cross correlation, and other things. This exercise illustrates the use of the Process -> FFT menu in conjunction with the Process -> Image Math menu.

Here is the relevant information from the ImageJ doc page on the Process Menu:  http://rsb.info.nih.gov/ij/docs/menus/process.html#fft, under FFT / Inverse FFT:

You can filter or mask spots on the transformed (frequency domain) image and do an inverse transform to produce an image which only contains the frequencies selected or which suppresses the frequencies selected. Use ImageJ's selection tools and fill/clear commands to draw black or white areas that mask portions of the transformed image. Black areas (pixel value=0) cause the corresponding frequences to be filtered (removed) and white areas (pixel value=255) cause the corresponding frequences to be passed. It is not, however, possible to both filter and pass during the same inverse transform.

• The FFT requires square selections with side length an even power of 2. File -> Open menu, select Sample Images / proc samples / cal500x.tiff
• The image is already square - 512x512, which is correct for using the FFT.   If you want to work on a smaller image (not at all necessary with ImageJ) make a square selection from this image with the Square Image for FFT instructions.

• Process -> FFT -> FFT menu.

 Image I have enhanced the contrast of the FFT (Power Spectrum) image with the Process -> Enhance Contrast menu. ImageJ

For the following, you need to add drawing tools to in ImageJ.

The fuzzy diagonal line from the upper left to lower right corresponds to the lines of the image. To see this:

• Click the paintbrush tool
• Click on the white bar in the LUT window to make the brush white. (In ImageJ, double-click on the Color Tool , and select white as the foreground color.  Use the very bottom end of the ramp on the left side of the color picker, or use the black/white reset tool and then the foreground/background switch tool . Make sure the value is 255.)
• Paint over the diagonal line in white. (This information in the white area is eliminated from the FFT - Notch Filter).

• Use the Process -> FFT -> Inverse FFT menu to reconstruct the original image.

Had the inverse FFT been performed on the unaltered FFT image, the original image would have been duplicated. In this case, the information corresponding to the lines was eliminated in the FFT, and the lines were eliminated from the reconstructed image.

• Select the original image and use the Process -> FFT -> FFT menu again.
• This time, paint over the line with a black paintbrush. (Double-click on the Color Tool, then the b/w reset button to get a black paintbrush.  Make sure the value is 0.)

In this case, all but the black areas are eliminated from the transform image. (Bandpass filter.)

• Use the Process -> FFT -> Inverse FFT menu to reconstruct the original image.

This time the lines are highlighted, and most everything else is lost.