📄 colorfft.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 彩色图像的傅立叶变换结果 %%%%%%%%%%%%%%%%%%%%%%%%%%%
% 并对变换后的彩色的Lena图像进行反变换, 分别查看彩色图像R,G,B分量傅立叶变换的变换结果%%%%%%%%%%
% 最后给出整幅彩色图像的傅立叶变换的结果
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function ColorFFT()
f=imread('LenaRGB.bmp');
figure,imshow(f);
title '原始的Lena的彩色图像';
[wideth,height,d]=size(f);
f1=zeros(wideth,height);
for i=1:wideth
for j=1:height
f1(i,j)=f(i,j,1);
end
end
temp1=YXFFT(f1,wideth,height);
figure,imshow(temp1);
title 'B分量的傅立叶变换结果';
f2=zeros(wideth,height);
for i=1:wideth
for j=1:height
f2(i,j)=f(i,j,2);
end
end
temp2=YXFFT(f2,wideth,height);
figure,imshow(temp2);
title 'G分量的傅立叶变换结果';
f3=zeros(wideth,height);
for i=1:wideth
for j=1:height
f3(i,j)=f(i,j,3);
end
end
temp3=YXFFT(f3,wideth,height);
figure,imshow(temp3);
title 'R分量的傅立叶变换结果';
% q=zeros(wideth,height,3);
% for i=1:wideth
% for j=1:height
% q(i,j,1)=temp1(i,j);
% end
% end
% for i=1:wideth
% for j=1:height
% q(i,j,2)=temp2(i,j);
% end
% end
% for i=1:wideth
% for j=1:height
% q(i,j,3)=temp3(i,j);
% end
% end
% figure,imshow(temp1+temp2+temp3);
% title '彩色图像的傅立叶变换';
% end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -