def isnr(vref, vdeg, vrst):
    """
    Compute Improvement Signal to Noise Ratio (ISNR) for reference,
    degraded, and restored images.

    Parameters
    ----------
    vref : array_like
      Reference image
    vdeg : array_like
      Degraded image
    vrst : array_like
      Restored image

    Returns
    -------
    x : float
      ISNR of `vrst` with respect to `vref` and `vdeg`
    """

    msedeg = mse(vref, vdeg)
    mserst = mse(vref, vrst)
    with np.errstate(divide='ignore'):
        rt = msedeg / mserst
    return 10.0 * np.log10(rt)
def isnr ( vref , vdeg , vrst ) : msedeg = mse ( vref , vdeg ) mserst = mse ( vref , vrst ) with np . errstate ( divide = 'ignore' ) : rt = msedeg / mserst return 10.0 * np . log10 ( rt )
Compute Improvement Signal to Noise Ratio (ISNR) for reference,
    degraded, and restored images.

    Parameters
    ----------
    vref : array_like
      Reference image
    vdeg : array_like
      Degraded image
    vrst : array_like
      Restored image

    Returns
    -------
    x : float
      ISNR of `vrst` with respect to `vref` and `vdeg`