spherical.py 文件源码

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

项目:monodepth360 作者: srijanparmeshwar 项目源码 文件源码
def fast_rotate(input_image, dx = 0, dy = 0):
    # Basic rotations (constant disparities) for equirectangular
    # images. For image augmentations (y-axis rotations), this method is preferable compared
    # to the more general rotation function.
    height = tf.shape(input_image)[0]
    width = tf.shape(input_image)[1]

    # Shift coordinate grid for inverse warp.
    ix, iy = tf.meshgrid(tf.range(width), tf.range(height))
    ox = tf.mod(ix - dx, width)
    oy = tf.mod(iy - dy, height)
    indices = tf.stack([oy, ox], 2)

    # Perform exact sampling (as we are using integer coordinates).
    return tf.gather_nd(input_image, indices)

# Project equirectangular image onto a cube face.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号