FFT and Convolution [message #35888] |
Thu, 24 July 2003 00:55 |
cabrera
Messages: 4 Registered: July 2003
|
Junior Member |
|
|
Hi,
I have to do a wavelet transformation of a set of 140x150 images with
a Gabor wavelet. Has some bodysome code how does it?
For the moment i'm using the convolution theorem between the image and
a 140x150 array with the wavelet fonction.
> fft_imagearray = FFT(imagearray,-1) ; using
> fft_waveletarray = FFT(waveletarray,-1) ; convolution
> conv_array = FFT(fft_imagerray*fft_waveletarray, 1) ; theorem
> imagearray = abs(conv_array)
> imagearray = shift(imagearray,-n21x,-n21y)
I'm surprised that to have a correct image of the convolution i need
to shift the image. I'm doing a direct and an inverse FFT, so the
shift in the frequency domain should be cancelled by itself. When i
look in convolve.pro of the astron library i see that they have to do
the same thing (if i correctly understand the code). What surprises me
more is that if i make this "imagearray = float(FFT(fft_imagearray1,
1))" I do not need to reverse the image to see it correctly.
Other thing I do not understand is why in convolve.pro the convolution
is multiplied by n_elements(array). For the same reason if I do two
inverse operations, normally the normalisation farctor should not be
necessary.
Thanks in advance.
Juan
|
|
|