IDFT on image is not working out well.. i did DFT it worked great but while implementing IDFT on that same image as of DFT output image , i didnt get my enitre original image back!?? help!!
1 view (last 30 days)
Show older comments
my code is as following: apply DFT AND IDFT in same code
clc; close all; sum=0; a=imread('Cameraman.bmp');
b=a; M=50; N=50;
for x=1:50 for y=1:50 b(x,y)=a(x,y); end end c=double(b);
for u=1:M for v=1:N s=0; for x=1:M for y=1:N s=s+c(x,y)*exp(1*j*2*pi*(((u*x)/M)+((v*y)/N))); end end
F(u,v)=s;
end
end
for x=1:M for y=1:N s=0; for u=1:M for v=1:N s=s+F(u,v)*exp(-1*j*2*pi*(((u*x)/M)+((v*y)/N))); end end
inf(x,y)=s/(M*N);
end
end
subplot(2,2,1); imshow(uint8(c)); title('ORIGINAL IMAGE');
subplot(2,2,2); imshow(uint8(F)); title('DFT IMAGE');
subplot(2,2,2); imshow(uint8(inf)); title('IDFT IMAGE');
0 Comments
Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!