mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-08 05:45:27 +00:00
Be a little more defensive about calculating SSIM
This commit is contained in:
parent
c8e19252e3
commit
edfc6bde78
|
@ -316,6 +316,11 @@ double Image<PixelType>::ComputeSSIM(Image<PixelType> *other) {
|
||||||
const uint32 filterSz = 11;
|
const uint32 filterSz = 11;
|
||||||
const double filterSigma = 1.5;
|
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> mu1 = FilterValid(img1, filterSz, filterSigma);
|
||||||
Image<IPixel> mu2 = FilterValid(img2, filterSz, filterSigma);
|
Image<IPixel> mu2 = FilterValid(img2, filterSz, filterSigma);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue