mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-22 10:54:01 +00:00
Be a little more defensive about calculating SSIM
This commit is contained in:
parent
c8e19252e3
commit
edfc6bde78
1 changed files with 5 additions and 0 deletions
|
@ -316,6 +316,11 @@ double Image<PixelType>::ComputeSSIM(Image<PixelType> *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<IPixel> mu1 = FilterValid(img1, filterSz, filterSigma);
|
||||
Image<IPixel> mu2 = FilterValid(img2, filterSz, filterSigma);
|
||||
|
||||
|
|
Loading…
Reference in a new issue