def snr_two_image(image, ref):
    """
    Two image signal to noise ratio after [1].
    
    Parameters
    ----------
    image : 2-D array
        Input image used to calculate SNR.
    ref : 2-D array
        Reference image used to calculate SNR.
    
    Returns
    -------
    snr : float
        The signal to noise ratio.
    
    Notes
    -----
    This implementation assumes the images are aligned.
    
    References
    ----------
    1. J. Frank, The Role of Correlation Techniques in Computer Image Processing. In Computer Processing of Electron Microscope Images (Ed. Peter W. Hawkes), Springer Heidelberg, Berlin (1980).
    https://link.springer.com/chapter/10.1007/978-3-642-81381-8_5
    
    """
    cc = (image * ref).sum() / image.size
    im, iv = image.mean(), image.std()
    rm, rv = ref.mean(), ref.std()
    rho = (cc - im * rm) / (iv * rv)
    snr = rho / (1 - rho)
    return snr
