multissim

Multiscale structural similarity (MS-SSIM) index for image quality

Description

example

score = multissim(I,Iref) calculates the multi-scale structural similarity (MS-SSIM) index, score, for image I, using Iref as the reference image.

The structural similarity (SSIM) index measures perceived quality by quantifying the SSIM between an image and a reference image (see ssim). This function calculates the MS-SSIM index by combining the SSIM index of several versions of the image at various scales. The MS-SSIM index can be more robust when compared to the SSIM index with regard to variations in viewing conditions.

[score,qualitymaps] = multissim(I,Iref) also returns the local MS-SSIM index value for each pixel in each scaled version of I. The qualitymap output is a cell array containing maps for each of the scaled versions of I. Each quality map is the same size as the corresponding scaled version of I.

[score,qualitymaps] = multissim(I,Iref,Name,Value) specifies options, using one or more name-value arguments. These options control aspects of the computation. For example, use the 'NumScales' argument to specify the number of scaled versions.

Examples

collapse all

Load an image into the workspace.

Iref = imread('pout.tif');

Create a noisy version of the image for comparison purposes.

I = imnoise(Iref,'salt & pepper',0.05);

Display the original image and noisy image.

figure; 
montage({Iref,I}); 

Calculate the MS-SSIM index that measures the quality of the input image compared to the reference image.

score = multissim(I,Iref)
score = single
    0.6732

Load an image into the workspace.

Iref = imread('pout.tif');
I = Iref;

Add noise to a localized part of the image.

I(1:100,1:100) = imnoise(Iref(1:100,1:100),'salt & pepper',0.05);

Display the original image and the noisy image.

figure; 
montage({Iref,I});

Calculate the local MS-SSIM index maps for the noisy image, qualitymaps, using the original image as the reference. The return value, qualitymaps, is a cell array containing a quality map for each of the scaled versions of the image. Each map is the same size as the corresponding scaled version of the image.

[~, qualitymaps] = multissim(I,Iref);
figure
montage(qualitymaps,'Size',[1 5])

Load an image into the workspace.

Iref = imread('pout.tif');

Create a noisy version of the image for comparison purposes.

I = imnoise(Iref,'salt & pepper',0.05);

Display the original image and the noisy version of the image.

figure; 
montage({Iref,I});

Calculate the MS-SSIM index for the noisy image, using the original image as the reference. Specify how much to weigh the local MS-SSIM index calculations for each scaled image, using the 'ScaleWeights' argument. The example uses the weight values defined in the article by Wang, Simoncelli, and Bovik.

score = multissim(I,Iref,'ScaleWeights',[0.0448,0.2856,0.3001,0.2363,0.1333])
score = single
    0.6773

Load an image into the workspace.

Iref = imread('pout.tif');

Create a noisy version of the image for quality measurement comparison purposes.

I = imnoise(Iref,'salt & pepper',0.05);

Display the original image and the noisy image.

figure; montage({Iref,I});

Calculate the MS-SSIM index for the noisy image, using the original image as the reference. Specify a standard deviation value.

score = multissim(I,Iref,'Sigma',1)
score = single
    0.6726

Input Arguments

collapse all

Input image, specified as an M-by-N grayscale image.

Data Types: single | double | int16 | uint8 | uint16

Reference image, specified as an M-by-N grayscale image. The reference image must be the same size and class as the input image.

Data Types: single | double | int16 | uint8 | uint16

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: score = multissim(I,Iref,'NumScales',3);

Number of scales used to calculate the MS-SSIM index, specified as the comma-separated pair consisting of 'NumScales' and a positive integer. Setting 'NumScales' to 1 is equivalent to using the ssim function with its 'Exponents' name-value pair argument set to [1 1 1]. The size of the input image limits the number of scales. The multissim function scales the image (NumScales - 1) times, downsampling the image by a factor of 2 with each scaling.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Relative values across the scales, specified as the comma-separated pair consisting of 'ScaleWeights' and a vector of positive elements. The length of the 'ScaleWeights' vector depends on the number of scales, because each element corresponds to one of the scaled versions of the original image. The multissim function normalizes the 'ScaleWeights' values to 1. By default, the scale weights equal fspecial('gaussian',[1,numScales],1). The multissim function uses a Gaussian distribution as the default because the human visual sensitivity peaks at middle frequencies and decreases in both directions. For an example of setting 'ScaleWeights', see Calculate MS-SSIM Specifying Scale Weights.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Standard deviation of the isotropic Gaussian function, specified as the comma-separated pair consisting of 'Sigma' and a positive number. This value specifies the weighting of the neighborhood pixels around a pixel for estimating local statistics. The multissim function uses weighting to avoid blocking artifacts when estimating local statistics.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

MS-SSIM index for image quality, returned as a numeric scalar. The value of score is typically in the range [0, 1]. The value 1 indicates the highest quality and occurs when I and Iref are equivalent. Smaller values correspond to poorer quality. For some combinations of inputs and name-value pair arguments, score can be negative.

Local MS-SSIM index values for each pixel in each scaled version, returned as a cell array of numeric arrays. Each element in qualitymaps indicates the quality of the corresponding pixel.

Algorithms

The multissim function uses double-precision arithmetic for input images of class double. All other types of input images use single-precision arithmetic.

References

[1] Wang, Z., Simoncelli, E.P., Bovik, A.C. Multiscale Structural Similarity for Image Quality Assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003, 1398–1402. Pacific Grove, CA, USA: IEEE, 2003. https://doi.org/10.1109/ACSSC.2003.1292216.

See Also

|

Introduced in R2020a