API Reference >>

`skvideo.measure`

.ssim
`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**: ndarrayReference 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**: ndarrayDistorted 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**: floatLuminance saturation weight

**K_2**: floatContrast saturation weight

**bitdepth**: intThe number of bits each pixel effectively has

**scaleFix**: boolWhether to scale the input frame size based on assumed distance, to improve subjective correlation.

**avg_window**: ndarray2-d averaging window, normalized to unit volume.

Returns: **ssim_array**: ndarrayThe ssim results, ndarray of dimension (T,), where T is the number of frames

References

[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.