matlab code to generate background noise in a color image
2 次查看(过去 30 天)
显示 更早的评论
provide the code to generate background noise ie, white spot like in a color image
0 个评论
回答(2 个)
Image Analyst
2013-5-19
Were my responses in your duplicate question http://www.mathworks.com/matlabcentral/answers/76170-how-to-generate-background-noise-in-a-color-image not what you were looking for? You could have continued the discussion there instead of posting a new question like it's brand new.
0 个评论
Michael Nauheimer
2013-5-19
How much noise is wanted? And do you want Gaussian white noise or just random noise?
If you image data is saved in A, I would say you could add Gaussian white noise by doing as shown below.
thesize = size(A);
noisesize = 20; % You choose!
for i = 1:3;
Y(:,:,i) = uint8(double(A(:,:,i))+wgn(thesize(1),thesize(2),noisesize));
end
And then you output data should be in Y with white noise added.
1 个评论
Image Analyst
2013-5-19
No, he wants salt and pepper noise like he stated in the duplicate of this: http://www.mathworks.com/matlabcentral/answers/76170-how-to-generate-background-noise-in-a-color-image
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!