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:
referenceVideoDatandarray

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.

distortedVideoDatandarray

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_1float

Luminance saturation weight

K_2float

Contrast saturation weight

bitdepthint

The number of bits each pixel effectively has

scaleFixbool

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

avg_windowndarray

2-d averaging window, normalized to unit volume.

Returns:
ssim_arrayndarray

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

References