Universal Quality Index (UQI)

Module for the Universal Quality Index (UQI) metric.

Notes

The Universal Quality Index [1] is a special case of the Structural Similarity Index (SSIM) [2]. Therefore, SSIM is used for calculating it.

References

Examples

>>> import numpy as np
>>> from viqa import UQI
>>> img_r = np.zeros((256, 256))
>>> img_m = np.ones((256, 256))
>>> uqi = UQI(data_range=1, normalize=False)
>>> uqi
UQI(score_val=None)
>>> score = uqi.score(img_r, img_m)
>>> score
0.0
>>> uqi.print_score()
UQI: 1.0
>>> img_r = np.zeros((256, 256))
>>> img_m = np.zeros((256, 256))
>>> uqi.score(img_r, img_m)
1.0
>>> img_r = np.random.rand(256, 256)
>>> img_m = np.random.rand(128, 128)
>>> uqi.score(img_r, img_m)
Traceback (most recent call last):
    ...
ValueError: Image shapes do not match

Classes

UQI([data_range, normalize])

Calculate the universal quality index (UQI) between two images.