数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators ...

实验要求:

Objective:
To know how to generate noise images with different probability density functions (distributions). The noise images are useful in simulation for image enhancement and image restoration.
Main requirements:
Ability of programming with C, C++, or Matlab.
Instruction manual:
This is a generic project, in the sense that the programs developed here are used in several of the projects that follow. See Fig. 5.2 for the shapes and parameters of the following noise probability density functions.
(a) Find (or develop) a program to add Gaussian noise to an image. You must be able to specify the noise mean and variance.
(b) Find (or develop) a program to add salt-and-pepper (impulse) noise to an image. You must be able to specify the probabilities of each of the two noise components.

本实验比较简单,目的就只是往图片中添加各种噪声,比如高斯噪声或者椒盐噪声。还有一点要求就是要能够向程序指定概率等等的一些参数。

给出原图像:
这里写图片描述

实验代码:

% PROJECT 05-01 [Multiple Uses] Noise Generators
close all;
clc;
clear all;

% 原图像
img =imread('Fig5.03.jpg');
figure;
subplot(1,3,1);
imshow(img);
title('original image');

% 添加高斯噪声
img_nse1 = imnoise(img, 'gaussian', 0.2, 0.01);
subplot(1,3,2);
imshow(img_nse1);
title('Plus gaussian noise');

disp('高斯噪声');
disp(['mean: ', num2str(0.2), ' variance: ', num2str(0.01)]);

% 添加泊松噪声
% img_nse2 = imnoise(img, 'poisson');
% figure;
% imshow(img_nse2);
% title('Plus poisson noise');

% 添加椒盐噪声
img_nse3 = imnoise(img, 'salt & pepper', 0.2);
subplot(1,3,3);
imshow(img_nse3);
title('Plus salt & pepper noise');

disp('椒盐噪声');
disp(['probability: ', num2str(0.2)]);

实验结果:
这里写图片描述

注释主要在代码中,实验现象也很明显,分别显示了添加高斯噪声和椒盐噪声的图像。

转载于:https://www.cnblogs.com/xuhongbin/p/7134160.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值