在MATLAB中计算单个图像中的SNR [英] Calculate SNR in single image in MATLAB

查看:1243
本文介绍了在MATLAB中计算单个图像中的SNR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这张图片:

我想计算其中的SNR。对于我使用的代码:

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)

是吗正确的代码来计算SNR?

Is that correct code to calculate SNR?

推荐答案

可以找到SNR的定义这里这里

The definition of SNR can be found here or here:

可以使用标准和行业定义( 10log(x) 20log(x))。现在检查

Both the standard and the industry definition can be used (10log(x) and 20log(x)). check this

信号等于像素值的平均值( mean(img(:)))和 noise 是像素值的标准偏差或误差值( std(img(:)))。

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(:))).

您可以使用比率或 SNR = 10 * log10(信号/噪音)以分贝表示结果。

You may use either the ratio or the SNR=10*log10(signal/noise) to express the result in decibel.

这篇关于在MATLAB中计算单个图像中的SNR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆