File Exchange

image thumbnail

PSNR for RGB images

version 1.2 (166 KB) by

PSNR for 2 RGB signals, (Peak Signal to Noise Ratio ) evaluated in dB.

8 Downloads

Updated

View License

The function, PSNR_RGB( X,Y) computes the PSNR for two RGB images using the formula :

MSE(X,Y)=SUM(1,n)SUM(1,m)SUM(1,p) [X(i,j,k)-Y(i,j,k)]²

d= max(max(X),max(Y))|

PSNR(X,Y)=10.log( d.^2 / MSE)

with p=3, as three channels red, green and blue,

The code can be altered for gray scale image sequences , or Volume of pixels M(n,m,p) ( p > 3 ) .

Some results are in the pdf file " PSNR_RGB.pdf " for discussion .

Comments and Ratings (2)

vu

vu (view profile)

sorry log or log10?

chen

chen (view profile)

??? Function 'log' is not defined for values of class 'uint8'.

add double
y=10*log(double(d.^2)./sigma);

Updates

1.2

Screenshot added.

MATLAB Release
MATLAB 7.4 (R2007a)
Acknowledgements

Inspired by: PSNR, tspsa

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video