API Reference >> skvideo.measure.ssim
Fork me on GitHub

skvideo.measure.ssim

skvideo.measure.ssim(referenceVideoData, distortedVideoData, K_1=0.01, K_2=0.03, bitdepth=8, scaleFix=True, avg_window=None)[source]

Computes Structural Similarity (SSIM) Index. [1]

Both video inputs are compared frame-by-frame to obtain T SSIM measurements on the luminance channel.

Parameters:

referenceVideoData : ndarray

Reference video, ndarray of dimension (T, M, N, C), (T, M, N), (M, N, C), or (M, N), where T is the number of frames, M is the height, N is width, and C is number of channels. Here C is only allowed to be 1.

distortedVideoData : ndarray

Distorted video, ndarray of dimension (T, M, N, C), (T, M, N), (M, N, C), or (M, N), where T is the number of frames, M is the height, N is width, and C is number of channels. Here C is only allowed to be 1.

K_1 : float

Luminance saturation weight

K_2 : float

Contrast saturation weight

bitdepth : int

The number of bits each pixel effectively has

scaleFix : bool

Whether to scale the input frame size based on assumed distance, to improve subjective correlation.

avg_window : ndarray

2-d averaging window, normalized to unit volume.

Returns:

ssim_array : ndarray

The ssim results, ndarray of dimension (T,), where T is the number of frames

References

[1]
  1. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, “Image quality assessment: From error measurement to structural similarity” IEEE Transactions on Image Processing, vol. 13, no. 1, Jan. 2004.