数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter
實驗要求:
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');實驗結果:
很明顯地,可以看到中值濾波器對椒鹽噪聲的濾波效果很好,能消除大部分的此類噪聲。
總結
以上是生活随笔為你收集整理的数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数字图像处理实验(10):PROJECT
- 下一篇: 数字图像处理实验(12):PROJECT