pyiqa.archs.fsim_arch¶
FSIM Metric
- @article{zhang2011fsim,
title={FSIM: A feature similarity index for image quality assessment}, author={Zhang, Lin and Zhang, Lei and Mou, Xuanqin and Zhang, David}, journal={IEEE transactions on Image Processing}, volume={20}, number={8}, pages={2378–2386}, year={2011}, publisher={IEEE}
}
Created by: https://github.com/photosynthesis-team/piq/blob/master/piq/fsim.py Modified by: Jiadi Mo (https://github.com/JiadiMo)
- Refer to:
Official matlab code from https://www4.comp.polyu.edu.hk/~cslzhang/IQA/FSIM/Files/FeatureSIM.m PIQA from https://github.com/francois-rozet/piqa/blob/master/piqa/fsim.py
Module Contents¶
- pyiqa.archs.fsim_arch.fsim(x: torch.Tensor, y: torch.Tensor, chromatic: bool = True, scales: int = 4, orientations: int = 4, min_length: int = 6, mult: int = 2, sigma_f: float = 0.55, delta_theta: float = 1.2, k: float = 2.0) torch.Tensor[source]¶
Compute Feature Similarity Index Measure for a batch of images. :param - x: An input tensor. Shape \((N, C, H, W)\). :param - y: A target tensor. Shape \((N, C, H, W)\). :param - chromatic: Flag to compute FSIMc, which also takes into account chromatic components :param - scales: Number of wavelets used for computation of phase congruensy maps :param - orientations: Number of filter orientations used for computation of phase congruensy maps :param - min_length: Wavelength of smallest scale filter :param - mult: Scaling factor between successive filters :param - sigma_f: Ratio of the standard deviation of the Gaussian describing the log Gabor filter’s :param transfer function in the frequency domain to the filter center frequency.: :param - delta_theta: Ratio of angular interval between filter orientations and the standard deviation :param of the angular Gaussian function used to construct filters in the frequency plane.: :param - k: No of standard deviations of the noise energy beyond the mean at which we set the noise
threshold point, below which phase congruency values get penalized.
- Returns:
Index of similarity between two images. Usually in [0, 1] interval.
Can be bigger than 1 for predicted \(x\) images with higher contrast than the original ones.
References
L. Zhang, L. Zhang, X. Mou and D. Zhang, “FSIM: A Feature Similarity Index for Image Quality Assessment,” IEEE Transactions on Image Processing, vol. 20, no. 8, pp. 2378-2386, Aug. 2011, doi: 10.1109/TIP.2011.2109730. https://ieeexplore.ieee.org/document/5705575
- class pyiqa.archs.fsim_arch.FSIM(chromatic: bool = True, scales: int = 4, orientations: int = 4, min_length: int = 6, mult: int = 2, sigma_f: float = 0.55, delta_theta: float = 1.2, k: float = 2.0)[source]¶
Bases:
torch.nn.Module- Parameters:
chromatic (-) – Flag to compute FSIMc, which also takes into account chromatic components
scales (-) – Number of wavelets used for computation of phase congruensy maps
orientations (-) – Number of filter orientations used for computation of phase congruensy maps
min_length (-) – Wavelength of smallest scale filter
mult (-) – Scaling factor between successive filters
sigma_f (-) – Ratio of the standard deviation of the Gaussian describing the log Gabor filter’s
frequency. (transfer function in the frequency domain to the filter center)
delta_theta (-) – Ratio of angular interval between filter orientations and the standard deviation
plane. (of the angular Gaussian function used to construct filters in the frequency)
k (-) – No of standard deviations of the noise energy beyond the mean at which we set the noise threshold point, below which phase congruency values get penalized.
References
L. Zhang, L. Zhang, X. Mou and D. Zhang, “FSIM: A Feature Similarity Index for Image Quality Assessment,” IEEE Transactions on Image Processing, vol. 20, no. 8, pp. 2378-2386, Aug. 2011, doi: 10.1109/TIP.2011.2109730. https://ieeexplore.ieee.org/document/5705575