tfmri.image.gmsd2d

gmsd2d(img1, img2, max_val=1.0, name=None)[source]

Computes the gradient magnitude similarity deviation (GMSD).

Parameters
  • img1 – A Tensor. First batch of images. Must have rank >= 3 with shape batch_shape + [height, width, channels]. Can have integer or floating point type, with values in the range [0, max_val].

  • img2 – A Tensor. Second batch of images. Must have rank >= 3 with shape batch_shape + [height, width, channels]. Can have integer or floating point type, with values in the range [0, max_val]

  • max_val – The dynamic range of the images (i.e., the difference between the maximum and the minimum allowed values). Defaults to 1 for floating point input images and MAX for integer input images, where MAX is the largest positive representable number for the data type.

  • name – Namespace to embed the computation in.

Returns

A scalar GMSD value for each pair of images in img1 and img2. The returned tensor has type tf.float32 and shape batch_shape.

References

1

W. Xue, L. Zhang, X. Mou and A. C. Bovik, “Gradient Magnitude Similarity Deviation: A Highly Efficient Perceptual Image Quality Index,” in IEEE Transactions on Image Processing, vol. 23, no. 2, pp. 684-695, Feb. 2014, doi: 10.1109/TIP.2013.2293423.