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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user