How do I add noise to a color image without using imnoise function?
2 views (last 30 days)
Show older comments
is it possible to create noise in a color image without using imnoise function?
Answers (2)
Image Analyst
on 17 Apr 2013
Yes, you could use rand(), or just write any nonsense into the image that is not the image, such as
if yourImage(row, column) ~= 42
yourImage(row, column) = 42; % I just created noise!
end
0 Comments
Deepak Dhillon
on 8 Jul 2019
Hi Arun,
To add awgn noise (mean = 0, standard deviation = 30) to a colored image without using imnose() function:
You can add the awgn noise of mean = 0, standard deviation = 30 to each of Red, Green, and Blue channels independently; and then combine the noisy channels to form the colored noisy image.
I tried with both the methods (imnoise and independently), I got the same result.
2 Comments
Image Analyst
on 8 Jul 2019
Arun:
If you're not allowed to use imnoise(), are you allowed to use ANY built-in function, such as rand(), randn(), or awgn()?
Deepak Dhillon
on 9 Jul 2019
Hi Arun,
rand() and randn() are very basic functions. They can be found in every scientific engineering module of a programing language. You should use these.
But awgn() and imnoise() are not very basic functions. They may not be present in some language's library. You can avoid their use, if you want.
Also rand() and randn() are random number generator functions. Writing these functions on our own could be a tedious task and a project in its own. I would suggest you to never hesitate using these two build-in functions.
See Also
Categories
Find more on Motor Drives 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!