/Structural-Similarity-Index-General-SSIM

This Python function calculates the structural similarity (SSIM) index for grayscale or color images.

Primary LanguagePythonMIT LicenseMIT

Introduction

This Python function calculates the structural similarity (SSIM) index for grayscale or color images. The index range from -1 to +1, closer to +1 indicates the high similarity to the reference image, -1 informs the highest dissimilarity.

Quick Pipeline Visualization

Example: SSIM value and map image.

SSIM value SSIM map image
0.9407032 ssim_map

Requirements

Python
Python Imaging Library (PIL)
NumPy library (numpy)
Matplotlib

References

[1]. Wang, Zhou, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli. "Image quality assessment: from error visibility to structural similarity." IEEE transactions on image processing 13, no. 4 (2004): 600-612.
[2]. Wang, Zhou, Eero P. Simoncelli, and Alan C. Bovik. "Multiscale structural similarity for image quality assessment." In The Thrity-Seventh Asilomar Conference on Signals, Systems & Computers, 2003, vol. 2, pp. 1398-1402. Ieee, 2003.

Feedback

Please provide feedback for further improvements.