Register now or log in to join your professional community.
you can use imnoise function
There is a different type of command in the Matlab, noise may be anything which disturbs the intensity of noise. If there is a white pixel in the black image then that would be noise for that image.
the command is-
rand(image);
imnoise();
In the Image processing, We have add the noise in the form of "Salt and Pepper" with the added noise ratio.
for adding noise in an image, we have a built in command 'imnoise'. There are varous type of noises; such as poisson noise,salt and pepper noise, gaussian noise. by specifying the type of noise in built in command,required noise can be added in an image.
command will be
i=imread('name of the image.image type');
n=imnoise(i,'poisson');
subplot(2,2,1)
imshow(i)
subplot(2,2,2)
imshow(n)
You may use the function rand().
noise can be included to an image by generating random numbers from gaussian distribution with 0 mean and some variance our interest and adding these numbers to the original values of the image.
Simply apply a Gussian blurr,Erode or set intensity to the pixels.
clc
clear
close all
i=imread('C:\\Users\\mhammad\\Desktop\\images\\trees.jpg');
i=rgb2gray(i);
i=double(i)/255;
n=imnoise(i,'salt & pepper');
subplot(211)
imshow(i)
subplot(212)
imshow(n)
Iis a 256-by-256 matrix of 8-bit unsigned integer values.
The model provided with this example already includes this code in file>Model Properties>Model Properties>InitFcn, and executes it prior to simulation.