@UnstableApi
class MssimCalculator


Image comparison tool that calculates the Mean Structural Similarity (MSSIM) of two images, developed by Wang, Bovik, Sheikh, and Simoncelli.

MSSIM divides the image into windows, calculates SSIM of each, then returns the average.

See the SSIM paper.

Summary

Public functions

java-static Double
calculate(
    referenceBuffer: ByteArray!,
    distortedBuffer: ByteArray!,
    width: Int,
    height: Int
)

Calculates the Mean Structural Similarity (MSSIM) between two images with window skipping.

java-static Double
calculate(
    referenceBuffer: ByteArray!,
    distortedBuffer: ByteArray!,
    width: Int,
    height: Int,
    enableWindowSkipping: Boolean
)

Calculates the Mean Structural Similarity (MSSIM) between two images.

Public functions

calculate

java-static fun calculate(
    referenceBuffer: ByteArray!,
    distortedBuffer: ByteArray!,
    width: Int,
    height: Int
): Double

Calculates the Mean Structural Similarity (MSSIM) between two images with window skipping.

See also
calculate

calculate

java-static fun calculate(
    referenceBuffer: ByteArray!,
    distortedBuffer: ByteArray!,
    width: Int,
    height: Int,
    enableWindowSkipping: Boolean
): Double

Calculates the Mean Structural Similarity (MSSIM) between two images.

The images are split into a grid of windows. For each window, the structural similarity (SSIM) is calculated. The MSSIM returned from this method is the mean of these SSIM values. If window skipping is enabled, only every other row and column are considered, thereby only one in four windows are evaluated.

Parameters
referenceBuffer: ByteArray!

The luma channel (Y) buffer of the reference image.

distortedBuffer: ByteArray!

The luma channel (Y) buffer of the distorted image.

width: Int

The image width in pixels.

height: Int

The image height in pixels.

enableWindowSkipping: Boolean

Whether to skip every other row and column when evaluating windows for SSIM calculation.

Returns
Double

The MSSIM score between the input images.