1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +04:00

Updated Tutorial PSNR for identical images

This commit is contained in:
D00E
2025-10-02 00:03:28 +01:00
parent e9bded6ff3
commit acc76304d5
3 changed files with 24 additions and 27 deletions
@@ -144,8 +144,8 @@ double getPSNR(const Mat& I1, const Mat& I2)
double sse = s.val[0] + s.val[1] + s.val[2]; // sum channels
if( sse <= 1e-10) // for small values return zero
return 0;
if( sse <= 1e-10) // For very small values, return 360 to cap PSNR (theoretical value is infinity)
return 360.0;
else
{
double mse = sse / (double)(I1.channels() * I1.total());