loading a saved point cloud as an sl.mat()

Hi, I’ve saved a point cloud and want to load it in a separate script as an sl.mat(). I haven’t yet found anything in the documentation that indicates how to do this but a previous answer from 2021 suggested this would be available in a future SDK release. Is this now possible?
Many thanks in advance for your help.

Hi @yosue
Welcome to the Stereolabs community.

This feature will not be added to the SDK anymore because there are no functions available to manipulate point clouds that could justify a similar function.

Can you please explain why you think it could be useful to you?

Thank you for your response at @Myzhar
I am projecting a mask that I get from inference onto the point cloud, and wanted to do this using the Zed SDK, since I’ve had trouble loading the point cloud using other Python libraries.

Have you tried Open3D or PCL?
They are specifically designed to process 3D data and point clouds.

Hi @Myzhar. Thank you for getting back to me. I’ve tried with Open3d and PCL but the point cloud is flattened in both cases.
While the shape of the original point cloud is (1200, 1920, 4), after loading it in both libraries it becomes (1569420, 3). I am not filtering NAs or infinite values.
This makes it harder to find a correspondence between areas (i.e height x width pixels) in the RGB image and the cloud map.
The only way around this that I’ve found is by saving the point cloud as a numpy array
Do you have a sense of how to to get around this? Or perhaps if there are any resources that show how to work with ZED + Open3d in Python?

Hi @yosue
this normally happens when you do not consider the point cloud as “organized”:
https://pointclouds.org/documentation/tutorials/basic_structures.html

Thank again for your help, @Myzhar . This is good to know. Is there something that I can specify to the write method in the ZED sdk to ensure that the point cloud is saved as “organized”?

This is not possible. You must create your write function to save the point cloud in this format.
Maybe it’s better if you convert the point cloud into an external format, e.g. PCL, and then use their write functions.