stereolabs / zed-python-api

Python API for the ZED SDK
https://www.stereolabs.com/docs/app-development/python/install/
MIT License
209 stars 95 forks source link

get point cloud data file (.pcd) #207

Closed dohyeonYoon closed 2 years ago

dohyeonYoon commented 2 years ago

Preliminary Checks

Proposal

Hello I am trying to get RGB image file (.jpeg) and point cloud data file (.pcd) through zed camera with python.

But in python api

point_cloud = sl.Mat()
zed.retrieve_measure(point_cloud, sl.MEASURE.XYZRGBA)

point3D = point_cloud.get_value(i,j)
x = point3D[0]
y = point3D[1]
z = point3D[2]

color = point3D[3]

with the getValue() function as in the code I could only get the pointcloud information of a specific pixel.

How can I save whole point cloud data file in .pcd format with python?

I need the full point cloud data file.

best regards, dohyeon

Use-Case

No response

Anything else?

No response

obraun-sl commented 2 years ago

Hi,

You can use the write() function of sl.Mat to write the point cloud in a file : https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1Mat.html#ae0568cd94ee09fa51eaf50679e3a2def

--> point_cloud.write("test.pcd");

dohyeonYoon commented 2 years ago

hello oliver

thank you so much !!!!

I solve the problem ! :)

best regards dohyeon

2022년 2월 3일 (목) 오후 4:39, Oliver Braun @.***>님이 작성:

Hi,

You can use the write() function of sl.Mat to write the point cloud in a file :

https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1Mat.html#ae0568cd94ee09fa51eaf50679e3a2def

--> point_cloud.write("test.pcd");

— Reply to this email directly, view it on GitHub https://github.com/stereolabs/zed-python-api/issues/207#issuecomment-1028687779, or unsubscribe https://github.com/notifications/unsubscribe-auth/APX7B6FLAFDAYDSMCTSJUMLUZIWMLANCNFSM5NNYKK4A . You are receiving this because you authored the thread.Message ID: @.***>