Dictionary containing the parameters for FSIM calculation.
Type:
dict
Parameters:
data_range ({1, 255, 65535}, default=255) – Data range of the returned data in data loading. Is used for image loading when
normalize is True and for the FSIM calculation. Passed to
viqa.utils.load_data() and score().
normalize (bool, default=False) – If True, the input images are normalized to the data_range argument.
**kwargs (optional) – Additional parameters for data loading. The keyword arguments are passed to
viqa.utils.load_data().
chromatic (bool, default False) – If True, the input images are expected to be RGB images and FSIMc is
calculated. See [1]. Passed to
piq.fsim(). See the documentation under [2].
Raises:
ValueError – If data_range is not set.
Warning
This metric is not yet tested. The metric should be only used for experimental
purposes.
The metric can be calculated for 2D and 3D images. If the images are 3D, the
metric can be calculated for the full volume or for a given slice of the image
by setting dim to the desired dimension and im_slice to the desired
slice number.
Parameters:
img_r (np.ndarray or Tensor or str or os.PathLike) – Reference image to calculate score against.
img_m (np.ndarray or Tensor or str or os.PathLike) – Distorted image to calculate score of.
dim ({0, 1, 2}, optional) – FSIM for 3D images is calculated as mean over all slices of the given
dimension.
im_slice (int, optional) – If given, FSIM is calculated only for the given slice of the 3D image.
**kwargs (optional) – Additional parameters for FSIM calculation. The keyword arguments are passed
to piq.fsim(). See the documentation under [3].
reduction (str, default='mean') – Specifies the reduction type: ‘none’, ‘mean’ or ‘sum’.
scales (int, default=4) – Number of wavelets used for computation of phase congruency maps.
orientations (int, default=4) – Number of filter orientations used for computation of phase congruency
maps.
min_length (int, default=6) – Wavelength of smallest scale filter.
mult (int, default=2) – Scaling factor between successive filters.
sigma_f (float, default=0.55) – Ratio of the standard deviation of the Gaussian describing the log Gabor
filter’s transfer function in the frequency domain to the filter center
frequency.
delta_theta (float, default=1.2) – Ratio of angular interval between filter orientations and the standard
deviation of the angular Gaussian function used to construct filters in
the frequency plane.
k (float, default=2.0) – 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.
ValueError – If invalid dimension given in dim.
If images are neither 2D nor 3D.
If images are 3D, but dim is not given.
If im_slice is given, but not an integer.
Warns:
RuntimeWarning – If dim or im_slice is given for 2D images.
If im_slice is not given, but dim is given for 3D images, FSIM is
calculated for the full volume.
Notes
For 3D images if dim is given, but im_slice is not, the FSIM is
calculated for the full volume of the 3D image. This is implemented as mean of
the FSIM values of all slices of the given dimension. If dim is given and
im_slice is given, the FSIM is calculated for the given slice of the given
dimension (represents a 2D metric of the given slice).