📄 imdsp.m
字号:
x=imread('tire.tif');
x=im2double(x);
%x1=imnoise(x,'gaussian',0,0.01);
w=0.1;
N=4;
[b3,a3] = butter(N,w); %butterworth LPF
[b4,a4] = butter(N,w,'high'); %butterworth HPF
[h3,w3] = freqz(b3,a3,N);
[h4,w4] = freqz(b4,a4,N);
hp3=filter2(h3,x);
hp4=filter2(h4,x)-2.5*x;
bb1=fftshift(fft2(hp3));
bb2=fftshift(fft2(hp4));
R=0.5;w=0.1;
[b5,a5] = cheby1(N,R,w); %Chebyshev LPF
[b6,a6] = butter(N,w,'high'); %Chebyshev HPF
[h5,w5] = freqz(b5,a5,N);
[h6,w6] = freqz(b6,a6,N);
hp5=filter2(h5,x);
hp6=filter2(h6,x)-2.5*x;
bb5=fftshift(fft2(hp5));
bb6=fftshift(fft2(hp6));
figure(1); %butterworth LPF AND HPF
subplot(2,2,1);
imshow(hp3);
subplot(2,2,2);
imshow(hp4);
subplot(2,2,3);
imshow(bb1);
subplot(2,2,4);
imshow(bb2);
figure(2); % Chebyshev LPF AND HPF
subplot(2,2,1);
imshow(hp5);
subplot(2,2,2);
imshow(hp6);
subplot(2,2,3);
imshow(bb5);
subplot(2,2,4);
imshow(bb6);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -