数字图像处理实验课 matlab实验程序 以及图像结果 附带有命名图
仅供参考 定有错误 木有绝对正确
实验1
1—1
close all;
clear;
f=zeros(40,40);%
f(10:30,10:30)=1;
subplot(1,3,1);%
imshow(f);%
F=fft2(f)
subplot(1,3,2);%
imshow(F);%
D=log(1+abs(F));%
subplot(1,3,3);
imshow(D);
1——2
clc
load imdemos saturn2
subplot(121)
imshow(saturn2)
i=fftshift(fft2(saturn2));
subplot(122)
imshow(log(abs(i)),[]),colormap(jet(64)),colorbar;
1——3
w=imread('text.png');
a=w(33:45,88:98);
figure;
imshow(w);
figure;
imshow(a);
C=real(ifft2(fft2(w).*fft2(rot90(a,2),256,256)));
figure;
imshow(C,[]);
max(C(:));
thresh=60;
figure;
imshow(C>thresh);
1——4
RGB=imread('autumn.tif');
figure(1),imshow(RGB);
I=rgb2gray(RGB);
figure(2),imshow(I);
J=dct2(I);
figure(3),imshow(log(abs(J)),[]),colormap(jet(64)),colorbar;