How can you add white noise of a specified magnitude to a colored image?

2 views (last 30 days)
How can you add white noise of a specified magnitude to an RGB image? I am trying to use imnoise on each individual channel, but I feel like that will produce colored noise. Is that true, or should it come out white? Also, I am using a slider and my range is way off for the magnitude (-255 to 255). What is a suitable range?
Here is what I have at the moment:
val2 = noiseadditiondropdown.Value;
if size(image2,3)==3
redchannel = image2(:,:,1);
greenchannel = image2(:,:,2);
bluechannel = image2(:,:,3);
switch val2
case 2 %White noise addition
redchannel = image2(:,:,1);
greenchannel = image2(:,:,2);
bluechannel = image2(:,:,3);
noisyredchannel = imnoise(redchannel,'gaussian',whitenoiseslider.Value);
noisygreenchannel = imnoise(greenchannel,'gaussian',whitenoiseslider.Value);
noisybluechannel = imnoise(bluechannel,'gaussian',whitenoiseslider.Value);
image1(:,:,1) = noisyredchannel;
image1(:,:,2) = noisygreenchannel;
image1(:,:,3) = noisybluechannel;
axes(axes1);
imshow(image1);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!