pyiqa.archs.entropy_arch

Entropy Metric for grayscale images. Entropy is a statistical measure of randomness that can be used to characterize the texture of the input image.

Created by: Chaofeng Chen (https://github.com/chaofengc)

Refer to:

Matlab: https://www.mathworks.com/help/images/ref/entropy.html

Module Contents

pyiqa.archs.entropy_arch.entropy(x, data_range=255.0, eps=1e-08, color_space='yiq')[source]

Compute entropy of a gray scale image. :param x: An input tensor. Shape \((N, C, H, W)\).

Returns:

Entropy of the image.

class pyiqa.archs.entropy_arch.Entropy(**kwargs)[source]

Bases: torch.nn.Module

Parameters:

x (torch.Tensor) – image tensor with shape (B, _, H, W), range [0, 1]

Returns:

(B, 1)

Return type:

score (torch.Tensor)

forward(x)[source]