nxn模板中值滤波
2006年11月10日 星期五 23:07
I=imread('eight.tif'); J=imnoise(I,'salt & pepper',0.02) subplot(231),imshow(I),title('原图像'); subplot(232),imshow(J),title('添加椒盐噪声图像'); k1=medfilt2(J); %3x3模板中值滤波 k2=medfilt2(J,[5 5]); %5x5模板中值滤波 k3=medfilt2(J,[7 7]); %7x7模板中值滤波 k4=medfilt2(J,[9 9]); %9x9模板中值滤波 subplot(233),imshow(uint8(k1));title('3x3模板中值滤波'); subplot(234),imshow(uint8(k2));title('5x5模板中值滤波'); subplot(235),imshow(uint8(k3));title('7x7模板中值滤波'); |