SSIM {SpatialPack} | R Documentation |
Structural similarity index
Description
This function computes the structural similarity index (SSIM) proposed by Wang et al. (2004).
Usage
SSIM(x, y, alpha = 1, beta = 1, gamma = 1, eps = c(0.01, 0.03), L = 255)
Arguments
x |
reference image matrix (grayscale) |
y |
distorted image matrix (grayscale) |
alpha |
weight associated with luminance, default value is |
beta |
weight associated with contrast, default value is |
gamma |
weight associated with structure, default value is |
eps |
rescaling constants, by default |
L |
dynamic range of the images, by default |
Value
A list containing the following components:
SSIM |
structural similarity index between images |
coefficients |
weights ( |
comps |
components of |
stats |
sample statistics (means, variances and covariance) for each image. |
speed |
Running time taken by the procedure. |
References
Wang, Z., Bovik, A.C. (2002). A universal image quality index. IEEE Signal Processing Letters 9, 81-84.
Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P. (2004). Image quality assessment: From error visibility to structural similarity. IEEE Transactions on Image Processing 13, 600-612.
Examples
data(texmos2)
y <- imnoise(texmos2, type = "gaussian")
plot(as.raster(y))
o <- SSIM(texmos2, y)
o
y <- imnoise(texmos2, type = "speckle")
plot(as.raster(y))
o <- SSIM(texmos2, y)
o