www.gusucode.com > 自适应中值滤波matlab代码 > quzaochuli.m
I=imread('D:\1.jpg'); I1=rgb2gray(I);%获取灰度图像 f1=imnoise(I1,'salt & pepper',0.3);%给灰度图像加噪 f2=medfilt2(f1,[3 ,3]); ff=adp_median(f1,19); figure('NumberTitle', 'off', 'Name', '图像去噪处理'); subplot(2,2,1); imshow(I); title('原图'); subplot(2,2,2); imshow(f1);%输出添加噪声后的图像 title('添加椒盐噪声图像'); subplot(2,2,3); imshow(f2); title('中值滤波'); subplot(2,2,4); imshow(ff); title('自适应中值滤波');