Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ MSE, PSNR ] = msepsnr( img1 , img2 )
- [M N] = size(img1);
- error = double(img1) - double(img2);
- MSE = sum(sum(error .^2)) / (M * N);
- if(MSE > 0)
- PSNR = 10*log10((255.^2)/MSE);
- else
- PSNR = inf;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement