cilissa.metrics - Image quality metrics

Classes

class cilissa.metrics.MSE(rmse: bool = False)[source]

Mean squared error (MSE)

Average squared difference between the estimated values and the actual value.

References

analyze(image_pair: cilissa.images.ImagePair)[source]
class cilissa.metrics.PSNR(max_pixel_value: int | None = None)[source]

Peak signal-to-noise ratio (PSNR)

Ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.

References

analyze(image_pair: cilissa.images.ImagePair)[source]
class cilissa.metrics.SSIM(channels_num: int | None = None, sigma: float = 1.5, truncate: float = 3.5, K1: float = 0.01, K2: float = 0.03)[source]

Structural similarity index measure (SSIM)

The SSIM Index quality assessment index is based on the computation of three terms, namely the luminance term, the contrast term and the structural term. The overall index is a multiplicative combination of the three terms.

Parameters:

channels_num (int/None) – If None, image is assumed to be grayscale (single channel). Otherwise the number of channels should be specified here.

Returns:

Overall quality measure of the entire image (MSSIM)

Return type:

float

References

analyze(image_pair: cilissa.images.ImagePair)[source]
mssim_single_channel(im1: numpy.ndarray, im2: numpy.ndarray)[source]
class cilissa.metrics.UIQI(channels_num: int | None = None, block_size: int = 8)[source]

Universal Image Quality Index (UIQI)

Combines loss of correlation, luminance distortion and contrast distortion. Predecessor of SSIM metric.

References

analyze(image_pair: cilissa.images.ImagePair)[source]
uiqi_single_channel(im1: numpy.ndarray, im2: numpy.ndarray)[source]
class cilissa.metrics.VIFP(channels_num: int | None = None, sigma: float = 2.0)[source]

Pixel Based Visual Information Fidelity (VIF-P)

Employs natural scene statistical (NSS) models in conjunction with a distortion (channel) model to quantify the information shared between the test and the reference images.

The pixel domain algorithm is not described in the paper below. This is a computationally simpler derivative of the algorithm presented in the paper, based on the original Matlab implementation.

References

analyze(image_pair: cilissa.images.ImagePair)[source]
vifp_single_channel(im1: numpy.ndarray, im2: numpy.ndarray)[source]
class cilissa.metrics.SAM(to_degrees: bool = True)[source]

Spectral Angle Mapper (SAM)

Physically-based spectral classification that uses an n-D angle to match pixels to reference spectra.

This technique is relatively insensitive to illumination and albedo effects.

References

analyze(image_pair: cilissa.images.ImagePair)[source]