DFT and FFT of Image

조회 수: 11 (최근 30일)
bigdog
bigdog 2015년 4월 8일
답변: Aastha 2024년 8월 8일
Shift the Fourier transform so that it is centered around the middle of your figure and plot the absolute value of the shifted DFT. Then apply the log transform (log(1 + DFT)) and plot your result.
I know that I'm supposed to use fft2 and fftshift. I have the image and this is the code I have this far.
>> X = imread('granular_media.jpg');
>> X1 = double(X(501:700,1401:1600));
>> X2 = double(X(1:200,1:200));
I need to first compute the DFT of the 200x200 subimages that I created. Any help with this?
  댓글 수: 1
JANITHA
JANITHA 2024년 7월 22일
DFT in image processing log of magnitude of FT

댓글을 달려면 로그인하십시오.

답변 (1개)

Aastha
Aastha 2024년 8월 8일
Hi,
I find that you are computing the DFT of the 200x200 sub-images that you have created.
Please follow the below steps to compute the centered Discrete Fourier Transform of the sub images
1. Compute the Discrete Fourier Transform using “fft2 function. fft2 function can be used to deal with 2D signals and can compute a 2D Discrete Fourier Transform.
2. Shift the Discrete Fourier Transform computed in step 1 using fftshift function. The function fftshift shifts the low frequency components to the centre and high frequency components to the edge and centres the Discrete Fourier Transform image.
3. Display the Discrete Fourier Transform as an image. You can apply log transformation on the abs value of the Discrete Fourier Transform.
4. Further, you can also add a small constant to prevent the argument of the log function from being zero and then plot it.
5. Steps 1-3 can be repeated for any image that you desire to compute the centered Discrete Fourier Transform.
I have attached an “fft_example.m” file that illustrates an example on how to compute Discrete Fourier Transform of an image.
Hope this helps!

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by