实验要求:

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).

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

给出原始图片:
数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter                                                                                                         标签:               图像处理MATLAB                                            2017-05-26 23:

实验代码:

% 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');

实验结果:
数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter                                                                                                         标签:               图像处理MATLAB                                            2017-05-26 23:

很明显地,可以看到中值滤波器对椒盐噪声的滤波效果很好,能消除大部分的此类噪声。

相关文章:

  • 2021-10-28
  • 2021-07-09
  • 2022-01-26
  • 2021-06-22
  • 2021-12-30
  • 2021-08-11
  • 2021-07-18
  • 2021-06-04
猜你喜欢
  • 2021-11-30
  • 2021-07-27
  • 2021-07-16
  • 2021-10-20
  • 2021-11-26
  • 2021-08-11
  • 2021-11-08
相关资源
相似解决方案