core.py 文件源码

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

项目:pyrealsense 作者: toinsson 项目源码 文件源码
def _get_pointcloud(self):
        ds = [s for s in self.streams if type(s) is DepthStream][0]

        e = ctypes.POINTER(rs_error)()
        lrs.rs_get_frame_data.restype = ndpointer(dtype=ctypes.c_uint16, shape=(ds.height, ds.width))
        depth = lrs.rs_get_frame_data(self.dev, rs_stream.RS_STREAM_DEPTH, ctypes.byref(e))

        pointcloud = np.zeros((ds.height * ds.width * 3), dtype=np.float32)

        # ugly fix for outliers
        depth[0, :2] = 0

        rsutilwrapper.deproject_depth(pointcloud, self.depth_intrinsics, depth, self.depth_scale)
        return pointcloud.reshape((ds.height, ds.width, 3))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号