An image quality metric that assesses the visual
impact of three characteristics of an image: luminance, contrast and
structure.

The Structural Similarity (SSIM) Index quality assessment index
is based on the computation of three terms, namely the luminance term,
the contrast term and the structural term. The overall index is a
multiplicative combination of the three terms.

$$SSIM(x,y)={[l(x,y)]}^{\alpha}\cdot {[c(x,y)]}^{\beta}\cdot {[s(x,y)]}^{\gamma}$$

where

$$\begin{array}{l}l(x,y)=\frac{2{\mu}_{x}{\mu}_{y}+{C}_{1}}{{\mu}_{x}^{2}+{\mu}_{y}^{2}+{C}_{1}},\\ c(x,y)=\frac{2{\sigma}_{x}{\sigma}_{y}+{C}_{2}}{{\sigma}_{x}^{2}+{\sigma}_{y}^{2}+{C}_{2}},\\ s(x,y)=\frac{{\sigma}_{xy}+{C}_{3}}{{\sigma}_{x}{\sigma}_{y}+{C}_{3}}\end{array}$$

where μ_{x}, μ_{y},
σ_{x},σ_{y}, and
σ_{xy} are the local means, standard deviations,
and cross-covariance for images *x, y*. If α
= β = γ = 1 (the default for Exponents), and C_{3} =
C_{2}/2 (default selection of C_{3})
the index simplifies to:

$$SSIM(x,y)=\frac{(2{\mu}_{x}{\mu}_{y}+{C}_{1})(2{\sigma}_{xy}+{C}_{2})}{({\mu}_{x}^{2}+{\mu}_{y}^{2}+{C}_{1})({\sigma}_{x}^{2}+{\sigma}_{y}^{2}+{C}_{2})}$$