I have this image:
I want to calculate SNR in it. For this i used code:
img=imread('noicy.JPG');
img=double(img(:));
ima=max(img(:));
imi=min(img(:));
ims=std(img(:));
snr=20*log10((ima-imi)./ims)
Is that correct code to calculate SNR?
The definition of SNR can be found here or here :
Both the standard and the industry definition can be used ( 10log(x)
and 20log(x)
). check this
now, the signal
is equal to the mean of the pixel values ( mean(img(:))
) and the noise
is the standard deviation or error value of the pixel values ( std(img(:))
).
You may use either the ratio or the SNR=10*log10(signal/noise)
to express the result in decibel.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.