Re: Can it be done? [message #28693] |
Sat, 05 January 2002 09:31 |
Martin Downing
Messages: 136 Registered: September 1998
|
Senior Member |
|
|
"john" <johnmm91@hotmail.com> wrote in message
news:3C3700C6.527F8BB@hotmail.com...
> Hi
>
> I want to do this:
> Open and read a BMP file
> And then carry out a 2D-FFT
> Save the result as BMP file, but with data shifted such that DC
> component is in the middle of the image.
>
> I tried the followings:
>
> MYIMAGE=READ_TIFF('c:\image2c.tif')
> TV, MYIMAGE
> R=FFT(MYIMAGE)
> TV, R
>
> It seems the displayed result is the FFT result, but is it really a
> 2D-FFT ?
to quote the help docs:
"The FFT function returns a result equal to the complex, discrete Fourier
transform of Array. "
What most people display is the log power spectrum, ie the logarithm of the
complex conjugate:
disp_im = alog(abs(R)+MIN_FOURIER_VALUE)
where MIN_FOURIER_VALUE is added to prevent very low powers dominating the
display
> And could anyone show me how to shift the dc point at the center of the
> display ?
for the shift:
dim = size(r, /dim)
r = shift(r, dim[0]/2, dim[1]/2)
or all in one:
tvscl, alog(abs(shift(r, dim[0]/2, dim[1]/2))+MIN_FOURIER_VALUE)
note the image should have dimentions which are a power of 2
Cheers
Martin
|
|
|
Re: Can it be done? [message #28695 is a reply to message #28693] |
Sat, 05 January 2002 05:33  |
john
Messages: 3 Registered: July 1996
|
Junior Member |
|
|
Hi
I want to do this:
Open and read a BMP file
And then carry out a 2D-FFT
Save the result as BMP file, but with data shifted such that DC
component is in the middle of the image.
I tried the followings:
MYIMAGE=READ_TIFF('c:\image2c.tif')
TV, MYIMAGE
R=FFT(MYIMAGE)
TV, R
It seems the displayed result is the FFT result, but is it really a
2D-FFT ?
And could anyone show me how to shift the dc point at the center of the
display ?
Many Thanks in advance
John
john �g�J�G
>
> Hi
>
> I am new on IDL and actually have just installed the trial yesterday.
> I am wondering could anyone help and provide me some sample on the
> following task:
>
> Open and read a BMP file
> And then carry out a 2D-FFT
> Save the result as BMP file, but with data shifted such that DC
> component is in the middle of the image.
>
> Can it be done easily with only a few command ?
> Would youshow me how ?
> Many Thanks in advance
>
> Best Regards
>
> John
|
|
|