[iadftmatrix] [Up] [iaifftshift] | Image Transformation |
The origen (0,0) of the DFT is normally at top-left corner of the image. For visualization purposes, it is common to periodicaly translate the origen to the image center. This is particularly interesting because of the complex conjugate simmetry of the DFT of a real function. Note that as the image can have even or odd sizes, to translate back the DFT from the center to the corner, there is another correspondent function.
>>> import Numeric
>>> import FFT
>>> f = iarectangle([120,150],[7,10],[60,75])
>>> F = FFT.fft2d(f)
>>> Fs = iafftshift(F)
>>> iashow(Numeric.log(abs(F)+1))
(120, 150) Min= 0.0 Max= 4.26267987704 Mean=0.963 Std=0.86
>>> iashow(Numeric.log(abs(Fs)+1))
(120, 150) Min= 0.0 Max= 4.26267987704 Mean=0.776 Std=0.87
Numeric.log(abs(F)+1) | Numeric.log(abs(Fs)+1) |
def iafftshift(H): from Numeric import asarray, NewAxis, array H = asarray(H) if len(H.shape) == 1: H = H[NewAxis,:] HS = iaptrans(H, array(H.shape)/2) return HS
iaifftshift | Undoes the effects of iafftshift. |
iaptrans | Periodic translation. |
iadftview | Generate optical Fourier Spectrum for display from DFT data. |
[iadftmatrix] [Up] [iaifftshift] | |