PSNR

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

PSNR

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PSNR

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: PSNR

Post 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
Post Reply