how to implement a MATLAB function to add Gaussian noise ?

I need to implement a function in Matlab to add Gaussian noise to an image let's say cameraman.tif but without using imnoise
Thanks in advance

回答 (3 件)

Rick Rosson
Rick Rosson 2012 年 4 月 7 日

0 投票

function y = addWhiteNoise(x,snr)
%
% snr is the signal-to-noise ratio expressed in decibels
%
stdev = ...
z = stdev*randn(size(x));
y = x + z;
end

2 件のコメント

mina
mina 2012 年 4 月 7 日
thanks for your help.
but this is what i need to do exactly:-
implement a MATLAB function to add Gaussian noise to the image “Cameraman.tif” and compute the signal-to-noise ratio (SNR)
Walter Roberson
Walter Roberson 2012 年 4 月 7 日
Okay, go ahead and do that.

サインインしてコメントする。

Rick Rosson
Rick Rosson 2012 年 4 月 7 日

0 投票

Hi Mina,
What have you done so far? Please post your code.
Thanks!
Rick

質問済み:

2012 年 4 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by