help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculation of the PSNR


From: Stefan van der Walt
Subject: Re: Calculation of the PSNR
Date: Tue, 24 Aug 2004 08:42:00 +0200
User-agent: Mutt/1.5.6+20040722i

Hi Jean-Michel

The figure that you are really interested in is the root mean squared error.

If you have one image with noise, Z(x,y) and one without, I(x,y), the
mean square error can be calculated as

MSE = sum_x sum_y [ ( Z(x,y) - I(x,y) )^2 ] / N

with N being the number of pixels in Z. The root mean squared error is
simply sqrt( MSE ).

The peak signal-to-noise ratio now allows you to normalise the RMSEs
for different bitdepths:

PSNR = 20 log10( (2^bitdepth - 1) / RMSE ),

which is useful when making comparisons.

Also see: The Scientist and Engineer's Guide to Digital Signal
Processing (http://www.dspguide.com/pdfbook.htm)

Regards
Stefan

On Sun, Aug 22, 2004 at 04:25:33AM -0700, Jean-Michel besnard wrote:
> Hi,
> 
> I wish to calculate the PSNR of two images. In the literature the calculation
> is defined as follows:
> 
> PSNR = 10 * log10( (max(max(p_image)))^2 ) / mean square error
> 
> although, some references say that if the image is coded in 8 bits, then the
> maximum coefficient of the image matrix should automatically be 255.
> 
> I have images where the maximum coefficient is below 255 and wonder if I 
> should
> still be using 255 as the maximum or instead the actual maximum coefficient.
> 
> Cheers,
> 
> Jean-Michel
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]