diff --git a/Base/include/Image.h b/Base/include/Image.h index a8c8fb3..cd81d9b 100644 --- a/Base/include/Image.h +++ b/Base/include/Image.h @@ -106,8 +106,8 @@ namespace FasTC { } double ComputePSNR(Image *other); - double ComputeMSSIM(Image *other) const; - + double ComputeMSSIM(Image *other); + // Function to allow derived classes to populate the pixel array. // This may involve decompressing a compressed image or otherwise // processing some data in order to populate the m_Pixels pointer. diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index 3607216..de8f2ac 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -222,6 +222,7 @@ template static Image FilterValid(const Image &img, uint32 size, double sigma) { assert(size % 2); Image gaussian(size, size); + GenerateGaussianKernel(gaussian, size, sigma); Image tmp = img; tmp.Filter(gaussian); @@ -237,7 +238,7 @@ static Image FilterValid(const Image &img, uint32 size, do } template -double Image::ComputeMSSIM(Image *other) const { +double Image::ComputeSSIM(Image *other) { if(!other) { return -1.0; } @@ -247,6 +248,9 @@ double Image::ComputeMSSIM(Image *other) const { return -1.0; } + ComputePixels(); + other->ComputePixels(); + double C1 = (0.01 * 255.0 * 0.01 * 255.0); double C2 = (0.03 * 255.0 * 0.03 * 255.0);