PANDORE Version 6 GREYC-IMAGE

psnr



Computes the Signal-to-Noise Ratio.



Synopsis

psnr [im_in1|-] [im_in2|-]

Description

psnr measures the ratio between the meaningful information and the noise in an image. It is computed from the two input images: im_in1 is the initial image that contains the signal and noise and im_in2 is the restored or enhanced version of im1_in that is supposed to contain only meaningful information.
Consequently, the higher is the SNR, the better is the signal and better is the related image processing (restoration or enhancement).

Because many signals have a very wide dynamic range, SNR is expressed in terms of decibel (dB).

SNR is defined as follows:

    S = 10*log10(R12)
    R12 = sum {(ims1)2} / sum (ims2-ims1)2}

Input images im_in1 and im_in2 must have the same dimensions and the same type.

For color or multispectral images, the definition of SNR is the same except that each sum uses all bands.

Note: R12 is dependent not only on the difference ims1-ims2, but also on ims1. Thus, the signal-to-noise ratio value is dependent to input images and is often used for processing comparison with the same input images.

Inputs

Example

Computes the SNR after a meanfilter smoothing:

   pmeanfiltering 2 tangram.pan i1.pan
   psnr tangram.pan i1.pan
   pstatus

Result

Returns the ratio value as a positive real value expressed in dB.
(Use pstatus to get this value).

See also

Evaluation, pmse, ppsnr

C++ prototype

Errc PSNR( const Img2duc &im_in1, const Img2duc &im_in2 );

Version française

Calcul du rapport signal sur bruit.


Author: Régis Clouard