필터 지우기
필터 지우기

why I am getting Inf as result of PSNR?

조회 수: 18 (최근 30일)
Eliza
Eliza 2017년 12월 12일
댓글: Walter Roberson 2023년 2월 7일
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

채택된 답변

Image Analyst
Image Analyst 2017년 12월 12일
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
Manar
Manar 2023년 2월 7일
Hi Eliza,
Did you find how to represent (Inf) as value?
I need it for my research purpose.
Thank you
Walter Roberson
Walter Roberson 2023년 2월 7일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by