This function displays the PSNR (peak signal-to-noise ratio) between two images. The answer is in decibels (dB).
PSNR is very common in image processing. A sample use is in the comparison between an original image and a coded/decoded image. Typical quoted PSNR figures are in the range +25 to +35dB.
The syntax for this file is PSNR(A,B), where A and B are MATLAB Intensity Images, with matrix-elements in the interval [0,1]
The function can be adapted for images with 256 gray levels.
Can any one pls mail me the code to plot the graph between bit per pixel and psnr..my mail id is email@example.com
Excellent and thanks
img1 = im2double(imread('img1.bmp'));
img2 = im2double(imread('img2.bmp'));
PSNR = 10*log10(1/mean((img1(:)-img2(:)).^2));
compare mine coding with yours which one is correct?
i want the psnr mat lab code
good thank u
I don't have time to do something better, but rather use that code, which may not be perfect, but which is already more general :
Very poor implementation. It just works for images, peak is fixed to one. Rather than max(max(A)), the author should prefer max(A(:)) which works for images in any dimension.
good... we calculate PSNR with signals normalized.
This PSNR is not accurate!!
Peak is always fixed at 1.
what if the two images are not between [0,1]
Simple and fast
easy to understand and implement. good idea to can this.
Nice. Well commented.
very simple and effective
I highly Apprciate it
3 PSNR values are shown.
Are they the PSNR of YUV or RGB?
This is Ok, not perfect, but suitable for use
Improved some code, to prevent M-Lint messages in MATLAB's Code Metrics.