diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index ea18b36..7240e7a 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -316,6 +316,11 @@ double Image::ComputeSSIM(Image *other) { const uint32 filterSz = 11; const double filterSigma = 1.5; + if(img1.GetWidth() < filterSz || img1.GetHeight() < filterSz || + img2.GetWidth() < filterSz || img2.GetHeight() < filterSz) { + return -1.0; + } + Image mu1 = FilterValid(img1, filterSz, filterSigma); Image mu2 = FilterValid(img2, filterSz, filterSigma);