You are on page 1of 4

What is noise in digital image.

Noise in an image is the presence of artifacts that do not originate from the original
scene content. Generally speaking, noise is a statistical variation of a measurement
created by a random process. In imaging, noise emerges as an artifact in the image that
appears as a grainy structure covering the image.

Four common types of noises in digital images are:

1. Gaussian noise: This type of noise is caused by random variations in the intensity of each pixel in
the image. It can be caused by electronic interference or thermal noise in the image sensor.
Gaussian noise is usually characterized by a bell-shaped probability distribution.

2. Salt and pepper noise: This type of noise appears as randomly scattered black and white pixels in
the image. It is usually caused by errors in data transmission or faulty image sensors.

3. Speckle noise: This type of noise appears as a grainy texture in the image. It is commonly found
in images obtained through ultrasound or radar imaging.

4. Poisson noise: This type of noise is caused by the random nature of photon arrival in the image
sensor. It is commonly found in low-light images.

1 Adding Gaussian noise and removing it using a Gaussian filter:


Code
% Reading the image
img = imread('asi.jpg');

% Adding Gaussian noise with mean = 0 and variance = 0.01


noisy_img = imnoise(img, 'gaussian', 0, 0.01);

% Applying Gaussian filter to remove noise


filtered_img = imgaussfilt(noisy_img, 2);

% Displaying the original image, noisy image, and filtered image


subplot(1, 3, 1), imshow(img), title('Original Image');
subplot(1, 3, 2), imshow(noisy_img), title('Noisy Image');
subplot(1, 3, 3), imshow(filtered_img), title('Filtered Image');
sacreen short
2 Adding salt and pepper noise and removing it using a median filter:
Code
% Reading the image
img = imread('image.jpg');

% Adding salt and pepper noise with density = 0.05


noisy_img = imnoise(img, 'salt & pepper', 0.05);

% Applying median filter to remove noise


filtered_img = medfilt2(noisy_img, [3, 3]);

% Displaying the original image, noisy image, and filtered image


subplot(1, 3, 1), imshow(img), title('Original Image');
subplot(1, 3, 2), imshow(noisy_img), title('Noisy Image');
subplot(1, 3, 3), imshow(filtered_img), title('Filtered Image');

Sacreen short

3. Adding speckle noise and removing it using a Lee filter:


Code
% Reading the image
img = imread('image.jpg');

% Adding speckle noise with variance = 0.04


noisy_img = imnoise(img, 'speckle', 0.04);

% Applying Lee filter to remove noise


filtered_img = lee_filter(noisy_img);
% Displaying the original image, noisy image, and filtered image
subplot(1, 3, 1), imshow(img), title('Original Image');
subplot(1, 3, 2), imshow(noisy_img), title('Noisy Image');
subplot(1, 3, 3), imshow(filtered_img), title('Filtered Image');
sacreenshort

4 Adding Poisson noise in Matlab

Code

% Reading the image

img = imread('image.jpg');

% Adding Poisson noise with mean = 10

noisy_img = imnoise(img, 'poisson', 10);

% Displaying the original image and the noisy image

subplot(1, 2, 1), imshow(img), title('Original Image');

subplot(1, 2, 2), imshow(noisy_img), title('Noisy Image');

sacreenshort

You might also like