How do I add noise to a color image without using imnoise function?
조회 수: 4 (최근 30일)
이전 댓글 표시
is it possible to create noise in a color image without using imnoise function?
답변 (2개)
Image Analyst
2013년 4월 17일
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
Deepak Dhillon
2019년 7월 8일
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
Image Analyst
2019년 7월 8일
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
2019년 7월 9일
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!