📄 pnsr.cpp
字号:
#include "stdafx.h"
#include "pnsr.h"
long double imgpnsr(ptype **P, ptype **P2, unsigned int height, unsigned int width){
//int pxmax=0;
//for(int i=0;i<=m;i++)
//{
// for(int j=0;j<=n;j++)
// {
// pxmax=max(pxmax,P[i][j]);
// }
//}
unsigned long temp=0;
//cout<<temp<<endl;
for(unsigned int i=0;i<height; i++)
for(unsigned int j=0;j<width; j++)
temp+=(P[i][j]-P2[i][j])*(P[i][j]-P2[i][j]);
//cout<<m<<endl<<n<<endl;
//cout<<temp<<endl;
long double pnsr=10.0*log10(long double(255*255*height*width/temp));
//cout<<pnsr<<endl;
return pnsr;
}
void testpnsr(){
//double pnsr;
//pnsr=imgpnsr();
//cout<<pnsr<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -