Hi,

For context, I am a beginner trying to work with an Oak-d-lr device. I have followed  luxonis/oak-examplestree/main/depth-measurement/3d-measurement/rgbd-pointcloud to visualise pointclouds in real time from the oak device. I am now trying to create a custom node following https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/#Host%20Nodes, and then send PointCloudData object as output from my custom node to the dai.RemoteConnection() visualizer.

I am trying to create my own dai.PointCloudData() instance because I want to manually adjust the PointCloudData object I am getting from dai.node.RGBD. The issue I am facing is that the PointCloudData has its color property set as False by default whenever a new instance is created. I know the PointCloudData object is not coloured because isColor() returns False. There is no setColor() method. So, when I use setData() to give the new PointCloudData object points, it interprets my r, g, b values as x, y, z.

My question is: In Python, is it possible to create a new PointCloudData() instance with its color property set to True?

I would appreciate any guidance or help. I have also included my code below for additional context

buf = bytearray()

for pt in adjusted_points:

         buf.extend(struct.pack('fffBBB', *pt))

new_cloud = dai.PointCloudData() 

new_cloud.setData(buf)

    ash
    I think there should be a setPointsRGBsetter. I'm sure it exists in cpp, not sure if bindings exist for the python side. setColor is also available, but I think the bindings don't exist either.

    Thanks,
    Jaka

    • ash replied to this.
    • ash likes this.

      jakaskerl

      Hi,

      Thank you for answering my question. Looking into the source code, I see that both setPointsRGB and setColor do exist in cpp but the bindings do not exist for the python side (as you said).

      I'll try to convert to using cpp.

      Thanks again🙂