MATLAB Answers

How to add uniform noise to image with median and standard deviation

조회 수: 45(최근 30일)
Mahabba Almheiri
Mahabba Almheiri 15 Apr 2021 20:24
편집: Matt J 15 Apr 2021 23:46
what is the direct command for "uniform noise" with specific median and standard deviation, for example if the median =40 and the standard deviation=20 how can I write the noise command to add noise to the following code of original image:
thank you

채택된 답변

Matt J
Matt J 15 Apr 2021 20:54
편집: Matt J 15 Apr 2021 20:59
I've never heard of "noise" with non-zero mean/median, but generating it is straightforward,
noiseTerm = (rand(size(I))-1/2)*delta + Median;
I = I + noiseTerm;
You can also use unifrnd() if you have the Statistics and Machine Learning Toolbox.
noiseTerm = unifrnd(Median-delta/2 , Median+delta/2, size(I));
  댓글 수: 3
William Rose
William Rose 15 Apr 2021 23:21
@Mahabba Almheiri, @Matt J is right. IN case it is not obvious, what Matt is doing is scaling up the range foe the uniform noise so it will have the standard deviaiton you want it to have. Uniform noise that ranges from A to B (range=B-A) has a standard deviation
Like @Matt J, I don;t understand the use of "median" here. It is just adding a constant "brightness" to the whole image. Are you worried about negative values when you add noise?

댓글을 달려면 로그인하십시오.

추가 답변(0개)


Community Treasure Hunt

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

Start Hunting!

Translated by