Peak Signal to Noise Ratio

by

 

The MSE calculated by averaging the squared intensity differences of distorted and reference image

Qualite=psnr(ImRef,ImDis)
function Qualite=psnr(ImRef,ImDis)
ImRef=double(ImRef);
ImDis=double(ImDis);
if (mean2((ImRef-ImDis).^2)~=0)
    x=max(max(ImRef))^2;
Qualite=10*log10(x/mean2((ImRef-ImDis).^2));
else 
    
    Qualite=0;
end;

return

Contact us