Calculate SNR in single image in MATLAB

僤鯓⒐⒋嵵緔 提交于 2019-12-08 01:08:26

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/25699903/calculate-snr-in-single-image-in-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!