Serwan Bamerni
Member level 2
Hi everyone
I am trying to add noise of 5dB to an image in matlab according to the following steps
where Io is the readed original image
but when I measure the SNR by using the matlab command
I get SNR equal 10. So, what is the wrong in my code? and why the result differ from my add dB?
I am trying to add noise of 5dB to an image in matlab according to the following steps
Code:
SNR = 5;
Im = double(Io) / 255;
vm = var(Im(:)) / 10^(SNR/10);
I_my_noisy = imnoise(Im, 'gaussian', 0, vm);
where Io is the readed original image
but when I measure the SNR by using the matlab command
Code:
[peaksnr,snr] = psnr(I_my_noisy, Im)
I get SNR equal 10. So, what is the wrong in my code? and why the result differ from my add dB?