Image Processing Noise differences

조회 수: 13 (최근 30일)
UJJWAL
UJJWAL 2011년 12월 19일
이동: DGM 2023년 2월 20일
Hi,
Suppose I want to add white gaussian noise to an image. I propose to do by following means :-
a) imnoise(I,'gaussian',0,0.25);
b) I = awgn(I,var(I(:))/0.25);
c) I = I + 0.25*randn(size(I));
Here I is a certain image.
What is difference between using the above statements ??

채택된 답변

Wayne King
Wayne King 2011년 12월 19일
J = imnoise(I,'gaussian',0,0.25);
J = I+0.5*randn(size(I));
For awgn(), your function syntax assumes the power of the input is 0 dBW, so you would need to do.
denom = -(var(I(:))/(10*log10(0.25)));
I = awgn(I,var(I(:))/denom);

추가 답변 (2개)

Wayne King
Wayne King 2011년 12월 19일
Hi, in
I = I +0.25*randn(size(t));
you get noise with a standard deviation of 0.25, not variance. If you want noise with a variance of 0.25, then you must do
I = I +0.5*randn(size(t));
that would be equivalent to:
imnoise(I,'gaussian',0,0.25);
The variance of a constant times a random variable is the constant squared times the variance of the random variable.
Finally, the actual variance of the additive Gaussian noise in:
I = awgn(I,var(I(:))/0.25);
depends on I, so it's not clear that you are really getting a variance of 0.25. For example:
I = randn(256,256);
Because var(I(:)) = 1.0551 (in this particular example)
Your call of
I = awgn(I,var(I(:))/0.25);
results in an additive WGN process with variance:
10^(-4.2203/10) = 0.3784
which is greater than you think.
  댓글 수: 1
UJJWAL
UJJWAL 2011년 12월 19일
이동: DGM 2023년 2월 20일
Ok . So suppose the problem is to add a noise with a variance of 0.25 and mean of 0 and the noise is gaussian and additive.
What are the equivalent statements using imnoise, awgn and the first one to introduce such a noise ??

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


Shaveta Arora
Shaveta Arora 2016년 2월 24일
How to add gaussian noise of variance 10 by both methods?
  댓글 수: 1
Image Analyst
Image Analyst 2016년 2월 24일
Hint from the help:
Create a vector of 1000 random values drawn from a normal distribution with a mean of 500 and a standard deviation of 5.
a = 5;
b = 500;
y = a.*randn(1000,1) + b;
For you, a would be sqrt(10) and b would be 0, so
[rows, columns] = size(grayImage);
noisyArray = sqrt(10)*randn(rows, columns);
output = double(grayImage) + noisyArray;

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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by