cleaners.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:algorithm-reference-library 作者: SKA-ScienceDataProcessor 项目源码 文件源码
def convolve_scalestack(scalestack, img):
    """Convolve img by the specified scalestack, returning the resulting stack

    :param scalestack: stack containing the scales
    :param img: Image to be convolved
    :return: stack
    """

    convolved = numpy.zeros(scalestack.shape)
    ximg = numpy.fft.fftshift(numpy.fft.fft2(numpy.fft.fftshift(img)))

    nscales = scalestack.shape[0]
    for iscale in range(nscales):
        xscale = numpy.fft.fftshift(numpy.fft.fft2(numpy.fft.fftshift(scalestack[iscale, :, :])))
        xmult = ximg * numpy.conjugate(xscale)
        convolved[iscale, :, :] = numpy.real(numpy.fft.ifftshift(numpy.fft.ifft2(numpy.fft.ifftshift(xmult))))
    return convolved
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号