def backproject_cubic(depth, shape, face):
a, b = tf.meshgrid(tf.linspace(-1.0, 1.0, shape[2]),
tf.linspace(-1.0, 1.0, shape[1]))
A = depth * tf.expand_dims(tf.tile(tf.expand_dims(a, 0), [shape[0], 1, 1]), 3)
B = depth * tf.expand_dims(tf.tile(tf.expand_dims(b, 0), [shape[0], 1, 1]), 3)
C = depth
x, y, z = switch_face(A, B, C, face)
return tf.sqrt(x ** 2.0 + z ** 2.0)
评论列表
文章目录