model_input.py 文件源码

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

项目:SLAM 作者: sanjeevkumar42 项目源码 文件源码
def get_rgbd_file(self, dirname, offset):
        associations = self.seq_dir_map[dirname]['associations']

        if associations[offset, 1].startswith('depth'):
            rgb_filename = os.path.join(dirname, associations[offset, 3])
            depth_filename = os.path.join(dirname, associations[offset, 1])
        else:
            rgb_filename = os.path.join(dirname, associations[offset, 1])
            depth_filename = os.path.join(dirname, associations[offset, 3])

        rgb_img = ndimage.imread(rgb_filename)
        depth_img = ndimage.imread(depth_filename)
        width = height = 224

        # Reshape
        depth_img = np.reshape(depth_img, list(depth_img.shape) + [1])
        depth_img = 255 * depth_img / np.max(depth_img)

        rgbd_img = np.concatenate((rgb_img, depth_img), 2)

        # Resize
        rgbd_img = transform.resize(rgbd_img, [width, height], preserve_range=True)

        return rgb_filename, depth_filename, rgbd_img.astype(np.float32)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号