Saturday, 31 March 2012

Matlab PSNR calculation Example code | Matlab Peak Signal to Noise Ration calcylation

Peak signal to noise ration calculation used as following areas,
  1. Image Compression
  2. Watermarking
  3. Signal processing
and more areas its used.PSNR Matlab code as follows

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.

Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...