08-16-2017, 10:13 PM
impulsive noise matlab
%% Add Impulse Noise to images
%% Impulse Noises 0 - Salt & Pepper noise
% 1 - Random Valued impulse noise.
%% impulse noises are classified into two major types
% (i) salt and pepper noise (equal height impulses) impulse values are
% represented as 0 and 255
% (ii) random-valued impulse noise (unequal height impulses) impulse values
% are between 0 and 255.
%% Function img = impulsenoise(img,ND)
%% input
% img = Given an Image (Noise free image)
% ND = Noise density (ND varies B/W 0 and 1) [0 to 1]
% NT = Noise Type([0] is default)
% 0 - Salt & Pepper noise
% 1 - Random-Valued Impulse noise
%% Output:
% img = impulse noise added image
%% Example:
%% img = impulsenoise(img,0.4,0);
%% Posted date : 18 - 11 - 2008
% Modified date : 02 - 12 - 2008
%% Developed By
% K.Kannan ([email protected])
% & Jeny Rajan ([email protected])
% Medical Imaging Research Group (MIRG), NeST,
% Trivandrum.
%%
function img = impulsenoise(varargin)
if length(varargin) == 1
img = varargin{1};
ND = 0.2;
NT = 0;
elseif length(varargin) > 1 && length(varargin) < 3