Xmean=mean(mean(I))*ones(size(I))
segma2=sum(sum((I-Xmean).^2))/prod(size(I))
D=sum(sum((I-I2).^2))/prod(size(I2))
SNR=10*log10(segma2/D)%%%%% 信噪比 (SNR:Signal to Noise Ratio)
PSNR=10*log10(255^2/D)%%%%% 峰值信噪比(PSNR:Peak Signal to Noise Ratio)
8、加权递推平兄亩老均滤波法/*
coe数组为加权系数耐历表,存羡升在程序存储区。*/
#define
N
12
char
code
coe[N]
=
{1,2,3,4,5,6,7,8,9,10,11,12}
char
code
sum_coe
=
1+2+3+4+5+6+7+8+9+10+11+12
char
filter()
{
char
count
char
value_buf[N]
int
sum=0
for
(count=0,count<Ncount++)
{
value_buf[count]
=
get_ad()
delay()
}
for
(count=0,count<Ncount++)
sum
+=
value_buf[count]*coe[count]
return
(char)(sum/sum_coe)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)