Clear Filters
Clear Filters

why I am getting Inf as result of PSNR?

18 views (last 30 days)
I used PSNR to compare between the extracted watermark(wex.jpg) and the original watermark (msg.jpg) the result is Inf could any one help me to know why and fix the result please ? the images are uploaded I used default psnr

Accepted Answer

Image Analyst
Image Analyst on 12 Dec 2017
Since the definition is
PSNR=10log10(peakval^2/MSE)
and the MSE is zero if the two images are identical, then why does that surprise you? YOu know that one over zero is infinity, right? And that log of infinity is also infinity? What do you think it should be?
  4 Comments
Manar
Manar on 7 Feb 2023
Hi Eliza,
Did you find how to represent (Inf) as value?
I need it for my research purpose.
Thank you
Walter Roberson
Walter Roberson on 7 Feb 2023
percentage_identical = mean2(Image1 == Image2) * 100
However, you have to think about whether this is what you want if you are comparing color images. If you have two images, and the red and green panes are identical between the two images, but the blue plane differs for some locations, then are you okay with "red identical" and "blue identical" count as +2 out of a possible +3 available for that pixel? Or do you want to say that the pixel should not be considered at all identical if any of the color panes are different?
percentage_identical = mean2(all(Image1 == Image2,3)) * 100

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!