def METHOD_NAME(previous_img, current_img, precision=1):
    """
    The function is taken from skimage.registration._phase_cross_correlation.
    Given two images, it calculates the shift in x and y axis i.e in column-wise and horizontal-wise respectively.
    It first computes the cross-correlation of the two images. Then it modifies cross-correlation values
    by reducing the amplitude of noise and enhancing the shift amplitude. The coordinates
    of the maximum of the cross-correlation define the shift vector between the two images.
    The implementation is based on the "Efficient subpixel image registration by
    cross-correlation" by Manuel Guizar, for the corresponding matlab code see
    http://www.mathworks.com/matlabcentral/fileexchange/
    18401-efficient-subpixel-image-registration-by-cross-correlation.
    For e.g.
    When the current image moves to top left corner relatively to the previous image.
    The returned shift value is positive in both x and y respectively.
    previous_img (numpy.array): 2d array with the previous frame
    current_img (numpy.array): 2d array with the last frame, must be of same
      shape as previous_img
    precision (1<=int): Calculate drift within 1/precision of a pixel
    returns (tuple of floats): Drift in pixels (horizontal, vertical).
    """
    if precision < 1:
        raise ValueError("Precision cannot be less than 1, got %s." % (precision,))
    assert previous_img.shape == current_img.shape, "Prev shape %s != new shape %s" % (
        previous_img.shape, current_img.shape)
    previous_fft = fft.fft2(previous_img)
    current_fft = fft.fft2(current_img)
    shape = previous_fft.shape
    m, n = previous_fft.shape
    image_product = previous_fft * current_fft.conj()
    # Cross-correlation computation
    eps = numpy.finfo(image_product.real.dtype).eps
    # pixel magnitude below 100*eps is magnified whereas values above it are normalized to one
    # this helps in finding low magnitude pixels which are related to small shifts
    image_product /= numpy.maximum(numpy.abs(image_product), 100 * eps)
    float_dtype = image_product.real.dtype
    cross_correlation = fft.ifft2(image_product)
    # Locate maximum
    maxima = numpy.unravel_index(numpy.argmax(numpy.abs(cross_correlation)),
                                 cross_correlation.shape)
    midpoints = numpy.array([numpy.fix(axis_size / 2) for axis_size in shape])
    float_dtype = image_product.real.dtype
    shifts = numpy.stack(maxima).astype(float_dtype, copy=False)
    shifts[shifts > midpoints] -= numpy.array(shape)[shifts > midpoints]
    if precision > 1:
        shifts = numpy.round(shifts * precision) / precision
        upsampled_region_size = numpy.ceil(precision * 1.5)
        # Center of output array at dftshift + 1
        dftshift = numpy.fix(upsampled_region_size / 2.0)
        # Matrix multiply DFT around the current shift estimate
        sample_region_offset = dftshift - shifts * precision
        cross_correlation = _upsampled_dft(image_product.conj(),
                                           upsampled_region_size,
                                           precision,
                                           sample_region_offset).conj()
        # Locate maximum and map back to original pixel grid
        maxima = numpy.unravel_index(numpy.argmax(numpy.abs(cross_correlation)),
                                     cross_correlation.shape)
        maxima = numpy.stack(maxima).astype(float_dtype, copy=False)
        maxima -= dftshift
        shifts += maxima / precision
    return shifts[1], shifts[0]