Page 1 of 1

PSNR

Posted: 2008-08-19T19:35:38-07:00
by el_supremo
Comparing identical images with the PSNR metric results in 1.#INF - should this be 1.0, or infinity?
e.g.

Code: Select all

compare -metric PSNR logo: logo: null:
1.#INF
Pete

Re: PSNR

Posted: 2008-08-19T20:54:08-07:00
by fmw42
I believe that it correct, representing infinity. See Anthony's compare page at http://www.imagemagick.org/Usage/compare/#compare. At the bottom he has the definition of the various measures.

PSNR .... Peak Signal to noise ratio (used in image compression papers)
The ratio of mean square difference to the maximum mean square
that can exist between any two images, expressed as a decibel
value. The higher the PSNR the closer the closer the images
are, with a maximum difference occurring at 1.
A PSNR of 20 means differences are 1/100 of maximum.


So values should range from 1 for most different to infinity for exactly the same. Due to use of decibel. See http://en.wikipedia.org/wiki/Decibel

Re: PSNR

Posted: 2008-08-20T07:34:16-07:00
by el_supremo
I've just checked Microsoft's docs for fprintf. The %g format (used by compare) prints
1.#INFrandom-digits
if the value is plus infinity.

Pete