navierStokes.py 文件源码

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

项目:imgProcessor 作者: radjkarl 项目源码 文件源码
def shiftImage(u, v, t, img, interpolation=cv2.INTER_LANCZOS4):
    '''
    remap an image using velocity field
    '''
    ny,nx = u.shape
    sy, sx = np.mgrid[:float(ny):1,:float(nx):1]
    sx += u*t
    sy += v*t
    return cv2.remap(img.astype(np.float32), 
                    (sx).astype(np.float32),
                    (sy).astype(np.float32), interpolation)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号