Hello,

I am using OAK-D SR camera, and depthai version 2.13.3.0. Could You tell me if there is a function or code example that can be used for getting point cloud data, control parameters and saves the data? I used point cloud demo (https://docs.luxonis.com/projects/sdk/en/latest/samples/PointcloudComponent/SDK_pointcloud/#pointcloud-demo) from depthai-sdk. It runs visualizer, but there is no option to save point cloud.

Additionally when I run stereo_depth_video.py with the same arguments set in viewer, I get the following disparity and depth (which does not look as good as point cloud).

Thanks,

Vuk

Hi Jaka,

Thanks for the reply. Is there any code examples of how to get point cloud at first place? I can convert depth map to point cloud by using intrinsic calibration matrix, but I guess there is a functionality in the API that I am missing.

Best regards,

Vuk

def callback(packet: PointcloudPacket) -> None:
    colors: np.ndarray = packet.colorize_frame
    depth: np.ndarray = packet.depth_map.getFrame(copy=True)

camera = OakCamera(device=camera_ip)
color = camera.create_camera('color', resolution=RESOLUTION, fps=FPS)
stereo = camera.create_stereo(resolution=RESOLUTION, fps=FPS)
stereo.set_auto_ir(auto_mode=True, continuous_mode=True)
stereo.config_stereo(align=color)
pcl = camera.create_pointcloud(stereo=stereo, colorize=color)
camera.callback(pcl, callback, False)
camera.start(False)

having colors and depth, u can create rgbd and then pcd (using o3d and camera intrinsics)

            colors: np.ndarray = packet.colorize_frame
            depth: np.ndarray = packet.depth_map.getFrame(copy=True)
            depth_image = o3d.geometry.Image(colors)
            rgb_image = o3d.geometry.Image(depth)
            rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
                rgb_image, depth_image, depth_trunc=10.0, convert_rgb_to_intensity=False)
            pcd = o3d.geometry.PointCloud.create_from_rgbd_image(
                rgbd_image, intrinsic)
    12 days later

    FYI, this had been merged to develop. I've been following it for a while but haven't had a chance to try the latest develop build. I'm guessing this is being rolled in to the next release:

    luxonis/depthai-core945