camera.py 文件源码

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

项目:deeptracking 作者: lvsn 项目源码 文件源码
def backproject_depth(self, depth):
        constant_x = 1.0 / self.focal_x
        constant_y = 1.0 / self.focal_y
        row, col = depth.shape
        coords = np.zeros((row, col, 2), dtype=np.uint)
        coords[..., 0] = np.arange(row)[:, None]
        coords[..., 1] = np.arange(col)
        coords = coords.reshape((-1, 2))
        output = np.zeros((len(coords), 3))
        values = depth[coords[:, 0], coords[:, 1]]
        output[:, 0] = (coords[:, 1] - self.center_x) * values * constant_x
        output[:, 1] = (coords[:, 0] - self.center_y) * values * constant_y
        output[:, 2] = values
        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号