monodepth_model.py 文件源码

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

项目:monodepth360 作者: srijanparmeshwar 项目源码 文件源码
def depth_to_disparity(self, depth, position):
        baseline_distance = self.params.baseline
        S, T = lat_long_grid([tf.shape(depth)[1], tf.shape(depth)[2]])
        _, T_grids = self.expand_grids(S, T, tf.shape(depth)[0])
        if position == "top":
            return self.disparity_scale * (np.pi / 2.0 - atan2(baseline_distance * depth, (1.0 + tf.tan(-T_grids) ** 2.0) * (depth ** 2.0) + baseline_distance * depth * tf.tan(-T_grids)))
        else:
            return self.disparity_scale * (atan2(baseline_distance * depth, (1.0 + tf.tan(-T_grids) ** 2.0) * (depth ** 2.0) - baseline_distance * depth * tf.tan(-T_grids)) - np.pi / 2.0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号