How to Plot the discrete Fourier transform on an image ?

7 views (last 30 days)
How to Plot the discrete Fourier transform on an image ?
  4 Comments
Image Analyst
Image Analyst on 23 Dec 2013
Perhaps it means to extract just one row of the FT image and plot that with the plot() function??? I'm not sure - it's your call.

Sign in to comment.

Answers (2)

Youssef  Khmou
Youssef Khmou on 23 Dec 2013
%a
I=I=im2double(imread('circuit.tif'));
%b
F=fftshift(fft2(I)); % surface(abs(F))
%c
plot(abs(F)) % plot not surf
%d
IF=ifft2(fftshift(F));
%e
figure, imshow(IF)

Image Analyst
Image Analyst on 23 Dec 2013
Extract a line from the FFt image and plot it.
fftImage = fft2(grayImage);
fftImageRealPart = real(fftImage);
[rows, columns] = size(fftImageRealPart)
lineNumber = floor(rows/2); % Middle row
oneLine = fftImageRealPart(lineNumber, :);
plot(oneLine, 'r-', 'LineWidth', 2);
grid on;
I'm omitting the usual comments and other fancy display/plotting things that I usually include to make it shorter and simpler for you.

Community Treasure Hunt

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

Start Hunting!