3.高斯滤波、中值滤波MATLAB代码和结果图像

高斯滤波:

H=imread('E:\Classical Images\标准测试图片\goldhill.bmp');
I=rgb2gray(H);
subplot(2,3,1);
imshow(H);
title('原图像');
sigma1 = 1.6;
gausFilter = fspecial('gaussian',[3 3],sigma1);
blur1=imfilter(I,gausFilter,'replicate');
subplot(2,3,2); 
imshow(blur1);
title('sigma1 1.6,窗口大小3*3');%给滤波图像加标题名 


sigma2 = 1.6;
gausFilter = fspecial('gaussian',[7 7],sigma2);
blur2=imfilter(I,gausFilter,'replicate');
subplot(2,3,3); 
imshow(blur2);
title('sigma2 1.6,窗口大小7*7');%给滤波图像加标题名


sigma3 = 4;
gausFilter = fspecial('gaussian',[3 3],sigma3);
blur3=imfilter(I,gausFilter,'replicate');
subplot(2,3,4); 
imshow(blur3);
title('sigma3 4,窗口大小3*3');%给滤波图像加标题名 


sigma4 =4;
gausFilter = fspecial('gaussian',[7 7],sigma4);
blur4=imfilter(I,gausFilter,'replicate');
subplot(2,3,5); 
imshow(blur4);

你可能感兴趣的:(图像处理)