mosse.py 文件源码

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

项目:nimo 作者: wolfram2012 项目源码 文件源码
def resizeFilter(filter,size):            
    filter = np.fft.ifft2(filter)
    w,h = size

    fw,fh = filter.shape
    tmp = np.zeros((w,h), np.complex128) #TODO: check this

    w = min(w,fw)
    h = min(h,fh)

    tmp[ :w/2, :h/2] = filter[ :w/2, :h/2]
    tmp[ :w/2,-h/2:] = filter[ :w/2,-h/2:]
    tmp[-w/2:,-h/2:] = filter[-w/2:,-h/2:]
    tmp[-w/2:, :h/2] = filter[-w/2:, :h/2]

    return np.fft.fft2(tmp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号