Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function psnr_out = calculate_psnr(f, g)
- df = double(f);
- dg = double(g);
- [m, n] = size(df);
- mse = sum((df - dg).^2, 'all') / (m*n);
- ratio = max(df(:))^2 / mse;
- psnr_out = 10*log10(ratio);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement