S+PNoise

Add salt and pepper noise to the input image

 

function call:

[out_img1]=vsg('S+PNoise',in_img1,num1);

 

Arguments:

in_img1 input image, 3 channel RGB, 1 channel greyscale or binary image, or DICOM image.

num1 – a double which specifies the fraction of the image that should be covered with salt and pepper noise, range {0.0-1.0}.

 

Description:

out_img1 – An image which has dimensions the same as the input image. This is the input image with salt and pepper noise added.

 

Example:

img = openimage('lake.jpg');

h=figure; image(img);set(h,'Name','Input Image');

[out_img1]=vsg('S+PNoise',img,0.01);

h=figure; image(uint8(out_img1));set(h,'Name','Noisy Image');

 

Notes:

1. For DICOM images, the function operates on all slices separately.

2. For RGB images, the function operates on all colour planes separately.

Home    Functions   Back