Adding Noise to the Image
Show older comments
How do I apply "salt" noise to the grey - scale image. Function need to generate salt noise only not the pepper.
Accepted Answer
More Answers (1)
Arun Kumar
on 17 Jul 2014
1 vote
%Prepare workspace
clear ; clc; close all;
%Read Imag
I=imread('cameraman.tif');
%create a random matrix
randM=rand(size(I));
% default density
d=.05;
%saturated value
randM(randM<d)=255;
%Add noise
I=uint8(double(I)+randM);
%show image
imshow(I)
Categories
Find more on Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!