gaussianfilter.m
来自「本人提交的用matlab的关于滤波器设计的作业」· M 代码 · 共 22 行
M
22 行
%%%%%%%%%%%%% The main.m file %%%%%%%%%%%%%%%
clear;
% Parameters of the Gaussian filter:
n1=10;sigma1=3;n2=10;sigma2=3;theta1=0;
% The amplitude of the noise:
noise=0.1;
[w,map]=IMREAD('..\lena','bmp');
x=ind2gray(w,map);
filter1=d2gauss(n1,sigma1,n2,sigma2,theta1);
x_rand=noise*randn(size(x));
y=x+x_rand;
f1=conv2(x,filter1,'same');
rf1=conv2(y,filter1,'same');
figure(1);
subplot(2,2,1);imagesc(x);title('lena');
subplot(2,2,2);imagesc(y);title('noisy lena');
subplot(2,2,3);imagesc(f1);title('smooth');
subplot(2,2,4);imagesc(rf1);title('noise cancel');
colormap(gray);
%%%%%%%%%%%%%% End of the main.m file %%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?