Function iadftview

namespace:ia636
page:iadftview

Synopse

Generate optical Fourier Spectrum from DFT data.

  • g = iadftview(F)
    • OUTPUT
      • g: Image.
    • INPUT
      • F: Image. n-dimensional DFT complex data.

Description

Generate the logarithm of the magnitude of F, shifted so that the origin stays at the center of the image. The objective of this function is to provide DFT spectrum visualization.

1. from numpy import *
2. 
3. def iadftview(F):
4.     from ia636 import iafftshift
5.     from ia636 import ianormalize
6. 
7.     FM = iafftshift(log(abs(F)+1))
8.     return ianormalize(FM).astype(uint8)

Examples

Example 1

1. from ia636 import iadftview
2. 
3. import numpy.fft as FFT
4. f = adread('cameraman.pgm')
5. adshow(f, "Original 2D image - Cameraman")
6. F = FFT.fft2(f)
7. Fv = iadftview(F)
8. adshow(Fv, "Cameraman DFT optical spectrum")

Original 2D image - Cameraman

Cameraman DFT optical spectrum

Equation

Contributions

  • André Luis da Costa, 1st semester 2011