[iadftdecompose] [Up] [iadftmatrixexamples] | Lessons |
The DFT of a constant image is a single point at F(0,0), which gives the sum of all pixels in the image.
>>> import Numeric, FFT
>>> f = 50 * Numeric.ones((10, 20))
>>> F = FFT.fft2d(f)
>>> aux = F.real > 1E-5
>>> r, c = iaind2sub([10, 20], Numeric.nonzero(Numeric.ravel(aux)))
>>> print r
[0]
>>> print c
[0]
>>> print F[r[0],c[0]]/(10.*20.)
(50+0j)
The DFT of a pyramid is the square of the digital sync.
>>> f = Numeric.zeros((128, 128))
>>> k = Numeric.array([[1,2,3,4,5,6,5,4,3,2,1]])
>>> k2 = Numeric.matrixmultiply(Numeric.transpose(k), k)
>>> f[63:63+k2.shape[0], 63:63+k2.shape[1]] = k2
>>> iashow(f)
(128, 128) Min= 0 Max= 36 Mean=0.079 Std=1.14
>>> F = FFT.fft2d(f)
>>> Fv = iadftview(F)
>>> iashow(Fv)
(128, 128) Min= 0 Max= 255 Mean=51.718 Std=59.31
f | Fv |
The DFT of a Gaussian image is a Gaussian image.
The DFT of an impulse image is an impulse image.
[iadftdecompose] [Up] [iadftmatrixexamples] | |