UNIFORM_NOISE_CVIP
uniform_noise_cvip() - adds Uniform noise to an image.
Contents
SYNTAX
[ outImage ] = uniform_noise_cvip( inImage, noiseArgs, noiseImgSize)
Input Parameters include :
- inImage - 1-band input image of MxN size or 3-band input image of MxNx3 size. The input image can be of uint8 or uint16 or double class.
- noiseArgs - Uniform noise arguments. uniformArgs(1): mean value (default 0) uniformArgs(2): variance value (default 100)
- noiseImgSize - Size of Uniform noise image. Only needed when noise is added to black image. noiseImgSize(1): height (default 256) noiseImgSize(2): width (default 256)
Output Parameter includes :
- outImage - Uniform noise added image or Uniform noise image
DESCRIPTION
The function adds Uniform noise to an image or creates Uniform noise image. If user wants to add Uniform noise to the image, the user needs to pass only two input arguments (input image, and Uniform noise arguments). The Uniform noise arguments consists of mean and variance value. If user wants to create a Uniform noise image only, pass input image as an empty matrix [ ]. And, the size of the noise image can be defined by passing additional parameter (size of noise image). If not passed, default size of 256*256 will be selected.
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% Read image I = imread('butterfly.tif'); % mean = 20, variance = 100 noise_parameter = [20 100]; % calling function with default parameters O1 = uniform_noise_cvip(I); % Uniform noise image image_size = [300 400]; %height = 300, width = 400 % Calling function with user defined parameters O2 = uniform_noise_cvip(I,noise_parameter); O3 = uniform_noise_cvip([],noise_parameter, image_size); % Display input image figure; imshow(I);title('Input Image'); % Display output image figure; imshow(hist_stretch_cvip(O1,0,1,0,0));title('Output Image-Default parameters'); figure; imshow(hist_stretch_cvip(O2,0,1,0,0));title('Output Image with Mean=20 and Variance = 100'); figure; imshow(hist_stretch_cvip(O3,0,1,0,0));title('Output Image with Height=300 and Width = 400');
CREDITS
Author: Norsang Lama, April 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website