How to calculate PSNR and MSE in Matlab?
mse = sum(sum(squaredErrorImage)) / (rows * columns); % Calculate PSNR (Peak Signal to Noise Ratio) from the MSE according to the formula. PSNR = 10 * log10( 256^2 / mse);
How do you calculate PSNR?
Express the PSNR in decibels. From Step 1, we have the decibel value LdB as LdB = 10 log10 (P1/P0). Now let P1 = MAX^2 and P0 = MSE. We then have PSNR = 10 log10(MAX^2/MSE) = 10 log10(MAX/(MSE)^(1/2))^2 = 20 log10(MAX/(MSE)^(1/2)).
Should PSNR be high or low?
The PSNR block computes the peak signal-to-noise ratio, in decibels, between two images. This ratio is used as a quality measurement between the original and a compressed image. The higher the PSNR, the better the quality of the compressed, or reconstructed image.