您的位置:首页 > 其它

数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter

2017-05-26 23:47 691 查看
实验要求:

Objective:

To understand the non-linearity of median filtering and its noise suppressing ability, especially for the pepper-noises, the salt-noises and the pepper-and-salt noises.

Main requirements:

Ability of programming with C, C++, or Matlab.

Instruction manual:

(a) Modify the program that you developed in Project 03-04 to perform 3 x 3 median filtering.

(b) Download Fig. 5.7(a) and add salt-and-pepper noise to it, with Pa = Pb = 0.2.

(c) Apply median filtering to the image in (b). Explain the major differences between your result and Fig. 5.10(b).

这个实验中要使用中值滤波器消除椒盐噪声。思路很简单,我们可以先调用前一个实验中使用的产生噪声的程序来产生椒盐噪声,然后调用中值滤波的函数进行中值滤波即可。

给出原始图片:



实验代码:

% PROJECT 05-02 Noise Reduction Using a Median Filter
close all;
clc;
clear all;

%
img = imread('Fig5.07(a).jpg');
figure;
subplot(1,3,1);
imshow(img);
title('original image');

%
img_n = imnoise(img, 'salt & pepper', 0.2);
subplot(1,3,2);
imshow(img_n);
title('image with salt & pepper noise');

%
img_f = medfilt2(img_n);
subplot(1,3,3);
imshow(img_f);
title('image through median filter');


实验结果:



很明显地,可以看到中值滤波器对椒盐噪声的滤波效果很好,能消除大部分的此类噪声。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐