esmraldi.haarpsi

This module contains a Python and NumPy implementation of the HaarPSI perceptual similarity index algorithm, as described in “A Haar Wavelet-Based Perceptual Similarity Index for Image Quality Assessment” by R. Reisenhofer, S. Bosse, G. Kutyniok and T. Wiegand.

Converted by David Neumann from the original MATLAB implementation written by Rafael Reisenhofer.

Last updated on 08/01/2018 by David Neumann.

Module Contents

Functions

haar_psi(reference_image, distorted_image[, ...])

Calculates the HaarPSI perceptual similarity index between the two specified images.

haar_psi_numpy(reference_image, distorted_image[, ...])

Calculates the HaarPSI perceptual similarity index between the two specified images. This implementation uses NumPy.

haar_psi_tensorflow(reference_image, distorted_image)

Calculates the HaarPSI perceptual similarity index between the two specified images. This implementation uses TensorFlow.

subsample(image)

Convolves the specified image with a 2x2 mean filter and performs a dyadic subsampling step. This

convolve2d(data, kernel[, mode])

Convolves the first input array with the second one in the same way MATLAB does. Due to an

haar_wavelet_decompose(image, number_of_scales)

Performs the Haar wavelet decomposition.

sigmoid(value, alpha)

Applies the sigmoid (logistic) function to the specified value.

logit(value, alpha)

Applies the logit function to the specified value, which is the reverse of the sigmoid

is_numpy(value)

Determines whether the specified value is a NumPy value, i.e. an numpy.ndarray or a NumPy scalar, etc.

is_tensorflow(value)

Determines whether the specified value is a TensorFlow value, i.e. an tensorflow.Variable or a

Attributes

is_tensorflow_available

esmraldi.haarpsi.is_tensorflow_available = True
esmraldi.haarpsi.haar_psi(reference_image, distorted_image, preprocess_with_subsampling=True)

Calculates the HaarPSI perceptual similarity index between the two specified images.

esmraldi.haarpsi.haar_psi_numpy(reference_image, distorted_image, preprocess_with_subsampling=True)

Calculates the HaarPSI perceptual similarity index between the two specified images. This implementation uses NumPy.

esmraldi.haarpsi.haar_psi_tensorflow(reference_image, distorted_image, preprocess_with_subsampling=True)

Calculates the HaarPSI perceptual similarity index between the two specified images. This implementation uses TensorFlow.

esmraldi.haarpsi.subsample(image)

Convolves the specified image with a 2x2 mean filter and performs a dyadic subsampling step. This simulates the typical distance between an image and its viewer.

esmraldi.haarpsi.convolve2d(data, kernel, mode='same')

Convolves the first input array with the second one in the same way MATLAB does. Due to an implementation detail, the SciPy and MATLAB implementations yield different results. This method rectifies this shortcoming of the SciPy implementation.

esmraldi.haarpsi.haar_wavelet_decompose(image, number_of_scales)

Performs the Haar wavelet decomposition.

esmraldi.haarpsi.sigmoid(value, alpha)

Applies the sigmoid (logistic) function to the specified value.

esmraldi.haarpsi.logit(value, alpha)

Applies the logit function to the specified value, which is the reverse of the sigmoid (logistic) function.

esmraldi.haarpsi.is_numpy(value)

Determines whether the specified value is a NumPy value, i.e. an numpy.ndarray or a NumPy scalar, etc.

esmraldi.haarpsi.is_tensorflow(value)

Determines whether the specified value is a TensorFlow value, i.e. an tensorflow.Variable or a tensorflow.Tensor, etc.