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 grayscale entropy from an image tensor.
- Parameters:
x (torch.Tensor) – Input tensor with shape
(N, C, H, W).data_range (float) – Maximum intensity value used for histogram bins.
eps (float) – Numerical stability constant in
log2.color_space (str) – Color space used when converting RGB to luminance.
- Returns:
Entropy values with shape
(N,).- Return type:
torch.Tensor