c_renderer.py 文件源码

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

项目:word-render 作者: eragonruan 项目源码 文件源码
def apply_distortion_maps(self, arr, dispx, dispy):
        """
        Applies distortion maps generated from ElasticDistortionState
        """
        origarr = arr.copy()
        xx, yy = n.mgrid[0:dispx.shape[0], 0:dispx.shape[1]]
        xx = xx + dispx
        yy = yy + dispy
        coords = n.vstack([xx.flatten(), yy.flatten()])
        arr = ndimage.map_coordinates(origarr, coords, order=1, mode='nearest')
        return arr.reshape(origarr.shape)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号