1. 均值滤波概述
2 调试
2.1 matlab调试结果及代码
MATLAB代码
I=imread('D:\Administrator\My Pictures\lenagray.bmp');
J1=imnoise(I,'salt & pepper',0.02);
%均值为0,方差为0.02 椒盐噪声
J2=imnoise(I,'gaussian',0.02);
%均值为0,方差为0.02 高斯噪声
subplot(2,2,1),imshow(J1);
subplot(2,2,2),imshow(J2);
%均值滤波
I1=avg_filter(J1,3)
I2=avg_filter(J2,3)
subplot(2,2,3),imshow(I1);