How to Plot the discrete Fourier transform on an image ?
Show older comments
How to Plot the discrete Fourier transform on an image ?
4 Comments
Image Analyst
on 23 Dec 2013
What does that mean? The FT of an image is another image, or probably two of them, a real image and a imaginary image. When I think of a plot I think of a line curve. So what are you thinking of when you say that you want to plot a complex image ON an image (presumably the space domain original image)?
engineer 01
on 23 Dec 2013
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.
engineer 01
on 23 Dec 2013
Answers (2)
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
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.
Categories
Find more on Image Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!