Peak signal to noise ration calculation used as following areas,
A = imread('input.jpg');
B = imread(output.jpg');
max2_A = max(max(A));
max2_B = max(max(B));
min2_A = min(min(A));
min2_B = min(min(B));
if max2_A > 255 || max2_B > 255 || min2_A < 0 || min2_B < 0
error('input matrices must have values in the interval [0,255]')
end
error_diff = A - B;
decibels = 20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR = +%5.2f dB',decibels))
In above PSNR code only used in Image processing area.
- Image Compression
- Watermarking
- Signal processing
A = imread('input.jpg');
B = imread(output.jpg');
max2_A = max(max(A));
max2_B = max(max(B));
min2_A = min(min(A));
min2_B = min(min(B));
if max2_A > 255 || max2_B > 255 || min2_A < 0 || min2_B < 0
error('input matrices must have values in the interval [0,255]')
end
error_diff = A - B;
decibels = 20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR = +%5.2f dB',decibels))
In above PSNR code only used in Image processing area.
Related Search : Matlab PSNR calculation Example code , Matlab Peak Signal to Noise Ration calcylation,PSNR matlab code.Matlab Image PSNR Calculation.